-BASE = ..
+BASE := ..
-include $(BASE)/common.mk
+OBJECTS := $(patsubst %.c, %.o, $(wildcard *.c))
+OBJECTS += $(patsubst %.cc, %.o, $(wildcard *.cc))
-CPPFLAGS += -I$(BASE) -I$(BASE)/include
+include $(BASE)/common.mk
-SRCS = $(wildcard *.c)
-CPSRCS = $(wildcard *.cc)
-OBJS = $(patsubst %.c,%.o,$(SRCS)) $(patsubst %.cc,%.o,$(CPSRCS))
+DIR := litmus
+include $(DIR)/Makefile
-all: $(OBJS) litmus-tests
+CPPFLAGS += -I$(BASE) -I$(BASE)/include
-litmus-tests::
- $(MAKE) -C litmus
+all: $(OBJECTS)
%.o: %.c
$(CC) -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME)
$(CXX) -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME)
clean::
- rm -f *.o
- $(MAKE) -C litmus clean
+ rm -f $(OBJECTS)
-BASE = ../..
+D := $(DIR)
-include $(BASE)/common.mk
-
-CPPFLAGS += -I$(BASE) -I$(BASE)/include
-
-SRCS = $(wildcard *.c)
-CPSRCS = $(wildcard *.cc)
-OBJS = $(patsubst %.c,%.o,$(SRCS)) $(patsubst %.cc,%.o,$(CPSRCS))
-
-all: $(OBJS)
-
-%.o: %.c
- $(CC) -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME)
-
-%.o: %.cc
- $(CXX) -o $@ $< $(CPPFLAGS) -L$(BASE) -l$(LIB_NAME)
-
-clean::
- rm -f *.o
+OBJECTS += $(patsubst %.c, %.o, $(wildcard $(D)/*.c))
+OBJECTS += $(patsubst %.cc, %.o, $(wildcard $(D)/*.cc))