From: Brian Norris Date: Wed, 29 May 2013 00:59:58 +0000 (-0700) Subject: tests: Makefile: add dependency information X-Git-Url: http://plrg.eecs.uci.edu/git/?p=cdsspec-compiler.git;a=commitdiff_plain;h=93221839adb57ec10dd80f42be3963732cd2e236;ds=inline tests: Makefile: add dependency information Now tests will be re-compiled whenever their include files are modified. --- diff --git a/test/Makefile b/test/Makefile index 5e5e76c..9d7acb0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -8,15 +8,19 @@ include $(BASE)/common.mk DIR := litmus include $(DIR)/Makefile +DEPS := $(join $(addsuffix ., $(dir $(OBJECTS))), $(addsuffix .d, $(notdir $(OBJECTS)))) + CPPFLAGS += -I$(BASE) -I$(BASE)/include all: $(OBJECTS) +-include $(DEPS) + %.o: %.c - $(CC) -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME) + $(CC) -MMD -MF $(@D)/.$(@F).d -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME) %.o: %.cc - $(CXX) -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME) + $(CXX) -MMD -MF $(@D)/.$(@F).d -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME) clean:: - rm -f $(OBJECTS) + rm -f $(OBJECTS) $(DEPS)