tests: Makefile: eliminate (some) recursive make
[model-checker.git] / test / Makefile
index c918368e253c6d282b9bece62f1031be4177e66c..5e5e76c6c2b546e197ec3d32b220c6e20a32d857 100644 (file)
@@ -1,14 +1,16 @@
-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))
+CPPFLAGS += -I$(BASE) -I$(BASE)/include
 
-all: $(OBJS)
+all: $(OBJECTS)
 
 %.o: %.c
        $(CC) -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME)
@@ -17,4 +19,4 @@ all: $(OBJS)
        $(CXX) -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME)
 
 clean::
-       rm -f *.o
+       rm -f $(OBJECTS)