From: Pavel TvrdĂ­k Date: Fri, 3 Apr 2015 10:40:07 +0000 (+0200) Subject: Birdtest: Improve build scripts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0ab20320c0be8b08fd77a9065c06d258df073d9;p=thirdparty%2Fbird.git Birdtest: Improve build scripts Add make rule 'clean-tests' Add tests sources to dependecy generator --- diff --git a/tools/Makefile-top.in b/tools/Makefile-top.in index 4a8883b5d..3f199a8a9 100644 --- a/tools/Makefile-top.in +++ b/tools/Makefile-top.in @@ -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 diff --git a/tools/Rules.in b/tools/Rules.in index 1a50dd170..92ef01c1f 100644 --- a/tools/Rules.in +++ b/tools/Rules.in @@ -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