X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FMakefile;h=9d7acb0894b7db264e5b4bd4e90a61cff6be0a27;hb=8251cec4d80742ccb111930c6def56448cfcece0;hp=f1ea5b295d110f81090bf2807b2aeb25c2b9f8bc;hpb=9aae08ba6d60aa253039d2da1c3571fdde2ac159;p=model-checker.git diff --git a/test/Makefile b/test/Makefile index f1ea5b2..9d7acb0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,24 +1,26 @@ -BASE = .. +BASE := .. + +OBJECTS := $(patsubst %.c, %.o, $(wildcard *.c)) +OBJECTS += $(patsubst %.cc, %.o, $(wildcard *.cc)) include $(BASE)/common.mk -CPPFLAGS += -I$(BASE) -I$(BASE)/include +DIR := litmus +include $(DIR)/Makefile -SRCS = $(wildcard *.c) -CPSRCS = $(wildcard *.cc) -OBJS = $(patsubst %.c,%.o,$(SRCS)) $(patsubst %.cc,%.o,$(CPSRCS)) +DEPS := $(join $(addsuffix ., $(dir $(OBJECTS))), $(addsuffix .d, $(notdir $(OBJECTS)))) + +CPPFLAGS += -I$(BASE) -I$(BASE)/include -all: $(OBJS) litmus-tests +all: $(OBJECTS) -litmus-tests:: - $(MAKE) -C litmus +-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 *.o - $(MAKE) -C litmus clean + rm -f $(OBJECTS) $(DEPS)