X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FMakefile;h=9d7acb0894b7db264e5b4bd4e90a61cff6be0a27;hb=66da4eeb0b6c0e3cce5ef7788eb64151e536d68d;hp=a3de6fe9e7c1030d4d783cc3d5880606ddd9140f;hpb=538175be35df96c8858f384d0001c35701f5e666;p=model-checker.git diff --git a/test/Makefile b/test/Makefile index a3de6fe..9d7acb0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,18 +1,26 @@ -include ../common.mk +BASE := .. -CPPFLAGS += -I.. -I../include +OBJECTS := $(patsubst %.c, %.o, $(wildcard *.c)) +OBJECTS += $(patsubst %.cc, %.o, $(wildcard *.cc)) -SRCS = $(wildcard *.c) -CPSRCS = $(wildcard *.cc) -OBJS = $(patsubst %.c,%.o,$(SRCS)) $(patsubst %.cc,%.o,$(CPSRCS)) +include $(BASE)/common.mk -all: $(OBJS) +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.. -l$(LIB_NAME) + $(CC) -MMD -MF $(@D)/.$(@F).d -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME) %.o: %.cc - $(CXX) -o $@ $< $(CPPFLAGS) -L.. -l$(LIB_NAME) + $(CXX) -MMD -MF $(@D)/.$(@F).d -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME) clean:: - rm -f *.o + rm -f $(OBJECTS) $(DEPS)