X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FMakefile;h=9d7acb0894b7db264e5b4bd4e90a61cff6be0a27;hb=2d0d4ac38e05905a6633b3f2d5112ccadd45c27f;hp=a0b6d6e4ac9829bb6184e41c6cc5bca8b064c03e;hpb=d1930060e483b841f0a9c35c5041035dbdf6de4a;p=model-checker.git diff --git a/test/Makefile b/test/Makefile index a0b6d6e..9d7acb0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,16 +1,26 @@ -include ../common.mk +BASE := .. -CPPFLAGS += -I.. -I../include +OBJECTS := $(patsubst %.c, %.o, $(wildcard *.c)) +OBJECTS += $(patsubst %.cc, %.o, $(wildcard *.cc)) -# Mac OSX options +include $(BASE)/common.mk -SRCS = $(wildcard *.c) -OBJS = $(patsubst %.c,%.o,$(SRCS)) +DIR := litmus +include $(DIR)/Makefile -all: $(OBJS) +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) -MMD -MF $(@D)/.$(@F).d -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME) clean:: - rm -f *.o + rm -f $(OBJECTS) $(DEPS)