From: Pavel TvrdĂ­k Date: Wed, 15 Apr 2015 10:07:10 +0000 (+0200) Subject: Birdtest: Build system: improve dependencies X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81b2e266fb87376a4219976e4785df0fa66d0c06;p=thirdparty%2Fbird.git Birdtest: Build system: improve dependencies while a some source file is changed, the test suite will recompile --- diff --git a/tools/Makefile.in b/tools/Makefile.in index e3d3fc09a..30dd79e54 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -13,9 +13,9 @@ tests: test/birdtest.o set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done -test/birdtest.o: $(srcdir)/test/birdtest.c +test/birdtest.o: $(srcdir)/test/birdtest.c $(srcdir)/test/birdtest.h mkdir -p test - $(CC) $(CFLAGS) $(TARGET_ARCH) -c $^ $(LDLIBS) -o $@ + $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< $(LDLIBS) -o $@ daemon: $(exedir)/bird diff --git a/tools/Rules.in b/tools/Rules.in index 92ef01c1f..c58304432 100644 --- a/tools/Rules.in +++ b/tools/Rules.in @@ -47,7 +47,10 @@ tests_executables := $(notdir $(basename $(tests_sources))) tests: $(tests_executables) -%_test: $(srcdir)/$(dir-name)/%_test.c $(root-rel)test/birdtest.o +%_test.o: $(srcdir)/$(dir-name)/%_test.c + $(CC) $(CFLAGS) $(LDFLAGS) $^ -c -o $@ + +%_test: $(srcdir)/$(dir-name)/%_test.o $(root-rel)test/birdtest.o $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ ifdef source diff --git a/tools/run_tests.sh b/tools/run_tests.sh index 3e84ca108..9d06061fd 100755 --- a/tools/run_tests.sh +++ b/tools/run_tests.sh @@ -39,4 +39,4 @@ echo " ------------------------------" echo " Success: $num_succ_tests" echo " Failure: $num_fail_tests" echo " Build-Failure: $num_build_fail_tests" -echo " ------------------------------" +echo ""