diff --git a/Makefile.in b/Makefile.in index 01891e142a..f9a7f9bcb6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -401,6 +401,9 @@ authtools: pam tsm41 sgistuff aklog platform: config cmd vol +${COMPILE_PART1} platform ${COMPILE_PART2} +tools: config audit volser vlserver + +${COMPILE_PART1} tools ${COMPILE_PART2} + man-pages: config +if test -d "doc/man-pages" ; then \ cd doc/man-pages ${COMPILE_PART2} ; \ @@ -650,7 +653,7 @@ finale: project cmd comerr afsd butc tbutc tbudb @ENABLE_KERNEL_MODULE@ libuafs dviced dvolser libafscp\ venus update xstat afsmonitor rxdebug libafsrpc rfc3961 hcrypto \ libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \ - platform kopenafs authtools $(DIR_roken) + tools platform kopenafs authtools $(DIR_roken) +${COMPILE_PART1} finale ${COMPILE_PART2} finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth log \ @@ -658,7 +661,7 @@ finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth lo dviced dvolser libafscp\ venus update xstat afsmonitor rxdebug libafsrpc rfc3961 hcrypto \ libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \ - platform kopenafs authtools $(DIR_roken) + tools platform kopenafs authtools $(DIR_roken) +${COMPILE_PART1} finale ${COMPILE_PART2} check test: finale @@ -749,13 +752,13 @@ clean2: -${COMPILE_PART1} bucoord ${COMPILE_CLEAN} -${COMPILE_PART1} xstat ${COMPILE_CLEAN} -${COMPILE_PART1} afsmonitor ${COMPILE_CLEAN} - -${COMPILE_PART1} tests ${COMPILE_CLEAN} -${COMPILE_PART1} rxdebug ${COMPILE_CLEAN} -${COMPILE_PART1} libafsrpc ${COMPILE_CLEAN} -${COMPILE_PART1} libafsauthent ${COMPILE_CLEAN} -${COMPILE_PART1} shlibafsrpc ${COMPILE_CLEAN} -${COMPILE_PART1} shlibafsauthent ${COMPILE_CLEAN} -${COMPILE_PART1} kopenafs ${COMPILE_CLEAN} + -${COMPILE_PART1} tools ${COMPILE_CLEAN} -${COMPILE_PART1} platform ${COMPILE_CLEAN} -${COMPILE_PART1} libadmin ${COMPILE_CLEAN} -${COMPILE_PART1} libadmin/adminutil ${COMPILE_CLEAN} @@ -904,6 +907,7 @@ distclean: clean src/tests/Makefile \ src/tests/run-tests \ src/tests/auth/Makefile \ + src/tools/Makefile \ src/tsalvaged/Makefile \ src/tsm41/Makefile \ src/tvolser/Makefile \ diff --git a/configure.ac b/configure.ac index 41789541e6..af9b181872 100644 --- a/configure.ac +++ b/configure.ac @@ -227,6 +227,7 @@ src/sys/Makefile \ src/tbutc/Makefile \ src/tests/Makefile \ src/tests/run-tests \ +src/tools/Makefile \ src/tsalvaged/Makefile \ src/tsm41/Makefile \ src/tvolser/Makefile \ diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index b0150a934f..c9a82f5342 100644 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -2,97 +2,11 @@ srcdir = @srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config include @TOP_OBJDIR@/src/config/Makefile.lwp - SHELL = /bin/sh -INCDIRS=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}/afs -I${TOP_INCDIR} -INCLIBS=-L${SRCDIR}/lib/afs -L${TOP_LIBDIR} - -LIBS=\ - libdumpscan.a \ - libxfiles.a \ - ${TOP_LIBDIR}/libauth.a \ - ${TOP_LIBDIR}/libaudit.a \ - ${TOP_LIBDIR}/libvolser.a \ - ${TOP_LIBDIR}/libvldb.a \ - ${TOP_LIBDIR}/libubik.a \ - ${TOP_LIBDIR}/librxkad.a \ - ${TOP_LIBDIR}/libsys.a \ - ${TOP_LIBDIR}/librx.a \ - ${TOP_LIBDIR}/liblwp.a \ - ${TOP_LIBDIR}/util.a \ - ${TOP_LIBDIR}/libafscom_err.a \ - $(LIB_roken) \ - ${XLIBS} - -OBJS_afsdump_scan = afsdump_scan.o repair.o -OBJS_afsdump_xsed = afsdump_xsed.o repair.o -OBJS_libxfiles.a = xfiles.o xf_errs.o xf_printf.o int64.o \ - xf_files.o xf_rxcall.o xf_profile.o -OBJS_libdumpscan.a = primitive.o util.o dumpscan_errs.o parsetag.o \ - parsedump.o parsevol.o parsevnode.o dump.o \ - directory.o pathname.o backuphdr.o stagehdr.o - -TARGETS = libxfiles.a libdumpscan.a \ - afsdump_scan afsdump_dirlist afsdump_extract dumptool - -all: run-tests OpenAFS/Dirpath.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\ - afsdump_scan afsdump_dirlist afsdump_extract dumptool OpenAFS/Dirpath.sh +all: run-tests OpenAFS/Dirpath.pm $(TEST_PROGRAMS) OpenAFS/Dirpath.sh @chmod +x run-tests -generated: xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h - -afsdump_scan: libxfiles.a libdumpscan.a $(OBJS_afsdump_scan) - $(AFS_LDRULE) $(OBJS_afsdump_scan) $(LIBS) - - -afsdump_xsed: libxfiles.a libdumpscan.a $(OBJS_afsdump_xsed) - $(AFS_LDRULE) $(OBJS_afsdump_xsed) $(LIBS) - -afsdump_dirlist: libxfiles.a libdumpscan.a afsdump_dirlist.o - $(AFS_LDRULE) afsdump_dirlist.o $(LIBS) - -afsdump_extract: libxfiles.a libdumpscan.a afsdump_extract.o - $(AFS_LDRULE) afsdump_extract.o $(LIBS) - -null-search: libxfiles.a libdumpscan.a null-search.c - $(AFS_LDRULE) null-search.c $(LIBS) - -dumptool: dumptool.c - $(AFS_LDRULE) dumptool.c - -libxfiles.a: $(OBJS_libxfiles.a) - -rm -f libxfiles.a - $(AR) r libxfiles.a $(OBJS_libxfiles.a) - $(RANLIB) libxfiles.a - -libdumpscan.a: $(OBJS_libdumpscan.a) - -rm -f libdumpscan.a - $(AR) r libdumpscan.a $(OBJS_libdumpscan.a) - $(RANLIB) libdumpscan.a - -xf_errs.c xf_errs.h: xf_errs.et - $(COMPILE_ET) xf_errs.et - -dumpscan_errs.c dumpscan_errs.h: dumpscan_errs.et - $(COMPILE_ET) dumpscan_errs.et - -util.o xfiles.o xf_files.o: xf_errs.h -backuphdr.o directory.o parsedump.o parsetag.o: dumpscan_errs.h -parsevnode.o parsevol.o pathname.o stagehdr.o: dumpscan_errs.h -util.o: dumpscan_errs.h - -# repair addresses the same storage as two different types of structs at the -# same time. -CFLAGS_repair.o = @CFLAGS_NOSTRICT@ -repair.o: repair.c dumpscan_errs.h - -${TOP_LIBDIR}/libxfiles.a: libxfiles.a - ${INSTALL_DATA} $? $@ - -${TOP_LIBDIR}/libdumpscan.a: libdumpscan.a - ${INSTALL_DATA} $? $@ - SYS_LIBS = ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a AUTH_LIBS = ${TOP_LIBDIR}/libauth.a ${SYS_LIBS} @@ -345,8 +259,8 @@ install: uninstall: clean: - -rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \ - $(TARGETS) run-tests $(TEST_PROGRAMS) OpenAFS/Dirpath.pm OpenAFS/Dirpath.sh + -rm -f *.o run-tests $(TEST_PROGRAMS) OpenAFS/Dirpath.pm \ + OpenAFS/Dirpath.sh include ../config/Makefile.version diff --git a/src/tools/Makefile.in b/src/tools/Makefile.in new file mode 100644 index 0000000000..3f3e620eeb --- /dev/null +++ b/src/tools/Makefile.in @@ -0,0 +1,107 @@ +srcdir = @srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config +include @TOP_OBJDIR@/src/config/Makefile.lwp + + +SHELL = /bin/sh + +INCDIRS=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}/afs -I${TOP_INCDIR} +INCLIBS=-L${SRCDIR}/lib/afs -L${TOP_LIBDIR} + +LIBS=\ + libdumpscan.a \ + libxfiles.a \ + ${TOP_LIBDIR}/libauth.a \ + ${TOP_LIBDIR}/libaudit.a \ + ${TOP_LIBDIR}/libvolser.a \ + ${TOP_LIBDIR}/libvldb.a \ + ${TOP_LIBDIR}/libubik.a \ + ${TOP_LIBDIR}/librxkad.a \ + ${TOP_LIBDIR}/libsys.a \ + ${TOP_LIBDIR}/librx.a \ + ${TOP_LIBDIR}/liblwp.a \ + ${TOP_LIBDIR}/util.a \ + $(TOP_LIBDIR)/libopr.a \ + ${TOP_LIBDIR}/libafscom_err.a \ + $(LIB_roken) \ + ${XLIBS} + +OBJS_afsdump_scan = afsdump_scan.o repair.o +OBJS_afsdump_xsed = afsdump_xsed.o repair.o +OBJS_libxfiles.a = xfiles.o xf_errs.o xf_printf.o int64.o \ + xf_files.o xf_rxcall.o xf_profile.o +OBJS_libdumpscan.a = primitive.o util.o dumpscan_errs.o parsetag.o \ + parsedump.o parsevol.o parsevnode.o dump.o \ + directory.o pathname.o backuphdr.o stagehdr.o + +TARGETS = libxfiles.a libdumpscan.a \ + afsdump_scan afsdump_dirlist afsdump_extract dumptool + +all: libxfiles.a libdumpscan.a \ + afsdump_scan afsdump_dirlist afsdump_extract dumptool + +generated: xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h + +afsdump_scan: libxfiles.a libdumpscan.a $(OBJS_afsdump_scan) + $(AFS_LDRULE) $(OBJS_afsdump_scan) $(LIBS) + +afsdump_xsed: libxfiles.a libdumpscan.a $(OBJS_afsdump_xsed) + $(AFS_LDRULE) $(OBJS_afsdump_xsed) $(LIBS) + +afsdump_dirlist: libxfiles.a libdumpscan.a afsdump_dirlist.o + $(AFS_LDRULE) afsdump_dirlist.o $(LIBS) + +afsdump_extract: libxfiles.a libdumpscan.a afsdump_extract.o + $(AFS_LDRULE) afsdump_extract.o $(LIBS) + +null-search: libxfiles.a libdumpscan.a null-search.c + $(AFS_LDRULE) null-search.c $(LIBS) + +dumptool: dumptool.c + $(AFS_LDRULE) dumptool.c + +libxfiles.a: $(OBJS_libxfiles.a) + -rm -f libxfiles.a + $(AR) r libxfiles.a $(OBJS_libxfiles.a) + $(RANLIB) libxfiles.a + +libdumpscan.a: $(OBJS_libdumpscan.a) + -rm -f libdumpscan.a + $(AR) r libdumpscan.a $(OBJS_libdumpscan.a) + $(RANLIB) libdumpscan.a + +xf_errs.c xf_errs.h: xf_errs.et + $(COMPILE_ET) xf_errs.et + +dumpscan_errs.c dumpscan_errs.h: dumpscan_errs.et + $(COMPILE_ET) dumpscan_errs.et + +util.o xfiles.o xf_files.o: xf_errs.h +backuphdr.o directory.o parsedump.o parsetag.o: dumpscan_errs.h +parsevnode.o parsevol.o pathname.o stagehdr.o: dumpscan_errs.h +util.o: dumpscan_errs.h + +# repair addresses the same storage as two different types of structs at the +# same time. +CFLAGS_repair.o = @CFLAGS_NOSTRICT@ +repair.o: repair.c dumpscan_errs.h + +${TOP_LIBDIR}/libxfiles.a: libxfiles.a + ${INSTALL_DATA} $? $@ + +${TOP_LIBDIR}/libdumpscan.a: libdumpscan.a + ${INSTALL_DATA} $? $@ + +dest: + +install: + +uninstall: + +clean: + -rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \ + $(TARGETS) + +include ../config/Makefile.version + +.PHONY: all install clean realclean distclean mostlyclean install uninstall diff --git a/src/tests/TEMPLATE b/src/tools/TEMPLATE similarity index 100% rename from src/tests/TEMPLATE rename to src/tools/TEMPLATE diff --git a/src/tests/afsdump_dirlist.c b/src/tools/afsdump_dirlist.c similarity index 100% rename from src/tests/afsdump_dirlist.c rename to src/tools/afsdump_dirlist.c diff --git a/src/tests/afsdump_extract.c b/src/tools/afsdump_extract.c similarity index 100% rename from src/tests/afsdump_extract.c rename to src/tools/afsdump_extract.c diff --git a/src/tests/afsdump_scan.c b/src/tools/afsdump_scan.c similarity index 100% rename from src/tests/afsdump_scan.c rename to src/tools/afsdump_scan.c diff --git a/src/tests/afsdump_xsed.c b/src/tools/afsdump_xsed.c similarity index 100% rename from src/tests/afsdump_xsed.c rename to src/tools/afsdump_xsed.c diff --git a/src/tests/backuphdr.c b/src/tools/backuphdr.c similarity index 100% rename from src/tests/backuphdr.c rename to src/tools/backuphdr.c diff --git a/src/tests/directory.c b/src/tools/directory.c similarity index 100% rename from src/tests/directory.c rename to src/tools/directory.c diff --git a/src/tests/dump.c b/src/tools/dump.c similarity index 100% rename from src/tests/dump.c rename to src/tools/dump.c diff --git a/src/tests/dumpfmt.h b/src/tools/dumpfmt.h similarity index 100% rename from src/tests/dumpfmt.h rename to src/tools/dumpfmt.h diff --git a/src/tests/dumpscan.h b/src/tools/dumpscan.h similarity index 100% rename from src/tests/dumpscan.h rename to src/tools/dumpscan.h diff --git a/src/tests/dumpscan_errs.et b/src/tools/dumpscan_errs.et similarity index 100% rename from src/tests/dumpscan_errs.et rename to src/tools/dumpscan_errs.et diff --git a/src/tests/dumptool.c b/src/tools/dumptool.c similarity index 99% rename from src/tests/dumptool.c rename to src/tools/dumptool.c index 79c48cff6b..d514cde319 100644 --- a/src/tests/dumptool.c +++ b/src/tools/dumptool.c @@ -287,6 +287,7 @@ int ShutdownInProgress = 0; * Our local function prototypes */ +static int DirHash(char *string); static int ReadDumpHeader(FILE *, struct DumpHeader *); static int ReadVolumeHeader(FILE *, VolumeDiskData *); static int ScanVnodes(FILE *, VolumeDiskData *, int); @@ -2426,7 +2427,7 @@ ReadByteString(FILE * f, void *s, int size) * The directory hashing algorithm used by AFS */ -int +static int DirHash(char *string) { /* Hash a string to a number between 0 and NHASHENT. */ diff --git a/src/tests/int64.c b/src/tools/int64.c similarity index 100% rename from src/tests/int64.c rename to src/tools/int64.c diff --git a/src/tests/intNN.h b/src/tools/intNN.h similarity index 100% rename from src/tests/intNN.h rename to src/tools/intNN.h diff --git a/src/tests/internal.h b/src/tools/internal.h similarity index 100% rename from src/tests/internal.h rename to src/tools/internal.h diff --git a/src/tests/parsedump.c b/src/tools/parsedump.c similarity index 100% rename from src/tests/parsedump.c rename to src/tools/parsedump.c diff --git a/src/tests/parsetag.c b/src/tools/parsetag.c similarity index 100% rename from src/tests/parsetag.c rename to src/tools/parsetag.c diff --git a/src/tests/parsevnode.c b/src/tools/parsevnode.c similarity index 100% rename from src/tests/parsevnode.c rename to src/tools/parsevnode.c diff --git a/src/tests/parsevol.c b/src/tools/parsevol.c similarity index 100% rename from src/tests/parsevol.c rename to src/tools/parsevol.c diff --git a/src/tests/pathname.c b/src/tools/pathname.c similarity index 100% rename from src/tests/pathname.c rename to src/tools/pathname.c diff --git a/src/tests/primitive.c b/src/tools/primitive.c similarity index 100% rename from src/tests/primitive.c rename to src/tools/primitive.c diff --git a/src/tests/repair.c b/src/tools/repair.c similarity index 100% rename from src/tests/repair.c rename to src/tools/repair.c diff --git a/src/tests/stagehdr.c b/src/tools/stagehdr.c similarity index 100% rename from src/tests/stagehdr.c rename to src/tools/stagehdr.c diff --git a/src/tests/stagehdr.h b/src/tools/stagehdr.h similarity index 100% rename from src/tests/stagehdr.h rename to src/tools/stagehdr.h diff --git a/src/tests/util.c b/src/tools/util.c similarity index 100% rename from src/tests/util.c rename to src/tools/util.c diff --git a/src/tests/xf_errs.et b/src/tools/xf_errs.et similarity index 100% rename from src/tests/xf_errs.et rename to src/tools/xf_errs.et diff --git a/src/tests/xf_files.c b/src/tools/xf_files.c similarity index 100% rename from src/tests/xf_files.c rename to src/tools/xf_files.c diff --git a/src/tests/xf_printf.c b/src/tools/xf_printf.c similarity index 100% rename from src/tests/xf_printf.c rename to src/tools/xf_printf.c diff --git a/src/tests/xf_profile.c b/src/tools/xf_profile.c similarity index 100% rename from src/tests/xf_profile.c rename to src/tools/xf_profile.c diff --git a/src/tests/xf_rxcall.c b/src/tools/xf_rxcall.c similarity index 100% rename from src/tests/xf_rxcall.c rename to src/tools/xf_rxcall.c diff --git a/src/tests/xfiles.c b/src/tools/xfiles.c similarity index 100% rename from src/tests/xfiles.c rename to src/tools/xfiles.c diff --git a/src/tests/xfiles.h b/src/tools/xfiles.h similarity index 100% rename from src/tests/xfiles.h rename to src/tools/xfiles.h