makefiles-rewrite-for-objdir-support-20011023
authorNathan Neulinger <nneul@umr.edu>
Tue, 23 Oct 2001 19:56:56 +0000 (19:56 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 23 Oct 2001 19:56:56 +0000 (19:56 +0000)
rewrite makefiles to support objdir; simplify in the process

src/afs/Makefile.in
src/config/Makefile.hp_ux102.in
src/config/Makefile.hp_ux110.in
src/libacl/Makefile.in
src/login/Makefile.in
src/vfsck/Makefile.in

index bf58fc6..f7af5ef 100644 (file)
@@ -43,11 +43,9 @@ all: kinstall ukinstall ${TOP_INCDIR}/afs/afs.h ${TOP_INCDIR}/afs/osi_inode.h ${
 # gencat.
 kinstall: ${KERNELDIR}/afs AFS_component_version_number.c afszcm.cat
        -chmod 666 ${KERNELDIR}/afs/*
-       ${INSTALL} ${srcdir}/*.[csh] ${KERNELDIR}/afs
-       -${INSTALL} *.[csh] ${KERNELDIR}/afs
+       ${INSTALL} ${srcdir}/*.[csh] *.[csh] ${KERNELDIR}/afs
        ${INSTALL} ${srcdir}/VNOPS/*.[csh] ${KERNELDIR}/afs
-       ${INSTALL} ${srcdir}/${AFS_OSTYPE}/*.[csh] ${KERNELDIR}/afs
-       -${INSTALL} ${AFS_OSTYPE}/*.[csh] ${KERNELDIR}/afs
+       ${INSTALL} ${srcdir}/${AFS_OSTYPE}/*.[csh] ${AFS_OSTYPE}/*.[csh] ${KERNELDIR}/afs
 
 afs_trace.h afs_trace.msf:
        ${COMPILE_ET} -v 2 -p ${srcdir} afs_trace.et
@@ -70,8 +68,7 @@ ${KERNELDIR}/afs:
 
 ukinstall: ${UKERNELDIR}/afs afs_trace.msf AFS_component_version_number.c
        -chmod 666 ${UKERNELDIR}/afs/*
-       ${INSTALL} *.[csh] ${UKERNELDIR}/afs
-       ${INSTALL} ${srcdir}/*.[csh] ${UKERNELDIR}/afs
+       ${INSTALL} ${srcdir}/*.[csh] *.[csh] ${UKERNELDIR}/afs
        ${INSTALL} ${srcdir}/VNOPS/*.[csh] ${UKERNELDIR}/afs
        ${INSTALL} ${srcdir}/UKERNEL/*.[csh] ${UKERNELDIR}/afs
 
index f136dab..cff9fa4 100644 (file)
@@ -11,6 +11,7 @@ MT_CC=/opt/ansic/bin/cc -Ae
 XCFLAGS0=-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE
 XCFLAGS=${XCFLAGS0} +DA1.0
 XCFLAGS64=${XCFLAGS0} +DA2.0W
+VFSCK_CFLAGS=-D_FILE64
 MT_CFLAGS=-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}
 XLIBS=@LIB_AFSDB@
 XLIBELFA=
index 6590919..ca410c0 100644 (file)
@@ -11,6 +11,7 @@ MT_CC=/opt/ansic/bin/cc
 XCFLAGS0=-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE
 XCFLAGS=${XCFLAGS0} +DA1.0
 XCFLAGS64=${XCFLAGS0} +DA2.0W
+VFSCK_CFLAGS=-I/usr/old/usr/include -D_FILE64
 MT_CFLAGS=-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}
 XLIBS=@LIB_AFSDB@ -lnsl
 XLIBELFA=-lelf
index 2f3651a..5176725 100644 (file)
@@ -31,76 +31,95 @@ SHELL = /bin/sh
 
 include ../config/Makefile.${SYS_NAME}
 
-INCDIRS=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -I.. \
-       -I${BACKDIR}/include -I${TOP_INCDIR}/afs
-KERNELDIR = ../libafs/
-UKERNELDIR = ../libuafs/
-
-CFLAGS = ${OPTMZ} ${INCDIRS} ${LDIRS} ${LIBS} ${XCFLAGS}
-
-LIBOBJS=aclprocs.o netprocs.o
-
-include ../config/Makefile.version
-
-all: kinstall ukinstall ${TOP_LIBDIR}/libacl.a ${TOP_INCDIR}/afs/acl.h ${TOP_INCDIR}/afs/prs_fs.h
-
-libacl.a: $(LIBOBJS) AFS_component_version_number.o
+CFLAGS = ${OPTMZ} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} \
+       -I${TOP_INCDIR}/afs ${LIBS} ${XCFLAGS}
+
+KERNELDIR = ../libafs
+UKERNELDIR = ../libuafs
+
+#
+# Main targets
+#
+all: \
+       ${TOP_LIBDIR}/libacl.a \
+       ${TOP_INCDIR}/afs/acl.h \
+       ${TOP_INCDIR}/afs/prs_fs.h \
+       ${KERNELDIR}/afs \
+       ${KERNELDIR}/afs/prs_fs.h \
+       ${UKERNELDIR}/afs \
+       ${UKERNELDIR}/afs/prs_fs.h
+
+libacl.a: aclprocs.o netprocs.o AFS_component_version_number.o
        $(RM) -f $@
-       $(AR) crv $@ $(LIBOBJS) AFS_component_version_number.o
+       $(AR) crv $@ aclprocs.o netprocs.o AFS_component_version_number.o
        $(RANLIB) $@
 
 aclprocs.o: aclprocs.c acl.h
 
 netprocs.o: netprocs.c acl.h
 
-clean: 
-       $(RM) -f acltest *.o libacl.a core AFS_component_version_number.c
-
-system: install
-
-kinstall:
-       ${INSTALL} ${srcdir}/prs_fs.h ${KERNELDIR}/afs/prs_fs.h
-
-ukinstall webinstall:
-       ${INSTALL} ${srcdir}/prs_fs.h ${UKERNELDIR}/afs/prs_fs.h
+#
+# Installation targets
+#
 
-install:    ${DESTDIR}${libdir}/afs/libacl.a ${DESTDIR}${includedir}/afs/acl.h ${DESTDIR}${includedir}/afs/prs_fs.h
+${TOP_LIBDIR}/libacl.a: libacl.a
+       ${INSTALL} $? $@
 
-test:
-       cd test; $(MAKE)
+${TOP_INCDIR}/afs/acl.h: acl.h
+       ${INSTALL} $? $@
 
-${DEST}/lib/afs/libacl.a: libacl.a
+${TOP_INCDIR}/afs/prs_fs.h: prs_fs.h
        ${INSTALL} $? $@
 
-${DESTDIR}${libdir}/afs/libacl.a: libacl.a
+${KERNELDIR}/afs:
+       mkdir -p $? $@
+
+${KERNELDIR}/afs/prs_fs.h: prs_fs.h
        ${INSTALL} $? $@
 
+${UKERNELDIR}/afs:
+       mkdir -p $? $@
 
-${TOP_LIBDIR}/libacl.a: libacl.a
+${UKERNELDIR}/afs/prs_fs.h: prs_fs.h
        ${INSTALL} $? $@
 
+install: \
+       ${DESTDIR}${libdir}/afs/libacl.a \
+       ${DESTDIR}${includedir}/afs/acl.h \
+       ${DESTDIR}${includedir}/afs/prs_fs.h
 
-${DEST}/include/afs/acl.h: acl.h
+${DESTDIR}${libdir}/afs/libacl.a: libacl.a
        ${INSTALL} $? $@
 
 ${DESTDIR}${includedir}/afs/acl.h: acl.h
        ${INSTALL} $? $@
 
+${DESTDIR}${includedir}/afs/prs_fs.h: prs_fs.h
+       ${INSTALL} $? $@
+
+dest: ${DEST}/lib/afs/libacl.a \
+       ${DEST}/include/afs/acl.h \
+       ${DEST}/include/afs/prs_fs.h
 
-${TOP_INCDIR}/afs/acl.h: acl.h
+${DEST}/lib/afs/libacl.a: libacl.a
        ${INSTALL} $? $@
 
+${DEST}/include/afs/acl.h: acl.h
+       ${INSTALL} $? $@
 
 ${DEST}/include/afs/prs_fs.h: prs_fs.h
        ${INSTALL} $? $@
 
-${DESTDIR}${includedir}/afs/prs_fs.h: prs_fs.h
-       ${INSTALL} $? $@
 
+#
+# Misc. targets
+#
+test:
+       cd test; $(MAKE)
 
-${TOP_INCDIR}/afs/prs_fs.h: prs_fs.h
-       ${INSTALL} $? $@
+clean: 
+       $(RM) -f acltest *.o *.a core AFS_component_version_number.c
 
+include ../config/Makefile.version
 
-dest:    ${DEST}/lib/afs/libacl.a ${DEST}/include/afs/acl.h ${DEST}/include/afs/prs_fs.h
 
index 96b1c53..a494da5 100644 (file)
@@ -56,32 +56,25 @@ KAFSLIBS = ${TOP_LIBDIR}/libkauth.krb.a ${TOP_LIBDIR}/libprot.a \
           ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libcmd.a \
           ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/util.a
 
-INCLUDES=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} -I/usr/include -I/usr/include/sys
-CFLAGS=        -g ${XCFLAGS} ${INCLUDES}
-LIBC=  /lib/libc.a
+CFLAGS=        -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS} 
+
 SRCS=  login.c 
 OBJS=   login.o setenv.o getenv.o libutil.a
 KOBJS=  login.krb.o setenv.o getenv.o libutil.a
-LIBS=   ${AFSLIBS} 
-KLIBS=   ${KAFSLIBS}
-SLIBS=   ${AFSLIBS} ${LIBC}
-SKLIBS=   ${KAFSLIBS} ${LIBC}
 UTILOBJS = util_login.o util_logout.o util_logwtmp.o
 
-include ../config/Makefile.version
-
 all: login login.krb
 
-login: ${OBJS} ${LIBS}
+login: ${OBJS} ${AFSLIBS}
        case ${SYS_NAME} in \
-       sun4x_5?|sunx86_5? ) ${CC} -g -o $@ ${CFLAGS} ${OBJS} -lc ${LIBS} ${XLIBS} -lcmd;;\
-       *) ${CC} -g -o $@ ${CFLAGS} ${OBJS} ${LIBS} ${XLIBS} ;;\
+       sun4x_5?|sunx86_5? ) ${CC} -g -o $@ ${CFLAGS} ${OBJS} -lc ${AFSLIBS} ${XLIBS} -lcmd;;\
+       *) ${CC} -g -o $@ ${CFLAGS} ${OBJS} ${AFSLIBS} ${XLIBS} ;;\
        esac 
 
-login.krb: ${KOBJS} ${KLIBS}
+login.krb: ${KOBJS} ${KAFSLIBS}
        case ${SYS_NAME} in \
-       sun4x_5?|sunx86_5? ) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} -lc ${KLIBS} ${XLIBS} -lcmd;;\
-       *) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} ${KLIBS} ${XLIBS} ;;\
+       sun4x_5?|sunx86_5? ) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} -lc ${KAFSLIBS} ${XLIBS} -lcmd;;\
+       *) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} ${KAFSLIBS} ${XLIBS} ;;\
        esac 
 
 libutil.a : ${UTILOBJS}
@@ -90,36 +83,41 @@ libutil.a : ${UTILOBJS}
        $(RANLIB) $@
 
 login.o: login.c AFS_component_version_number.c
-       ${CC} ${CFLAGS} -c login.c
+       ${CC} ${CFLAGS} -c ${srcdir}/login.c
 
 login.krb.o: login.c
-       ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c login.c
+       ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/login.c
        mv login.o login.krb.o
 
-clean:
-       $(RM) -f *.o ${OBJS} core login AFS_component_version_number.c
-
-cleandir: clean
-       $(RM) -f ${MAN} tags .depend
-
-depend: ${SRCS}
-       mkdep -p ${CFLAGS} ${SRCS}
-
-install:  ${DESTDIR}${bindir}/login  ${DESTDIR}${bindir}/login.krb
+#
+# Installation targets
+#
+install: \
+       ${DESTDIR}${bindir}/login \
+       ${DESTDIR}${bindir}/login.krb
 
-${DEST}/bin/login: login
+${DESTDIR}${bindir}/login: login
        ${INSTALL} $? $@
 
-${DESTDIR}${bindir}/login: login
+${DESTDIR}${bindir}/login.krb: login.krb
        ${INSTALL} $? $@
 
 
-${DEST}/bin/login.krb: login.krb
+dest: \
+       ${DEST}/bin/login \
+       ${DEST}/bin/login.krb
+
+${DEST}/bin/login: login
        ${INSTALL} $? $@
 
-${DESTDIR}${bindir}/login.krb: login.krb
+${DEST}/bin/login.krb: login.krb
        ${INSTALL} $? $@
 
+#
+# Misc. targets
+#
+clean:
+       $(RM) -f *.o ${OBJS} core login AFS_component_version_number.c
 
-dest:   ${DEST}/bin/login ${DEST}/bin/login.krb
+include ../config/Makefile.version
 
index df5da14..32bdc74 100644 (file)
@@ -41,54 +41,28 @@ SYS_NAME=@AFS_SYSNAME@
 
 include ../config/Makefile.${SYS_NAME}
 
-CFLAGS=-I. -I${srcdir} ${DBUG} -w -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS}
-LIBC=  /lib/libc.a
-SRCS=  ${srcdir}/dir.c ${srcdir}/inode.c ${srcdir}/main.c ${srcdir}/pass1.c ${srcdir}/pass1b.c \
-       ${srcdir}/pass2.c ${srcdir}/pass3.c ${srcdir}/pass4.c ${srcdir}/pass5.c ${srcdir}/setup.c \
-       ${srcdir}/utilities.c ${srcdir}/ufs_subr.c ${srcdir}/ufs_tables.c ${srcdir}/dirutils.c \
-       ${srcdir}/vprintf.c ${srcdir}/proplist.c
-LOCOBJS=dir.o inode.o main.o pass1.o pass1b.o pass2.o pass3.o pass4.o \
-       pass5.o setup.o utilities.o dirutils.o vprintf.o proplist.o
-SYSOBJS=ufs_subr.o ufs_tables.o
-OBJS=  ${LOCOBJS} ${SYSOBJS}
-MAN =
-#MAN=  fsck.0
+CFLAGS=-I. -I${srcdir} ${DBUG} -w -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} \
+       ${XCFLAGS} ${VFSCK_CFLAGS}
 
-include ../config/Makefile.version
+SRCS= dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c \
+       pass4.c pass5.c setup.c utilities.c ufs_subr.c \
+       ufs_tables.c dirutils.c vprintf.c proplist.c
+
+OBJS= dir.o inode.o main.o pass1.o pass1b.o pass2.o pass3.o pass4.o \
+       pass5.o setup.o utilities.o dirutils.o vprintf.o proplist.o \
+       ufs_subr.o ufs_tables.o
 
 all: vfsck
 
-vfsck: main.o ${OBJS} 
-
-${OBJS}:       ${SRCS}
-       case ${SYS_NAME} in                                     \
-         hp_ux11? )                                            \
-           ${CC} -o vfsck -I/usr/old/usr/include ${DBUG} -w -I${TOP_INCDIR} ${SRCS} ${NON_SHARED} +DA1.0 -Wl,-a,archive -D_FILE64 \
-                       ;;                                      \
-         hp?00_ux101 | hp_ux10? )                              \
-           ${CC} -o vfsck ${CFLAGS} ${SRCS} ${NON_SHARED} ${XLIBS} -D_FILE64\
-                       ;;                                      \
-           * )                                                 \
-           ${CC} -o vfsck ${CFLAGS} ${SRCS} ${NON_SHARED} ${XLIBS}\
-                       ;;                                      \
-       esac
+vfsck: ${OBJS} 
+       ${CC} -o vfsck ${CFLAGS} ${OBJS} ${NON_SHARED} ${XLIBS}
 
 main.o: main.c AFS_component_version_number.c
 
-#${LOCOBJS}:
-#      ${CC} ${CFLAGS} -c $*.c
-
-clean:
-       $(RM) -f ${OBJS} vfsck core AFS_component_version_number.c
-
-cleandir: clean
-       $(RM) -f ${MAN} tags .depend
-
-depend: ${SRCS}
-       mkdep ${CFLAGS} ${SRCS}
-
-system: install
 
+#
+# Installation targets
+#
 install: ${DESTDIR}${afssrvlibexecdir}/vfsck
 
 ${DEST}/root.server/etc/vfsck: vfsck
@@ -100,20 +74,25 @@ ${DEST}/root.server/usr/afs/bin/vfsck: vfsck
 ${DESTDIR}${afssrvlibexecdir}/vfsck: vfsck
        ${INSTALL} $? $@
 
-
 dest: ${DEST}/root.server/etc/vfsck ${DEST}/root.server/usr/afs/bin/vfsck
-       case ${SYS_NAME} in                             \
-               hp_ux10? )                              \
-                       ${CP} ${srcdir}/bcheckrc ${DEST}/root.server/etc; \
-                       ;;                              \
-               hp_ux11? )                              \
-                       ${CP} ${srcdir}/bcheckrc-hp_ux110 ${DEST}/root.server/etc/bcheckrc; \
-                       ;;                              \
+       case ${SYS_NAME} in \
+               hp_ux10?) \
+                       ${CP} ${srcdir}/bcheckrc ${DEST}/root.server/etc ;; \
+               hp_ux11?) \
+                       ${CP} ${srcdir}/bcheckrc-hp_ux110 ${DEST}/root.server/etc/bcheckrc ;; \
        esac
-       case ${SYS_NAME} in                             \
-               hp_ux10? | hp_ux11? )                   \
-                        ${CP} ${srcdir}/mount ${DEST}/root.server/etc ;\
-                        ${CP} ${srcdir}/umount ${DEST}/root.server/etc; \
-                        chmod 755 ${DEST}/root.server/etc/bcheckrc ${DEST}/root.server/etc/mount ${DEST}/root.server/etc/umount ;\
-                               ;;                                      \
+       case ${SYS_NAME} in \
+               hp_ux10? | hp_ux11? ) \
+                       ${CP} ${srcdir}/mount ${DEST}/root.server/etc; \
+                       ${CP} ${srcdir}/umount ${DEST}/root.server/etc; \
+                       chmod 755 ${DEST}/root.server/etc/bcheckrc ${DEST}/root.server/etc/mount ${DEST}/root.server/etc/umount ;\
+                               ;; \
        esac
+
+#
+# Misc targets
+#
+clean:
+       $(RM) -f ${OBJS} vfsck core AFS_component_version_number.c
+
+include ../config/Makefile.version