-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
58 lines (40 loc) · 1.06 KB
/
makefile
File metadata and controls
58 lines (40 loc) · 1.06 KB
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
CXX=clang++
CFLAGS=-Wall -Wextra -std=c++14
DFLAGS=
IFLAGS=
OBJDIR=obj
SRCDIR=src
TSTDIR=tests
DOCDIR=doc
DFLAGS+= -DGIT_REV=$(shell git describe --tags --always)
TEST_SOURCES := $(shell find $(TSTDIR) -name '*cpp')
RELEASE_OBJS := $(addprefix $(OBJDIR)/,main.o tree.o newick.o star.o nj.o gstar.o)
TEST_OBJS := $(addprefix $(OBJDIR)/, $(TEST_SOURCES:$(TSTDIR)/%.cpp=%.o))
all: release
debug: CFLAGS+= -DDEBUG -DEMIT_DEBUG -g -O0
debug: sunstar
release: CFLAGS+= -DRELEASE -O3 -march=native
release: sunstar
sunstar: $(RELEASE_OBJS)
$(CXX) $(CFLAGS) -o $@ $^ $(DFLAGS)
sunstar_tests: $(TEST_OBJS)
$(CXX) $(CFLAGS) -o $@ $^ $(DFLAGS)
%o: CFLAGS+=-c
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp | $(OBJDIR)
$(CXX) $(CFLAGS) -o $@ $^ $(DFLAGS)
$(OBJDIR)/%.o: $(TSTDIR)/%.cpp | $(OBJDIR)
$(CXX) $(CFLAGS) -o $@ $^ $(DFLAGS)
$(OBJDIR):
mkdir $@
run: debug
./sunstar
tests: CFLAGS+= -DDEBUG -g -O0
tests: sunstar_tests
run-tests: tests
./sunstar_tests
verbose-tests: CFLAGS+= -DEMIT_DEBUG
verbose-tests: tests
docs:
make -C $(DOCDIR)
clean:
rm -rf obj sunstar sunstar_tests *.log