-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (25 loc) · 774 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
csrc = $(wildcard src/*.c)
ccsrc = $(wildcard src/*.cc)
obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
testsrc = $(wildcard src/tests/*.cc)
testobj = $(testsrc:.cc=.o) $(filter-out src/main.o, $(obj))
LDFLAGS = -lfann -lpthread
CXXFLAGS = -O3 -std=c++14 -Wall -DMULTITHREAD
.PHONY: build build-run build-test build-doc run test clean
build: build-run build-test build-doc
build-run: ./bin/run
build-test: ./bin/test
build-doc: ./docs/_build
./bin/run: $(obj)
$(CXX) -o ./bin/run $^ $(LDFLAGS)
./bin/test: $(testobj)
$(CXX) -o ./bin/test $^ $(LDFLAGS)
./docs/_build: $(wildcard src/*.h)
cd ./docs/ && $(MAKE) html
run: build-run
./bin/run ./data/raw/*.dat
test: build-test
./bin/test
clean:
rm -f $(obj) $(testobj) ./bin/run ./bin/test
cd ./docs/ && $(MAKE) clean