Commit 81b2e266 authored by Pavel Tvrdík's avatar Pavel Tvrdík
Browse files

Birdtest: Build system: improve dependencies

while a some source file is changed, the test suite will recompile
parent 1ce8d33b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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

+4 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -39,4 +39,4 @@ echo " ------------------------------"
echo "    Success: $num_succ_tests"
echo "    Failure: $num_fail_tests"
echo "    Build-Failure: $num_build_fail_tests"
echo "  ------------------------------"
echo ""