-
Notifications
You must be signed in to change notification settings - Fork 23
/
makefile
executable file
·78 lines (53 loc) · 2.15 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
BUILD_DIR = build
SRC_DIR = src
BIN_DIR = bin
CFLAGS = -Winline -O2 -std=c++11 -g
#CFLAGS = -Winline -DDEBUG_MESSAGE -O0 -std=c++0x -g
SOURCES_TMP += CliqueTools.cpp
SOURCES_TMP += MemoryManager.cpp
SOURCES_TMP += Algorithm.cpp
SOURCES_TMP += TomitaAlgorithm.cpp
SOURCES_TMP += AdjacencyListAlgorithm.cpp
SOURCES_TMP += HybridAlgorithm.cpp
SOURCES_TMP += DegeneracyAlgorithm.cpp
SOURCES_TMP += DegeneracyTools.cpp
SOURCES_TMP += Tools.cpp
SOURCES=$(addprefix $(SOURCES_DIR)/, $(SOURCES_TMP))
OBJECTS_TMP=$(SOURCES_TMP:.cpp=.o)
OBJECTS=$(addprefix $(BUILD_DIR)/, $(OBJECTS_TMP))
DEPFILES_TMP:=$(SOURCES_TMP:.cpp=.d)
DEPFILES=$(addprefix $(BUILD_DIR)/, $(DEPFILES_TMP))
EXEC_NAMES = printnm compdegen qc
EXECS = $(addprefix $(BIN_DIR)/, $(EXEC_NAMES))
#DEFINE += -DDEBUG #for debugging
#DEFINE += -DMEMORY_DEBUG #for memory debugging.
#DEFINE += -DPRINT_CLIQUES_ONE_BY_ONE #print cliques, one per line
# print cliques in tree-like format:
# - print each vertex that's evaluated
# - print c if you reach a maximal clique to report
# - print b if you backtrack
#DEFINE += -DPRINT_CLIQUES_TOMITA_STYLE # used by Eppstein and Strash (2011)
#some systems handle malloc and calloc with 0 bytes strangely.
DEFINE += -DALLOW_ALLOC_ZERO_BYTES # used by Eppstein and Strash (2011)
#set CXX to generic g++ if not set.
CXX ?= g++
VPATH = src
.PHONY : all
all: $(EXECS)
.PHONY : clean
clean:
rm -rf $(EXECS) $(BUILD_DIR) $(BIN_DIR)
$(BIN_DIR)/printnm: printnm.cpp ${OBJECTS} makefile | ${BIN_DIR}
$(CXX) $(CFLAGS) ${DEFINE} ${OBJECTS} $(SRC_DIR)/printnm.cpp -o $@
$(BIN_DIR)/compdegen: compdegen.cpp ${OBJECTS} makefile | ${BIN_DIR}
$(CXX) $(CFLAGS) ${DEFINE} ${OBJECTS} $(SRC_DIR)/compdegen.cpp -o $@
$(BIN_DIR)/qc: main.cpp ${OBJECTS} makefile | ${BIN_DIR}
$(CXX) $(CFLAGS) ${DEFINE} ${OBJECTS} $(SRC_DIR)/main.cpp -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h $(BUILD_DIR)/%.d makefile | $(BUILD_DIR)
$(CXX) $(CFLAGS) ${DEFINE} -c $< -o $@
$(BUILD_DIR)/%.d: $(SRC_DIR)/%.cpp makefile | $(BUILD_DIR)
$(CXX) $(CFLAGS) -MM -MT '$(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$<)' $< -MF $@
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BIN_DIR):
mkdir -p $(BIN_DIR)