-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (37 loc) · 935 Bytes
/
Copy pathMakefile
File metadata and controls
54 lines (37 loc) · 935 Bytes
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
CC = $(shell which clang++)
CC ?= $(shell which g++) # fallback compiler
PY3 = $(shell which python3) # python interpreter (for flask)
CPP_SRC = $(wildcard src/*.cpp)
HEADERS = $(wildcard include/*.hpp)
OBJ = $(patsubst src/%.cpp, obj/%.o, $(CPP_SRC))
CFLAGS = -std=c++20 -Wall -pedantic -Iinclude
DEP_FLAGS = -MMD -MP
RELEASE_CFLAGS = -O2
DEBUG_CFLAGS = -g -O0
DEP_FLAGS = -MMD -MP
RELEASE_CFLAGS = -O2
DEBUG_CFLAGS = -g -O0
compile: bin/nimble
bin/nimble: $(OBJ) | bin
"$(CC)" -o $@ $(OBJ)
bin:
mkdir -p bin
obj/%.o: src/%.cpp $(HEADERS) | obj
"${CC}" $(CFLAGS) -c $< -o $@
obj:
mkdir -p obj
run: compile
./bin/nimble
clean:
rm -f bin/* obj/*.o
test: compile
./tools/test.sh
bench: compile
./tools/bench.sh
release: CFLAGS += $(RELEASE_CFLAGS)
release: clean compile
debug: CFLAGS += $(DEBUG_CFLAGS)
debug: clean compile
web: compile
$(PY3) web/app.py
.PHONY: compile run clean test bench release debug web