forked from AMS-MRC-disc-math-bio/pmfe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (58 loc) · 1.67 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
78
# source files
SRC := $(wildcard src/*.cc)
OBJ := $(SRC:.cc=.o)
BINSRC := $(wildcard src/bin-*.cc)
BINOBJ := $(BINSRC:.cc=.o)
TESTSRC := $(wildcard src/test-*.cc)
TESTOBJ := $(TESTSRC:.cc=.o)
LIBOBJ := $(OBJ)
LIBOBJ := $(filter-out $(BINOBJ),$(LIBOBJ))
LIBOBJ := $(filter-out $(TESTOBJ),$(LIBOBJ))
DEP := $(SRC:.cc=.P)
HDR := $(wildcard src/*.h)
# include directories
INCLUDES += -Iinclude
INCLUDES += -IiB4e
INCLUDES += -I/usr/local/include # For Homebrew
# C++ compiler flags
CXXFLAGS += --std=c++11
CXXFLAGS += -fPIC
CXXFLAGS += -fopenmp
CXXFLAGS += -Wall
CXXFLAGS += -g
CXXFLAGS += -O3
# library paths
LIBS += -L/usr/local/lib # For Homebrew
LIBS += -lgmp -lgmpxx
LIBS += -lCGAL
LIBS += -lm
LIBS += -lboost_filesystem
LIBS += -lboost_program_options
LIBS += -lboost_system
LIBS += -lboost_log
BIN = pmfe-findmfe pmfe-scorer pmfe-parametrizer pmfe-subopt pmfe-tests
all: $(OBJ) $(BIN)
-include $(DEP)
debug: CXXFLAGS += -Og
debug: all
pmfe-findmfe: $(LIBOBJ) src/bin-findmfe.o
$(CXX) $(LDFLAGS) $(CXXFLAGS) $^ -o $@ $(LIBS)
pmfe-scorer: $(LIBOBJ) src/bin-scorer.o
$(CXX) $(LDFLAGS) $(CXXFLAGS) $^ -o $@ $(LIBS)
pmfe-parametrizer: $(LIBOBJ) src/bin-parametrizer.o
$(CXX) $(LDFLAGS) $(CXXFLAGS) $^ -o $@ $(LIBS)
pmfe-subopt: $(LIBOBJ) src/bin-subopt.o
$(CXX) $(LDFLAGS) $(CXXFLAGS) $^ -o $@ $(LIBS)
pmfe-tests: $(LIBOBJ) $(TESTOBJ) src/bin-tests.o
$(CXX) $(LDFLAGS) $(CXXFLAGS) $^ -o $@ $(LIBS)
%.o: %.cc
$(CXX) -MD $(CXXFLAGS) $(INCLUDES) -o $@ -c $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
clean:
-rm -vf $(EXEC) $(OBJ) $(DEP) $(BIN)
install:
uninstall:
.PHONY: clean