Eliminate some multiple targets in Makefile rules
[openafs.git] / src / volser / Makefile.in
index 8d59b7f..f9e0fcd 100644 (file)
@@ -5,38 +5,14 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-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@
-TOP_SRCDIR=@TOP_SRCDIR@
-SYS_NAME=@AFS_SYSNAME@
-
-SHELL=/bin/sh
-
-include ../config/Makefile.${SYS_NAME}
-
-COMPILE_ET=${TOP_OBJDIR}/src/comerr/compile_et
-RXGEN=${TOP_OBJDIR}/src/rxgen/rxgen
-
-CFLAGS=-I. -I${srcdir} ${DBG} ${OPTMZ} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS}
-LDFLAGS=${DBG} ${OPTMZ} ${XLDFLAGS}
-
-INCDIRS=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}/afs -I${TOP_INCDIR}
-INCLIBS=-L${SRCDIR}/lib/afs -L${TOP_LIBDIR}
+include @TOP_OBJDIR@/src/config/Makefile.config
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+HELPER_SPLINT=@HELPER_SPLINT@
+
 
 VINCLS=${TOP_INCDIR}/afs/partition.h ${TOP_INCDIR}/afs/volume.h \
        ${TOP_INCDIR}/afs/vlserver.h vol.h dump.h volser.h  lockdata.h
@@ -67,18 +43,42 @@ LIBS=\
        ${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
+ volint.cs.o dumpstuff.o volint.ss.o volint.xdr.o vol_split.o
 
-all: volserver 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
 
+${TOP_INCDIR}/afs/vsutils_prototypes.h: vsutils_prototypes.h
+       ${INSTALL_DATA} $? $@
+
+${TOP_INCDIR}/afs/volser.h: volser.h
+       ${INSTALL_DATA} $? $@
+
+${TOP_INCDIR}/afs/volint.h: volint.h
+       ${INSTALL_DATA} $? $@
+
+${TOP_LIBDIR}/libvolser.a: libvolser.a
+       ${INSTALL_DATA} $? $@
+
 restorevol: restorevol.c
        ${CC} ${CFLAGS} -o restorevol ${srcdir}/restorevol.c \
-               ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a
+               ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS}
 
 vos: vos.o ${VSOBJS} libvolser.a ${LIBS}
        ${CC} ${LDFLAGS} -o vos vos.o $(VSOBJS) libvolser.a ${LIBS} ${XLIBS}
@@ -87,26 +87,31 @@ 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 $@
        $(AR) crv $@ volint.cs.o $(VSOBJS) volint.ss.o AFS_component_version_number.o 
        $(RANLIB) $@
 
-volser.h volerr.c: volerr.et volser.p.h
+volser.h: volerr.c
+
+volerr.c: volerr.et volser.p.h
        $(RM) -f volser.h volerr.c
        ${COMPILE_ET} -p ${srcdir} volerr -h volser
 
 volint.cs.c: volint.xg
-       ${RXGEN} -x -C -o $@ ${srcdir}/volint.xg
+       ${RXGEN} -A -x -C -o $@ ${srcdir}/volint.xg
 
 volint.ss.c: volint.xg
-       ${RXGEN} -x -S -o $@ ${srcdir}/volint.xg
+       ${RXGEN} -A -x -S -o $@ ${srcdir}/volint.xg
 
 volint.xdr.c: volint.xg
-       ${RXGEN} -x -c -o $@ ${srcdir}/volint.xg
+       ${RXGEN} -A -x -c -o $@ ${srcdir}/volint.xg
 
 volint.h: volint.xg
-       ${RXGEN} -x -h -o $@ ${srcdir}/volint.xg
+       ${RXGEN} -A -x -h -o $@ ${srcdir}/volint.xg
 
 volint.cs.c: volint.h
 volint.ss.c: volint.h
@@ -119,7 +124,7 @@ 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
+volmain.o: volmain.c ${VINCLS} ${RINCLS} ${INTINCLS} AFS_component_version_number.c
 volprocs.o: volprocs.c ${VINCLS} ${RINCLS} ${INTINCLS}
 dumpstuff.o: dumpstuff.c ${VINCLS} ${RINCLS} ${INTINCLS}
 voldump.o: voldump.c ${VINCLS} ${RINCLS}
@@ -128,83 +133,84 @@ vsprocs.o: vsprocs.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}${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} $? $@
-
-${DEST}/include/afs/volint.h: volint.h
-       ${INSTALL} $? $@
-
-${DEST}/etc/restorevol: restorevol
-       ${INSTALL} $? $@
-
-${DEST}/etc/vos ${DEST}/root.server/usr/afs/bin/vos: vos
-       ${INSTALL} $? $@
-
-${DEST}/lib/afs/libvolser.a: libvolser.a
-       ${INSTALL} $? $@
-
-${DEST}/root.server/usr/afs/bin/volserver: volserver
-       ${INSTALL} $? $@
+install: restorevol voldump volser.h volint.h vos volserver libvolser.a
+       ${INSTALL} -d ${DESTDIR}${sbindir}
+       ${INSTALL} -d ${DESTDIR}${afssrvsbindir}
+       ${INSTALL} -d ${DESTDIR}${includedir}/afs
+       ${INSTALL} -d ${DESTDIR}${libdir}/afs
+       ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
+       ${INSTALL_PROGRAM} restorevol ${DESTDIR}${sbindir}/restorevol
+       ${INSTALL_PROGRAM} voldump ${DESTDIR}${sbindir}/voldump
+       ${INSTALL_DATA} volser.h ${DESTDIR}${includedir}/afs/volser.h
+       ${INSTALL_DATA} volint.h ${DESTDIR}${includedir}/afs/volint.h
+       ${INSTALL_DATA} vsutils_prototypes.h ${DESTDIR}${includedir}/afs/vsutils_prototypes.h
+       ${INSTALL_PROGRAM} vos ${DESTDIR}${sbindir}/vos
+       ${INSTALL_PROGRAM} vos ${DESTDIR}${afssrvsbindir}/vos
+       ${INSTALL_DATA} libvolser.a ${DESTDIR}${libdir}/afs/libvolser.a
+       @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} volserver \
+                       ${DESTDIR}${afssrvlibexecdir}/volserver ; \
+               ${INSTALL} volserver \
+                       ${DESTDIR}${afssrvlibexecdir}/volserver ;; \
+       *_darwin_*) \
+               echo "Don't install volserver for ${SYS_NAME}" ;; \
+       *) \
+               echo ${INSTALL_PRORAM} volserver \
+                       ${DESTDIR}${afssrvlibexecdir}/volserver ; \
+               ${INSTALL} volserver \
+                       ${DESTDIR}${afssrvlibexecdir}/volserver ;; \
+       esac
+
+dest: restorevol voldump volser.h volint.h vos volserver libvolser.a
+       ${INSTALL} -d ${DEST}/etc
+       ${INSTALL} -d ${DEST}/include/afs
+       ${INSTALL} -d ${DEST}/lib/afs
+       ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
+       ${INSTALL_PROGRAM} restorevol ${DEST}/etc/restorevol
+       ${INSTALL_PROGRAM} voldump ${DEST}/etc/voldump
+       ${INSTALL_DATA} volser.h ${DEST}/include/afs/volser.h
+       ${INSTALL_DATA} volint.h ${DEST}/include/afs/volint.h
+       ${INSTALL_DATA} vsutils_prototypes.h ${DEST}/include/afs/vsutils_prototypes.h
+       ${INSTALL_PROGRAM} vos ${DEST}/etc/vos
+       ${INSTALL_PROGRAM} vos ${DEST}/root.server/usr/afs/bin/vos
+       ${INSTALL_DATA} libvolser.a ${DEST}/lib/afs/libvolser.a
+       @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} volserver \
+                       ${DEST}/root.server/usr/afs/bin/volserver ; \
+               ${INSTALL} -ns volserver \
+                       ${DEST}/root.server/usr/afs/bin/volserver ;; \
+       *_darwin_*) \
+               echo "Don't install volserver for ${SYS_NAME}" ;; \
+       *) \
+               echo ${INSTALL} volserver \
+                       ${DEST}/root.server/usr/afs/bin/volserver ; \
+               ${INSTALL} volserver \
+                       ${DEST}/root.server/usr/afs/bin/volserver ;; \
+       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
-
-include ../config/Makefile.version
-
-${DESTDIR}${sbindir}/restorevol: restorevol
-       ${INSTALL} $? $@
-
-${DESTDIR}${includedir}/afs/volser.h: volser.h
-       ${INSTALL} $? $@
-
-${TOP_INCDIR}/afs/volser.h: volser.h
-       ${INSTALL} $? $@
-
-${DESTDIR}${includedir}/afs/volint.h: volint.h
-       ${INSTALL} $? $@
+       volint.xdr.c vos volser.h volerr.c AFS_component_version_number.c restorevol voldump
 
-${TOP_INCDIR}/afs/volint.h: volint.h
-       ${INSTALL} $? $@
-
-${DESTDIR}${sbindir}/vos: vos
-       ${INSTALL} $? $@
-
-${DESTDIR}${afssrvsbindir}/vos: vos
-       ${INSTALL} $? $@
-
-${DESTDIR}${afssrvlibexecdir}/volserver: volserver
-       ${INSTALL} $? $@
-
-${DESTDIR}${libdir}/afs/libvolser.a: libvolser.a
-       ${INSTALL} $? $@
-
-${TOP_LIBDIR}/libvolser.a: libvolser.a
-       ${INSTALL} $? $@
-
-dest: \
-       ${DEST}/etc/restorevol \
-       ${DEST}/include/afs/volser.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
 
+include ../config/Makefile.version