# 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@
-TOP_SRCDIR=@TOP_SRCDIR@
-SYS_NAME=@AFS_SYSNAME@
+srcdir=@srcdir@
+include @TOP_OBJDIR@/src/config/Makefile.config
+HELPER_SPLINT=@HELPER_SPLINT@
-SHELL=/bin/sh
-include ../config/Makefile.${SYS_NAME}
+VINCLS=${TOP_INCDIR}/afs/partition.h ${TOP_INCDIR}/afs/volume.h \
+ ${TOP_INCDIR}/afs/vlserver.h vol.h dump.h volser.h lockdata.h
-COMPILE_ET=${SRCDIR}bin/compile_et
-CFLAGS=${DBG} ${OPTMZ} -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
-LDFLAGS=${DBG} ${OPTMZ} ${XLDFLAGS}
-
-INCDIRS= -I${TOP_SRCDIR}/config -I${SRCDIR}include/afs -I${SRCDIR}include
-INCLIBS=-L${SRCDIR}lib/afs -L${SRCDIR}lib
-
-VINCLS=${SRCDIR}include/afs/partition.h ${SRCDIR}include/afs/volume.h \
- ${SRCDIR}include/afs/vlserver.h vol.h dump.h volser.h lockdata.h
-
-RINCLS=${SRCDIR}include/rx/rx.h ${SRCDIR}include/rx/xdr.h \
- ${SRCDIR}include/afs/keys.h ${SRCDIR}include/afs/cellconfig.h \
- ${SRCDIR}include/ubik.h ${SRCDIR}include/afs/cmd.h
-
-TARGETS= ${DESTDIR}include/afs/volser.h \
- ${DESTDIR}include/afs/volint.h \
- ${DESTDIR}etc/vos \
- ${DESTDIR}root.server/usr/afs/bin/vos \
- ${DESTDIR}root.server/usr/afs/bin/volserver \
- ${DESTDIR}lib/afs/libvolser.a
+RINCLS=${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
+ ${TOP_INCDIR}/afs/keys.h ${TOP_INCDIR}/afs/cellconfig.h \
+ ${TOP_INCDIR}/ubik.h ${TOP_INCDIR}/afs/cmd.h
INTINCLS=volint.h volser.h
-HACKS=${SRCDIR}lib/afs/libdir.a
-
-LIBS= \
- ${SRCDIR}lib/afs/libaudit.a \
- ${SRCDIR}lib/afs/vlib.a \
- ${SRCDIR}/lib/afs/libacl.a \
- ${SRCDIR}lib/afs/libsys.a \
- ${SRCDIR}lib/afs/libvldb.a \
- ${SRCDIR}lib/libubik.a \
- ${SRCDIR}lib/afs/libauth.a \
- ${SRCDIR}lib/afs/libcmd.a \
- ${SRCDIR}lib/librxkad.a \
- ${SRCDIR}lib/libdes.a \
- ${SRCDIR}lib/librxstat.a \
- ${SRCDIR}lib/librx.a \
- ${SRCDIR}lib/liblwp.a \
- ${SRCDIR}lib/afs/libsys.a \
- ${SRCDIR}lib/afs/libcom_err.a \
- ${SRCDIR}lib/afs/libkauth.a \
- ${SRCDIR}lib/afs/libusd.a \
- ${SRCDIR}lib/afs/util.a
+LIBS=\
+ ${TOP_LIBDIR}/libaudit.a \
+ ${TOP_LIBDIR}/vlib.a \
+ ${TOP_LIBDIR}/libacl.a \
+ ${TOP_LIBDIR}/libsys.a \
+ ${TOP_LIBDIR}/libvldb.a \
+ ${TOP_LIBDIR}/libubik.a \
+ ${TOP_LIBDIR}/libauth.a \
+ ${TOP_LIBDIR}/libcmd.a \
+ ${TOP_LIBDIR}/librxkad.a \
+ ${TOP_LIBDIR}/libdes.a \
+ ${TOP_LIBDIR}/librxstat.a \
+ ${TOP_LIBDIR}/librx.a \
+ ${TOP_LIBDIR}/liblwp.a \
+ ${TOP_LIBDIR}/libsys.a \
+ ${TOP_LIBDIR}/libcom_err.a \
+ ${TOP_LIBDIR}/libkauth.a \
+ ${TOP_LIBDIR}/libusd.a \
+ ${TOP_LIBDIR}/util.a
+
+VOLDUMP_LIBS = \
+ ../vol/ihandle.o \
+ ../vol/physio.o \
+ ../vol/vlib.a \
+ ${TOP_LIBDIR}/libcmd.a \
+ ${TOP_LIBDIR}/util.a \
+ ${TOP_LIBDIR}/libsys.a \
+ ${TOP_LIBDIR}/libdir.a \
+ ${TOP_LIBDIR}/liblwp.a \
+ ${TOP_LIBDIR}/libacl.a
VSOBJS=vsprocs.o vsutils.o lockprocs.o volint.xdr.o volerr.o
SOBJS=volmain.o volprocs.o physio.o common.o voltrans.o volerr.o \
- volint.cs.o dumpstuff.o volint.ss.o volint.xdr.o
-COBJS=volint.cs.o volint.xdr.o
-
-include ../config/Makefile.version
+ volint.cs.o dumpstuff.o volint.ss.o volint.xdr.o vol_split.o
-all: volserver libvolser.a vos restorevol
+all: volserver vos restorevol voldump \
+ ${TOP_INCDIR}/afs/volser.h \
+ ${TOP_INCDIR}/afs/vsutils_prototypes.h \
+ ${TOP_INCDIR}/afs/volint.h \
+ ${TOP_LIBDIR}/libvolser.a
restorevol: restorevol.c
- ${CC} -g ${CFLAGS} -o restorevol restorevol.c \
- ${SRCDIR}lib/afs/libcmd.a ${SRCDIR}lib/afs/util.a
- ${INSTALL} restorevol ${SRCDIR}etc
+ ${CC} ${CFLAGS} -o restorevol ${srcdir}/restorevol.c \
+ ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS}
vos: vos.o ${VSOBJS} libvolser.a ${LIBS}
- ${CC} ${LDFLAGS} -g -o vos vos.o $(VSOBJS) libvolser.a ${LIBS} \
- ${XLIBS}
+ ${CC} ${LDFLAGS} -o vos vos.o $(VSOBJS) libvolser.a ${LIBS} ${XLIBS}
+
+volserver: $(SOBJS) $(LIBS) ${TOP_LIBDIR}/libdir.a
+ ${CC} ${DBUG} -o volserver $(SOBJS) ${TOP_LIBDIR}/libdir.a \
+ ${LDFLAGS} $(LIBS) ${XLIBS}
+
+voldump: vol-dump.o ${VOLDUMP_LIBS}
+ ${CC} ${CFLAGS} -o voldump vol-dump.o ${VOLDUMP_LIBS} ${XLIBS}
libvolser.a: volint.cs.o $(VSOBJS) volint.ss.o AFS_component_version_number.o
- -rm -f libvolser.a
- ar rv libvolser.a volint.cs.o $(VSOBJS) volint.ss.o \
- AFS_component_version_number.o
- $(RANLIB) libvolser.a
+ -$(RM) -f $@
+ $(AR) crv $@ volint.cs.o $(VSOBJS) volint.ss.o AFS_component_version_number.o
+ $(RANLIB) $@
volser.h volerr.c: volerr.et volser.p.h
- rm -f volser.h volerr.c; ${COMPILE_ET} volerr -h volser
+ $(RM) -f volser.h volerr.c
+ ${COMPILE_ET} -p ${srcdir} volerr -h volser
-volint.h volint.ss.c volint.cs.c volint.xdr.c: volint.xg
- ${SRCDIR}bin/rxgen -x volint.xg
+volint.cs.c: volint.xg
+ ${RXGEN} -A -x -C -o $@ ${srcdir}/volint.xg
-vsutils.o: vsutils.c ${VINCLS} ${RINCLS} ${INTINCLS}
+volint.ss.c: volint.xg
+ ${RXGEN} -A -x -S -o $@ ${srcdir}/volint.xg
+
+volint.xdr.c: volint.xg
+ ${RXGEN} -A -x -c -o $@ ${srcdir}/volint.xg
+
+volint.h: volint.xg
+ ${RXGEN} -A -x -h -o $@ ${srcdir}/volint.xg
+
+volint.cs.c: volint.h
+volint.ss.c: volint.h
+volint.xdr.c: volint.h
+#
+# Dependencies
+#
+volint.cs.o: volint.cs.c ${INTINCLS}
+volint.ss.o: volint.ss.c ${INTINCLS}
+volint.xdr.o: volint.xdr.c ${INTINCLS}
+vsutils.o: vsutils.c ${VINCLS} ${RINCLS} ${INTINCLS}
volmain.o: volmain.c ${VINCLS} ${RINCLS} AFS_component_version_number.c
volprocs.o: volprocs.c ${VINCLS} ${RINCLS} ${INTINCLS}
dumpstuff.o: dumpstuff.c ${VINCLS} ${RINCLS} ${INTINCLS}
physio.o: physio.c ${VINCLS}
common.o: common.c ${VINCLS}
lockprocs.o: lockprocs.c ${VINCLS} ${INTINCLS} ${RINCLS}
+vol_split.o: vol_split.c ${VINCLS} ${INTINCLS} ${RINCLS}
+
+#
+# Installation targets
+#
+install: \
+ ${DESTDIR}${sbindir}/restorevol \
+ ${DESTDIR}${sbindir}/voldump \
+ ${DESTDIR}${includedir}/afs/volser.h \
+ ${DESTDIR}${includedir}/afs/volint.h \
+ ${DESTDIR}${sbindir}/vos \
+ ${DESTDIR}${afssrvsbindir}/vos \
+ ${DESTDIR}${afssrvlibexecdir}/volserver \
+ ${DESTDIR}${libdir}/afs/libvolser.a
+
+
+${DEST}/include/afs/volser.h: volser.h
+ ${INSTALL} $? $@
-volint.cs.o: volint.cs.c ${INTINCLS}
-volint.ss.o: volint.ss.c ${INTINCLS}
-volint.xdr.o: volint.xdr.c ${INTINCLS}
+${DEST}/include/afs/vsutils_prototypes.h: vsutils_prototypes.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/volint.h: volint.h
+ ${INSTALL} $? $@
+
+${DEST}/etc/restorevol: restorevol
+ ${INSTALL} $? $@
+
+${DEST}/etc/voldump: voldump
+ ${INSTALL} $? $@
+
+${DEST}/etc/vos ${DEST}/root.server/usr/afs/bin/vos: vos
+ ${INSTALL} $? $@
+
+${DEST}/lib/afs/libvolser.a: libvolser.a
+ ${INSTALL} $? $@
-volserver: $(SOBJS) $(LIBS) $(HACKS)
- case ${SYS_NAME} in \
- *linux* | *fbsd* ) \
- ${CC} ${DBUG} -o volserver $(SOBJS) $(HACKS) \
- ${LDFLAGS} $(LIBS) ${XLIBS} ;; \
- *) \
- ${CC} ${DBUG} -g -o volserver $(SOBJS) $(HACKS) \
- ${LDFLAGS} $(LIBS) ${XLIBS} ;; \
- esac
+${DEST}/root.server/usr/afs/bin/volserver: volserver
+ @case ${SYS_NAME} in \
+ alpha_dux4*|*linux*|rs_aix*|sgi_6*|sun4x*|sunx86*) \
+ echo "Don't install volserver for ${SYS_NAME}" ;; \
+ *_darwin_[1-6][0-9]) \
+ echo ${INSTALL} -ns $? $@ ; \
+ ${INSTALL} -ns $? $@ ;; \
+ *_darwin_*) \
+ echo "Don't install volserver for ${SYS_NAME}" ;; \
+ *) \
+ echo ${INSTALL} -ns $? $@ ; \
+ ${INSTALL} -ns $? $@ ;; \
+ esac
+
+#
+# Misc targets
+#
+clean:
+ $(RM) -f *.o *.a core volserver volint.ss.c volint.cs.c volint.h \
+ volint.xdr.c vos volser.h volerr.c AFS_component_version_number.c restorevol voldump
-noversion system: install
+include ../config/Makefile.version
-${DESTDIR}include/afs/volser.h :: volser.h
+${DESTDIR}${sbindir}/restorevol: restorevol
${INSTALL} $? $@
-${DESTDIR}include/afs/volint.h :: volint.h
+${DESTDIR}${sbindir}/voldump: voldump
${INSTALL} $? $@
-${DESTDIR}etc/vos ${DESTDIR}root.server/usr/afs/bin/vos :: vos
+${DESTDIR}${includedir}/afs/volser.h: volser.h
${INSTALL} $? $@
-${DESTDIR}lib/afs/libvolser.a :: libvolser.a
+${TOP_INCDIR}/afs/volser.h: volser.h
${INSTALL} $? $@
-${DESTDIR}root.server/usr/afs/bin/volserver :: volserver
+${DESTDIR}${includedir}/afs/vsutils_prototypes.h: vsutils_prototypes.h
${INSTALL} $? $@
-install: all $(TARGETS)
+${TOP_INCDIR}/afs/vsutils_prototypes.h: vsutils_prototypes.h
+ ${INSTALL} $? $@
-clean:
- rm -f volserver *.o volint.ss.c volint.cs.c *.a volint.h \
- volint.xdr.c vos core volser.h volerr.c AFS_component_version_number.c restorevol
-
-lint: vos.c vsprocs.c volmain.c volprocs.c lockprocs.c
- lint -hb ${INCDIRS} ${INCLIBS} vos.c
- lint -hb ${INCDIRS} ${INCLIBS} vsprocs.c
- lint -hb ${INCDIRS} ${INCLIBS} volmain.c
- lint -hb ${INCDIRS} ${INCLIBS} volprocs.c
- lint -hb ${INCDIRS} ${INCLIBS} lockprocs.c
+${DESTDIR}${includedir}/afs/volint.h: volint.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/volint.h: volint.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${sbindir}/vos: vos
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvsbindir}/vos: vos
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvlibexecdir}/volserver: volserver
+ @case ${SYS_NAME} in \
+ alpha_dux4*|*linux*|rs_aix*|sgi_6*|sun4x*|sunx86*) \
+ echo "Don't install volserver for ${SYS_NAME}" ;; \
+ *_darwin_[1-6][0-9]) \
+ echo ${INSTALL} -ns $? $@ ; \
+ ${INSTALL} -ns $? $@ ;; \
+ *_darwin_*) \
+ echo "Don't install volserver for ${SYS_NAME}" ;; \
+ *) \
+ echo ${INSTALL} -ns $? $@ ; \
+ ${INSTALL} -ns $? $@ ;; \
+ esac
+
+${DESTDIR}${libdir}/afs/libvolser.a: libvolser.a
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/libvolser.a: libvolser.a
+ ${INSTALL} $? $@
+
+dest: \
+ ${DEST}/etc/restorevol \
+ ${DEST}/etc/voldump \
+ ${DEST}/include/afs/volser.h \
+ ${DEST}/include/afs/vsutils_prototypes.h \
+ ${DEST}/include/afs/volint.h \
+ ${DEST}/etc/vos \
+ ${DEST}/root.server/usr/afs/bin/vos \
+ ${DEST}/root.server/usr/afs/bin/volserver \
+ ${DEST}/lib/afs/libvolser.a
+
+
+check-splint::
+ sh $(HELPER_SPLINT) $(CFLAGS) \
+ vos.c restorevol.c \
+ vsprocs.c vsutils.c lockprocs.c volerr.c \
+ volmain.c volprocs.c physio.c common.c voltrans.c \
+ dumpstuff.c vol_split.c