-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))