]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Birdtest: Build system: improve dependencies
authorPavel Tvrdík <pawel.tvrdik@gmail.cz>
Wed, 15 Apr 2015 10:07:10 +0000 (12:07 +0200)
committerPavel Tvrdík <pawel.tvrdik@gmail.cz>
Wed, 15 Apr 2015 10:07:10 +0000 (12:07 +0200)
while a some source file is changed, the test suite will recompile

tools/Makefile.in
tools/Rules.in
tools/run_tests.sh

index e3d3fc09a7a83fd88a930eff0c1a6cb1d372cbbb..30dd79e5454ac1a7e100cd285f73cd3bd1c89121 100644 (file)
@@ -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
 
index 92ef01c1f2fb27593983d034e4a2671d419ddbc0..c583044324120c63eca1cf36d789009017fd2168 100644 (file)
@@ -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
index 3e84ca108de44355c86b9250fe93890b10169175..9d06061fdf030298312ec42d77e0497dc86456a8 100755 (executable)
@@ -39,4 +39,4 @@ echo "  ------------------------------"
 echo "    Success: $num_succ_tests"
 echo "    Failure: $num_fail_tests"
 echo "    Build-Failure: $num_build_fail_tests"
-echo "  ------------------------------"
+echo ""