From b5cab5aacd263577af3502ecf068612591d27704 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 24 Jan 2018 19:19:30 +0300 Subject: Run command passed to if_not_there directly from Makefile.direct Issue #199 (bdwgc). if_not_there tool is modified to accept a single argument (file name). * Makefile.direct (base_lib, cords, test_cpp, c++, mach_dep.o, mark_rts.o, cord/cordtest, cord/de, gctest): Replace "if_not_there " with "if_not_there || ". * Makefile.direct (c++): Add dependency on $(UTILS). * Makefile.direct (gctest): Remove double spaces. * tools/if_not_there.c: Update header comment. * tools/if_not_there.c (main): Allow both 2 and 3 command-line arguments; return 2 if the file does not exist and argc is 2; update the printed usage message. --- Makefile.direct | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'Makefile.direct') diff --git a/Makefile.direct b/Makefile.direct index 4f830b65..56913e5a 100644 --- a/Makefile.direct +++ b/Makefile.direct @@ -202,8 +202,8 @@ base_lib gc.a: $(OBJS) dyn_load.o $(UTILS) ./if_mach SPARC SOLARIS $(AR) rus gc.a $(OBJS) dyn_load.o ./if_mach M68K AMIGA touch dont_ar_1 ./if_mach M68K AMIGA $(AR) -vrus gc.a $(OBJS) dyn_load.o - ./if_not_there dont_ar_1 $(AR) ru gc.a $(OBJS) dyn_load.o - ./if_not_there dont_ar_1 $(RANLIB) gc.a || cat /dev/null + ./if_not_there dont_ar_1 || $(AR) ru gc.a $(OBJS) dyn_load.o + ./if_not_there dont_ar_1 || $(RANLIB) gc.a || cat /dev/null echo > base_lib # Ignore ranlib failure; that usually means it doesn't exist, and # isn't needed. @@ -214,8 +214,8 @@ cords: $(CORD_OBJS) cord/cordtest$(EXEEXT) $(UTILS) base_lib ./if_mach SPARC SOLARIS $(AR) rus gc.a $(CORD_OBJS) ./if_mach M68K AMIGA touch dont_ar_3 ./if_mach M68K AMIGA $(AR) -vrus gc.a $(CORD_OBJS) - ./if_not_there dont_ar_3 $(AR) ru gc.a $(CORD_OBJS) - ./if_not_there dont_ar_3 $(RANLIB) gc.a || cat /dev/null + ./if_not_there dont_ar_3 || $(AR) ru gc.a $(CORD_OBJS) + ./if_not_there dont_ar_3 || $(RANLIB) gc.a || cat /dev/null echo > cords gc_cpp.o: $(srcdir)/gc_cpp.cc $(srcdir)/include/gc_cpp.h $(srcdir)/include/gc.h @@ -225,7 +225,7 @@ test_cpp$(EXEEXT): $(srcdir)/tests/test_cpp.cc $(srcdir)/include/gc_cpp.h \ $(srcdir)/include/gc.h gc_cpp.o base_lib $(UTILS) rm -f test_cpp$(EXEEXT) ./if_mach HP_PA HPUX $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a -ldld `./threadlibs` - ./if_not_there test_cpp$(EXEEXT) $(CXX) $(CXXFLAGS) -o test_cpp$(EXEEXT) $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a `./threadlibs` + ./if_not_there test_cpp$(EXEEXT) || $(CXX) $(CXXFLAGS) -o test_cpp$(EXEEXT) $(srcdir)/tests/test_cpp.cc gc_cpp.o gc.a `./threadlibs` check-cpp: test_cpp$(EXEEXT) ./test_cpp @@ -236,14 +236,14 @@ c++-t: c++ test_cpp$(EXEEXT) c++-nt: c++ @echo "Use ./test_cpp 1 to test the leak library" -c++: gc_cpp.o $(srcdir)/include/gc_cpp.h base_lib +c++: gc_cpp.o $(srcdir)/include/gc_cpp.h base_lib $(UTILS) rm -f dont_ar_4 ./if_mach SPARC SOLARIS touch dont_ar_4 ./if_mach SPARC SOLARIS $(AR) rus gc.a gc_cpp.o ./if_mach M68K AMIGA touch dont_ar_4 ./if_mach M68K AMIGA $(AR) -vrus gc.a gc_cpp.o - ./if_not_there dont_ar_4 $(AR) ru gc.a gc_cpp.o - ./if_not_there dont_ar_4 $(RANLIB) gc.a || cat /dev/null + ./if_not_there dont_ar_4 || $(AR) ru gc.a gc_cpp.o + ./if_not_there dont_ar_4 || $(RANLIB) gc.a || cat /dev/null echo > c++ dyn_load_sunos53.o: dyn_load.c @@ -300,16 +300,16 @@ mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/sparc_mach_dep.S \ ./if_mach IA64 "" $(AS) -o ia64_save_regs_in_stack.o $(srcdir)/ia64_save_regs_in_stack.s ./if_mach IA64 "" $(CC) -c -o mach_dep1.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c ./if_mach IA64 "" $(LD) -r -o mach_dep.o mach_dep1.o ia64_save_regs_in_stack.o - -./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c - -./if_not_there mach_dep.o `cygpath -w /bin/sh` $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c - -./if_not_there mach_dep.o /bin/sh $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c + -./if_not_there mach_dep.o || $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c + -./if_not_there mach_dep.o || `cygpath -w /bin/sh` $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c + -./if_not_there mach_dep.o || /bin/sh $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c mark_rts.o: $(srcdir)/mark_rts.c $(UTILS) rm -f mark_rts.o -./if_mach ALPHA OSF1 $(CC) -c $(CFLAGS) -Wo,-notail $(srcdir)/mark_rts.c - -./if_not_there mark_rts.o $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c - -./if_not_there mark_rts.o `cygpath -w /bin/sh` $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c - -./if_not_there mark_rts.o /bin/sh $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c + -./if_not_there mark_rts.o || $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c + -./if_not_there mark_rts.o || `cygpath -w /bin/sh` $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c + -./if_not_there mark_rts.o || /bin/sh $(CC) -c $(CFLAGS) $(srcdir)/mark_rts.c # Work-around for DEC optimizer tail recursion elimination bug. # The ALPHA-specific line should be removed if gcc is used. @@ -337,7 +337,7 @@ cord/cordtest$(EXEEXT): $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) \ ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a -lucb ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o cord/cordtest $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a -ldld `./threadlibs` ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/cordtest $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a `./threadlibs` - ./if_not_there cord/cordtest$(EXEEXT) $(CC) $(CFLAGS) -o cord/cordtest$(EXEEXT) $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a `./threadlibs` + ./if_not_there cord/cordtest$(EXEEXT) || $(CC) $(CFLAGS) -o cord/cordtest$(EXEEXT) $(srcdir)/cord/tests/cordtest.c $(CORD_OBJS) gc.a `./threadlibs` cord/de: $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o base_lib \ $(UTILS) @@ -350,7 +350,7 @@ cord/de: $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o base_lib \ ./if_mach ALPHA LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` ./if_mach IA64 LINUX $(CC) $(CFLAGS) -o cord/de $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses `./threadlibs` ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o cord/de $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a -lcurses - ./if_not_there cord/de$(EXEEXT) $(CC) $(CFLAGS) -o cord/de$(EXEEXT) $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) `./threadlibs` + ./if_not_there cord/de$(EXEEXT) || $(CC) $(CFLAGS) -o cord/de$(EXEEXT) $(srcdir)/cord/tests/de.c cord/cordbscs.o cord/cordxtra.o gc.a $(CURSES) `./threadlibs` if_mach$(EXEEXT): $(srcdir)/tools/if_mach.c \ $(srcdir)/include/private/gcconfig.h @@ -372,10 +372,10 @@ clean: gctest$(EXEEXT): tests/test.o base_lib $(UTILS) rm -f gctest$(EXEEXT) - ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -lucb - ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -ldld `./threadlibs` + ./if_mach SPARC DRSNX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -lucb + ./if_mach HP_PA HPUX $(CC) $(CFLAGS) -o gctest tests/test.o gc.a -ldld `./threadlibs` ./if_mach M68K AMIGA $(CC) $(CFLAGS) -UGC_AMIGA_MAKINGLIB -o gctest tests/test.o gc.a `./threadlibs` - ./if_not_there gctest$(EXEEXT) $(CC) $(CFLAGS) -o gctest$(EXEEXT) tests/test.o gc.a `./threadlibs` + ./if_not_there gctest$(EXEEXT) || $(CC) $(CFLAGS) -o gctest$(EXEEXT) tests/test.o gc.a `./threadlibs` # If an optimized setjmp_test generates a segmentation fault, # odds are your compiler is broken. Gctest may still work. -- cgit v1.2.1