-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
52 lines (38 loc) · 973 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
include ./MakefileInc.mk
# use DEBUG or RELEASE optimization flags
ifeq ($(DEBUGMODE), yes)
CXXFLAGS += $(DEBUG_OPT)
LINKFLAGS+= $(DEBUG_OPT)
else
CXXFLAGS += $(RELEASE_OPT)
LINKFLAGS+= $(RELEASE_OPT)
endif
# set of libraries to correctly link to the target
INCLUDE_DIRS = -I$(CURDIR) $(USERINCLUDE)
LIBRARIES = $(USERLINK)
# System-specific settings
SHELL = /bin/sh
SIZE = size
# Definitions
TEST := TEST.X
#OBJ := $(SRCS:.cpp=.o)
TEST_OBJ := tests/test_main.o
all: $(EXE)
doc:
doxygen kmc-documentation.cfg
test: $(TEST)
./$(TEST)
# Dependency files
#OBJ_DEP = $(OBJ:.o=.d)
TESTOBJ_DEP = $(TEST_OBJ:.o=.d)
# pull in dependency info for *existing* .o files
#-include $(OBJ_DEP)
-include $(TESTOBJ_DEP)
# Link rule
$(TEST): $(TEST_OBJ)
$(LINK) $(TEST_OBJ) -o $(TEST) $(LINKFLAGS)
%.o: %.cpp
$(CXX) -MD -MP $(CXXFLAGS) $(INCLUDE_DIRS) -c $*.cpp -o $*.o
# remove compilation products
clean:
rm -vf $(EXE) $(TEST) $(TEST_OBJ) $(TESTOBJ_DEP)