From a0ab20320c0be8b08fd77a9065c06d258df073d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Tvrd=C3=ADk?= Date: Fri, 3 Apr 2015 12:40:07 +0200 Subject: [PATCH] Birdtest: Improve build scripts Add make rule 'clean-tests' Add tests sources to dependecy generator --- tools/Makefile-top.in | 4 +++- tools/Rules.in | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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 -- 2.47.2