-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
45 lines (33 loc) · 826 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
CXXFLAGS=-g -std=c++17 -Werror -Wno-potentially-evaluated-expression -I./include
LDFLAGS=
ifdef CODECOV
CXXFLAGS += -coverage
endif
SRC=$(notdir $(wildcard src/*.cc))
OBJ=$(patsubst %.cc,objs/%.o,$(SRC))
HEADERS=$(wildcard include/*.h)
all:prepare-dep libautumn autumn googletest unitest
prepare-dep:
@mkdir -p objs
@mkdir -p lib
libautumn:./lib/libautumn.a
./lib/libautumn.a:$(OBJ)
ar -r $@ $^
objs/%.o:src/%.cc $(HEADERS)
$(CXX) -o $@ -c $< $(CXXFLAGS)
googletest:
$(MAKE) -C googletest
unitest:
$(MAKE) -C unitest
autumn:repl/autumn.cc ./lib/libautumn.a
$(CXX) $(CXXFLAGS) -o $@ $< -L./lib -lautumn -lreadline
clean:
rm -rf lib objs *.gcov *.gcno *.gcda
$(MAKE) -C googletest clean
$(MAKE) -C unitest clean
.PHONY:all
.PHONY:prepare-dep
.PHONY:libautumn
.PHONY:googletest
.PHONY:unitest
.PHONY:clean