makefiles-attempt-to-support-gmake-j-20011023
[openafs.git] / src / bozo / Makefile.in
index b285ba5..037de21 100644 (file)
@@ -5,8 +5,24 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-DESTDIR=@DESTDIR@
-SRCDIR=@SRCDIR@
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_OBJDIR=@TOP_OBJDIR@
+srcdir=@srcdir@
+VPATH=${srcdir}
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+RXGEN=${TOP_OBJDIR}/src/rxgen/rxgen
 TOP_SRCDIR=@TOP_SRCDIR@
 SYS_NAME=@AFS_SYSNAME@
 
@@ -14,52 +30,66 @@ SHELL=/bin/sh
 
 include ../config/Makefile.${SYS_NAME}
 
-COMPILE_ET=$(SRCDIR)bin/compile_et
-CFLAGS=-g -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
-RPCINCLS=${SRCDIR}include/lwp.h ${SRCDIR}include/rx/rx.h bosint.h
-INCLS=bnode.h ${RPCINCLS} ${SRCDIR}include/afs/auth.h \
-     ${SRCDIR}include/afs/keys.h  ${SRCDIR}include/afs/cellconfig.h \
-     ${SRCDIR}include/afs/cmd.h ${SRCDIR}include/afs/ktime.h
+COMPILE_ET=${TOP_OBJDIR}/src/comerr/compile_et
+CFLAGS=-g -I. -I${srcdir} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS}
+RPCINCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/rx/rx.h bosint.h
 
-auditlib=${SRCDIR}/lib/afs/libaudit.a
+INCLS=bnode.h \
+       ${RPCINCLS} \
+       ${TOP_INCDIR}/afs/auth.h \
+       ${TOP_INCDIR}/afs/keys.h \
+       ${TOP_INCDIR}/afs/cellconfig.h \
+       ${TOP_INCDIR}/afs/cmd.h \
+       ${TOP_INCDIR}/afs/ktime.h
 
-#have to search libauth.a twice to get error stuff done right.
 # EH 12/18/90 - have to search librx.a twice on Ultrix 4.0
-LIBS=${SRCDIR}lib/librx.a ${SRCDIR}lib/liblwp.a \
-     ${SRCDIR}lib/afs/libcmd.a ${SRCDIR}lib/afs/libkauth.a \
-     ${SRCDIR}lib/afs/libvolser.a \
-     ${SRCDIR}lib/afs/libvldb.a \
-     ${SRCDIR}lib/afs/libauth.a \
-     ${SRCDIR}lib/librxstat.a \
-     ${SRCDIR}lib/librxkad.a ${SRCDIR}lib/libdes.a \
-     ${SRCDIR}lib/librx.a \
-     ${SRCDIR}lib/libubik.a \
-     ${SRCDIR}lib/afs/libcom_err.a ${SRCDIR}lib/afs/util.a \
-     ${SRCDIR}lib/afs/libsys.a \
-     ${SRCDIR}lib/afs/libprocmgmt.a
+LIBS=${TOP_LIBDIR}/librx.a \
+       ${TOP_LIBDIR}/liblwp.a \
+       ${TOP_LIBDIR}/libcmd.a \
+       ${TOP_LIBDIR}/libkauth.a \
+       ${TOP_LIBDIR}/libvolser.a \
+       ${TOP_LIBDIR}/libvldb.a \
+       ${TOP_LIBDIR}/libauth.a \
+       ${TOP_LIBDIR}/librxstat.a \
+       ${TOP_LIBDIR}/librxkad.a \
+       ${TOP_LIBDIR}/libdes.a \
+       ${TOP_LIBDIR}/librx.a \
+       ${TOP_LIBDIR}/libubik.a \
+       ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/util.a \
+       ${TOP_LIBDIR}/libsys.a \
+       ${TOP_LIBDIR}/libprocmgmt.a
 
 OBJS=bosserver.o bnode.o ezbnodeops.o fsbnodeops.o bosint.ss.o bosint.xdr.o \
 bosoprocs.o cronbnodeops.o
 
-LIBOBJS=bosint.xdr.o bosint.cs.o boserr.o
+all: bosserver ${TOP_INCDIR}/afs/bosint.h bos ${TOP_LIBDIR}/libbos.a ${TOP_INCDIR}/afs/bnode.h
 
-include ../config/Makefile.version
-
-noversion: install
-
-all: bosserver bos libbos.a
-
-$(OBJS) $(LIBOBJS): $(INCLS)
+$(OBJS) bosint.xdr.o bosint.cs.o boserr.o: $(INCLS)
 
 bosint.ss.o: bosint.ss.c ${RPCINCLS}
 bosint.xdr.o: bosint.xdr.c ${RPCINCLS}
 bosint.cs.o: bosint.cs.c ${RPCINCLS}
 
-bosint.xdr.c bosint.ss.c bosint.cs.c bosint.h: bosint.xg
-       ${SRCDIR}bin/rxgen -x bosint.xg
+bosint.cs.c: bosint.xg
+       ${RXGEN} -x -C -o $@ ${srcdir}/bosint.xg
+
+bosint.ss.c: bosint.xg
+       ${RXGEN} -x -S -o $@ ${srcdir}/bosint.xg
+
+bosint.xdr.c: bosint.xg
+       ${RXGEN} -x -c -o $@ ${srcdir}/bosint.xg
+
+bosint.h: bosint.xg
+       ${RXGEN} -x -h -o $@ ${srcdir}/bosint.xg
+
+bosint.cs.c: bosint.h
+bosint.ss.c: bosint.h
+bosint.xdr.c: bosint.h
 
 bnode.h boserr.c: bnode.p.h boserr.et
-       rm -f boserr.c bnode.h; $(COMPILE_ET) boserr -h bnode
+       $(RM) -f boserr.c bnode.h
+       ${COMPILE_ET} -p ${srcdir} boserr -h bnode
 
 bosserver.o: bosserver.c ${INCLS} AFS_component_version_number.o
 
@@ -78,27 +108,86 @@ ezbnodeops.o: ezbnodeops.c ${INCLS}
 
 fsbnodeops.o: fsbnodeops.c ${INCLS}
 
-libbos.a: $(LIBOBJS) AFS_component_version_number.o
-       -rm -f libbos.a
-       ${AR} r libbos.a ${LIBOBJS} AFS_component_version_number.o
-       $(RANLIB) libbos.a
+libbos.a: bosint.xdr.o bosint.cs.o boserr.o AFS_component_version_number.o
+       -$(RM) -f $@
+       $(AR) crv $@ bosint.xdr.o bosint.cs.o boserr.o AFS_component_version_number.o
+       $(RANLIB) $@
 
 bosserver: $(OBJS) $(LIBS)
-       ${CC} $(CFLAGS) -o bosserver $(OBJS) ${auditlib} $(LIBS)  ${XLIBS} 
+       ${CC} $(CFLAGS) -o bosserver $(OBJS) ${TOP_LIBDIR}/libaudit.a $(LIBS)  ${XLIBS} 
+
+#
+# Install targets
+#
+install: \
+       ${DESTDIR}${afssrvsbindir}/bosserver \
+       ${DESTDIR}${includedir}/afs/bosint.h \
+       ${DESTDIR}${bindir}/bos \
+       ${DESTDIR}${afssrvbindir}/bos \
+       ${DESTDIR}${libdir}/afs/libbos.a \
+       ${DESTDIR}${includedir}/afs/bnode.h
+
+${DEST}/root.server/usr/afs/bin/bosserver: bosserver
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/bosint.h: bosint.h
+       ${INSTALL} $? $@
+
+${DEST}/bin/bos: bos
+       ${INSTALL} $? $@
+
+${DEST}/root.server/usr/afs/bin/bos: bos
+       ${INSTALL} $? $@
 
-system: install
+${DEST}/lib/afs/libbos.a: libbos.a
+       ${INSTALL} $? $@
 
-install: all
-       ${INSTALL} bosserver ${DESTDIR}root.server/usr/afs/bin
-       ${INSTALL} bosint.h ${DESTDIR}include/afs/bosint.h
-       ${INSTALL} bos ${DESTDIR}bin
-       ${INSTALL} bos ${DESTDIR}root.server/usr/afs/bin
-       ${INSTALL} libbos.a ${DESTDIR}lib/afs/libbos.a
-       ${INSTALL} bnode.h ${DESTDIR}include/afs/bnode.h
+${DEST}/include/afs/bnode.h: bnode.h
+       ${INSTALL} $? $@
 
+#
+# Misc. targets
+#
 clean:
-       rm -f  *.a *.o bos bosserver testproc bosint.cs.c bosint.ss.c bosint.xdr.c bosint.h core boserr.c bnode.h\
-       AFS_component_version_number.c
+       $(RM) -f  *.a *.o bos bosserver testproc bosint.cs.c bosint.ss.c bosint.xdr.c \
+               bosint.h core boserr.c bnode.h AFS_component_version_number.c
 
 test: 
        cd test; $(MAKE) 
+
+include ../config/Makefile.version
+${DESTDIR}${afssrvsbindir}/bosserver: bosserver
+       ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/bosint.h: bosint.h
+       ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/bosint.h: bosint.h
+       ${INSTALL} $? $@
+
+${DESTDIR}${bindir}/bos: bos
+       ${INSTALL} $? $@
+
+${DESTDIR}${afssrvbindir}/bos: bos
+       ${INSTALL} $? $@
+
+${DESTDIR}${libdir}/afs/libbos.a: libbos.a
+       ${INSTALL} $? $@
+
+${TOP_LIBDIR}/libbos.a: libbos.a
+       ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/bnode.h: bnode.h
+       ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/bnode.h: bnode.h
+       ${INSTALL} $? $@
+
+dest: \
+       ${DEST}/root.server/usr/afs/bin/bosserver \
+       ${DEST}/include/afs/bosint.h \
+       ${DEST}/bin/bos \
+       ${DEST}/root.server/usr/afs/bin/bos \
+       ${DEST}/lib/afs/libbos.a \
+       ${DEST}/include/afs/bnode.h
+