]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Birdtest: Improve build scripts
authorPavel Tvrdík <pawel.tvrdik@gmail.cz>
Fri, 3 Apr 2015 10:40:07 +0000 (12:40 +0200)
committerPavel Tvrdík <pawel.tvrdik@gmail.cz>
Fri, 3 Apr 2015 10:40:07 +0000 (12:40 +0200)
Add make rule 'clean-tests'
Add tests sources to dependecy generator

tools/Makefile-top.in
tools/Rules.in

index 4a8883b5d6afb457e17002076bc426949f9c7843..3f199a8a97cc031771d13fa08f4617010a248662 100644 (file)
@@ -12,7 +12,7 @@ docs userdocs progdocs:
 check: tests
        tools/run_tests.sh "@objdir@" "@srcdir@"
 
-clean:
+clean: clean-tests
        $(MAKE) -C $(objdir) clean
        find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core -or -name depend -or -name ".#*" | xargs rm -f
 
@@ -21,3 +21,5 @@ distclean: clean
        rm -rf $(objdir) autom4te.cache
        rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile
 
+clean-tests:
+       find . -name '*_test' | xargs rm -f
\ No newline at end of file
index 1a50dd17066ccfe428bfe34edf30ef74edaf9270..92ef01c1f2fb27593983d034e4a2671d419ddbc0 100644 (file)
@@ -47,8 +47,8 @@ tests_executables := $(notdir $(basename $(tests_sources)))
 
 tests: $(tests_executables)
 
-%_test: $(srcdir)/$(dir-name)/%_test.c
-       $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(root-rel)test/birdtest.o
+%_test: $(srcdir)/$(dir-name)/%_test.c $(root-rel)test/birdtest.o
+       $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
 
 ifdef source
 
@@ -90,7 +90,7 @@ source-dep := $(source)
 endif
 
 depend:
-       $(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source-dep)) >depend
+       $(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source-dep)) $(tests_sources) >depend
 
 ifneq ($(wildcard depend),)
 include depend