-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
47 lines (32 loc) · 956 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
CXX=g++
INCLUDE_DIR=include
LDIR=-L/usr/lib/x86_64-linux-gnu/
LDLIBS=-lboost_graph -lboost_regex -larmadillo
LDBOOSTTEST=-lboost_system -lboost_thread -lboost_unit_test_framework
CXXFLAGS=-std=c++20 -MMD -MP -I$(INCLUDE_DIR) $(LDIR) $(LDLIBS)
#Logging, if needed
#DMACRO=-DBOOST_LOG_DYN_LINK
#LDLIBS=-lboost_graph -lboost_regex -lpthread -lboost_log -lboost_system
RM=rm -f
#SRC=$(wildcard *.cpp)
SRC=xnumber.cpp finddpc.cpp findppembedding.cpp
TEST=$(shell find test -iname 'test_*.cpp')
.PHONY: all
all: $(SRC:%.cpp=%)
$(SRC:%.cpp=%): % : %.cpp
$(CXX) $(CXXFLAGS) -O3 -o $@ $<
-include $(SRC:%.cpp=%.d)
$(TEST:%.cpp=%): % : %.cpp
$(CXX) $(CXXFLAGS) -p -g -o [email protected] $< && ./[email protected]
-include $(TEST:%.cpp=%.d)
test: test.cpp
$(CXX) $(CXXFLAGS) -p -g -o quick_test test.cpp
#$(info "$(TEST)")
test_all: $(TEST:%.cpp=%)
.PHONY: clean
.PHONY: quick_test
quick_test: test
./quick_test
clean:
$(RM) *.o *.d
$(RM) test/*.test test/*.d