-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (30 loc) · 1.19 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
MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
GCC = g++
LIBS = -lm -larmadillo -lmlpack -lfmt
CPPFLAGS = -g -flto -O2 -pedantic -std=c++17 -MMD
WARNINGFLAGS = -Wall -Wextra -Wconversion -Wshadow -Wdouble-promotion -Wfloat-equal -Wnon-virtual-dtor -Woverloaded-virtual -Wfatal-errors
CDEBUGFLAGS = -fno-omit-frame-pointer
INCLUDES = $(CURDIR)
HEADERS = $(wildcard */*.h) $(wildcard */*/*.h) $(wildcard */*/*/*.h)
CPPS = $(wildcard */*.cpp) $(wildcard */*/*.cpp) $(wildcard */*/*/*.cpp)
TEMPLATES = $(wildcard */*.tpp) $(wildcard */*/*.tpp) $(wildcard */*/*/*.tpp)
OBJECTS = $(patsubst %.cpp,%.o,$(CPPS))
DEPENDS = $(patsubst %.cpp,%.d,$(CPPS))
all: bin/vpkde bin/test bin/meteors bin/angles
%.o: %.cpp $(TEMPLATES) $(HEADERS) Makefile
$(GCC) $(CPPFLAGS) $(CDEBUGFLAGS) $(WARNINGFLAGS) -I $(INCLUDES) -c $< -o $@
bin/%: $(OBJECTS) %.o
mkdir -p bin
$(GCC) $(CPPFLAGS) $(CDEBUGFLAGS) $(WARNINGFLAGS) -I $(INCLUDES) $^ $(LIBS) -o $@
clean:
rm -f bin/*
rm -f $(OBJECTS)
rm -f $(DEPENDS)
-include $(DEPENDS)
%.png: %.bin
./visualize2d.py $< $@ 1000 1000 --points data/data.tsv
.SECONDEXPANSION:
allpic: \
$$(subst .bin,.png,$$(wildcard out/*.bin));
distclean: \
clean