From 4a4ce3ccc686d4f389fbe9c87c53326aaf3d4c7e Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 10 Jul 2008 14:34:12 +0000 Subject: Improved dependency tracking. There's currently an issue that means that testcases don't get rebuilt when the debug library changes -- the workaround is to make clean. I've currently no idea how to fix this -- see the FIXME in test/Makefile for details. svn path=/trunk/hubbub/; revision=4571 --- test/Makefile | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index 97648e4..b2061c8 100644 --- a/test/Makefile +++ b/test/Makefile @@ -49,7 +49,8 @@ TESTS_$(d) := $(TESTS_$(d)) regression/cscodec-segv regression/filter-segv \ ITEMS_CLEAN := $(ITEMS_CLEAN) \ $(addprefix $(d), $(addsuffix $(EXEEXT), $(TESTS_$(d)))) \ $(addprefix $(d), $(addsuffix .gcda, $(TESTS_$(d)))) \ - $(addprefix $(d), $(addsuffix .gcno, $(TESTS_$(d)))) + $(addprefix $(d), $(addsuffix .gcno, $(TESTS_$(d)))) \ + $(addprefix $(d), $(addsuffix .d, $(TESTS_$(d)))) ITEMS_DISTCLEAN := $(ITEMS_DISTCLEAN) $(d)log # Targets for top-level makefile to run @@ -64,9 +65,23 @@ TARGET_TESTS := $(TARGET_TESTS) test_$(d) test_$(d): $(d) $(addprefix $(d), $(TESTS_$(d))) @$(PERL) $(TOP)/$ $(1)" @$$(CC) -c -g $$(DEBUGCFLAGS) -o $$@.o $(1) @$$(LD) -g -o $$@ $$@.o $$(LDFLAGS) -lhubbub-debug -lgcov @@ -75,7 +90,14 @@ $(2): $$(TOP)/$$(COMPONENT)-debug.a $(1) endef $(eval $(foreach TEST,$(addprefix $(d), $(TESTS_$(d))), \ - $(call compile_test,$(addsuffix .c, $(TEST)),$(TEST)))) + $(call dep_test,$(addsuffix .c, $(TEST)),$(addsuffix .d, $(TEST)),$(TEST)))) + +ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) +-include $(sort $(DEP_$(d))) +endif + +$(eval $(foreach TEST,$(addprefix $(d), $(TESTS_$(d))), \ + $(call compile_test,$(addsuffix .c, $(TEST)),$(TEST),$(addsuffix .d, $(TEST))))) # Now include any children we may have MAKE_INCLUDES := $(wildcard $(d)*/Makefile) -- cgit v1.2.3