venus: fix memory leak
[openafs.git] / src / libafs / MakefileProto.DUX.in
index b13b232..c189d9c 100644 (file)
@@ -5,23 +5,23 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-# MakefileProto for Digital Unix systems
-#
-DESTDIR=@DESTDIR@
-SRCDIR=@SRCDIR@
-TOP_SRCDIR=@TOP_SRCDIR@
-SYS_NAME=@AFS_SYSNAME@
-
-include ../config/Makefile.${SYS_NAME}
+srcdir=@srcdir@
+include @TOP_OBJDIR@/src/config/Makefile.config
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
 
 
 # OS specific object files:
 AFS_OS_OBJS = \
+       osi_gcpags.o \
        osi_groups.o \
        osi_file.o \
        osi_inode.o \
        osi_misc.o \
        osi_sleep.o \
+       osi_vcache.o \
        osi_vm.o \
        osi_vnodeops.o 
 
@@ -43,7 +43,7 @@ DBUG = -O2 -g3
 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
 OPTF=${OPT} 
 OPTF2=${OPT2} 
-CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
 
 
 # Name of directory to hold object files and libraries.
@@ -51,46 +51,56 @@ KOBJ = STATIC
 
 # This tells Makefile.common to use it's single directory build target.
 COMPDIRS = single_compdir
+INSTDIRS = single_instdir
+DESTDIRS = single_destdir
 
 include Makefile.common
 
 setup:
        -mkdir $(KOBJ)
-       -rm $(KOBJ)/Makefile $(KOBJ)/Makefile.common
-       ln -s ../Makefile $(KOBJ)/Makefile
-       ln -s ../Makefile.common $(KOBJ)/Makefile.common
-       -rm -f  h net netinet rpc ufs nfs  machine sys vm
-       -ln -s /usr/sys/include/net net
-       -ln -s /usr/sys/include/machine machine
-       -ln -s /usr/sys/include/netinet netinet
-       -ln -s /usr/sys/include/nfs nfs
-       -ln -s /usr/sys/include/rpc rpc
-       -ln -s /usr/sys/include/sys sys
-       -ln -s /usr/sys/include/ufs ufs
-       -ln -s /usr/sys/include/sys h
-       -ln -s /usr/sys/include/vm vm
+       -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
+       ln -fs ../Makefile $(KOBJ)/Makefile
+       ln -fs ../Makefile.common $(KOBJ)/Makefile.common
+       ln -fs ../config $(KOBJ)/config
+       -$(RM) -f  h net netinet rpc ufs nfs  machine sys vm
+       -ln -fs /usr/sys/include/net net
+       -ln -fs /usr/sys/include/machine machine
+       -ln -fs /usr/sys/include/netinet netinet
+       -ln -fs /usr/sys/include/nfs nfs
+       -ln -fs /usr/sys/include/rpc rpc
+       -ln -fs /usr/sys/include/sys sys
+       -ln -fs /usr/sys/include/ufs ufs
+       -ln -fs /usr/sys/include/sys h
+       -ln -fs /usr/sys/include/vm vm
        -touch $(KOBJ)/sec_net.h
 
 
 # Below this line are targets when in the COMMON directory:
 LIBAFS = libafs.o
 LIBAFSNONFS = libafs.nonfs.o
+AFSMOD = afs.mod
 
-DEST_LIBAFS = ${DESTDIR}/root.client/bin/${LIBAFS}
-DEST_LIBAFSNONFS = ${DESTDIR}/root.client/bin/${LIBAFSNONFS}
-
+INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
+INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
+INST_AFSMOD = ${DESTDIR}${afskerneldir}/${AFSMOD}
 
-# libafs:      $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
+DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
+DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
+DEST_AFSMOD = ${DEST}/root.client/bin/${AFSMOD}
 
-.PHONY: libafs
-libafs:        $(DEST_LIBAFSNONFS)
 
+.PHONY: libafs install_libafs
+libafs:        ${LIBAFSNONFS} ${AFSMOD}
 
-$(DEST_LIBAFS): $(LIBAFS)
-       $(INSTALL) -f $? $@
+install_libafs:        ${LIBAFSNONFS} ${AFSMOD}
+       ${INSTALL} -d ${DESTDIR}${afskerneldir}
+       $(INSTALL) -m 644 ${LIBAFSNONFS} ${INST_LIBAFSNONFS}
+       $(INSTALL) -m 644 ${AFSMOD} ${INST_AFSMOD}
 
-$(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
-       $(INSTALL) -f $? $@
+dest_libafs: ${LIBAFSNONFS} ${AFSMOD}
+       ${INSTALL} -d ${DEST}/root.client/bin
+       $(INSTALL) -m 644 ${LIBAFSNONFS} ${DEST_LIBAFSNONFS}
+       $(INSTALL) -m 644 ${AFSMOD} ${DEST_AFSMOD}
 
 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
        $(LD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS}
@@ -98,23 +108,5 @@ ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
        $(LD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}
 
-
-# Object build rules:
-osi_groups.o: $(AFS)/osi_groups.c
-       $(CRULE1)
-osi_file.o: $(AFS)/osi_file.c
-       $(CRULE1)
-osi_inode.o: $(AFS)/osi_inode.c
-       $(CRULE1)
-osi_misc.o: $(AFS)/osi_misc.c
-       $(CRULE1)
-osi_sleep.o: $(AFS)/osi_sleep.c
-       $(CRULE1)
-osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
-       $(CRULE1) -o osi_vfsops_nfs.o
-osi_vfsops.o: $(AFS)/osi_vfsops.c
-       $(CRULE1) -DAFS_NONFSTRANS
-osi_vm.o: $(AFS)/osi_vm.c
-       $(CRULE1)
-osi_vnodeops.o: $(AFS)/osi_vnodeops.c
-       $(CRULE1)
+${AFSMOD}: ${LIBAFSNONFS}
+       $(LD) -dc -r -o ${AFSMOD} ${LIBAFSNONFS}