-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (33 loc) · 1.15 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
43
44
45
46
SRC := $(wildcard src/*.cpp)
HEADERS := $(wildcard src/*.hpp)
OBJ = $(SRC:src/%.cpp=build/%.o)
AOBJ = $(SRC:src/%.cpp=build/%.asan.o)
TOBJ = $(SRC:src/%.cpp=build/%.tsan.o)
TOOLSSRC := $(wildcard tools/*.cpp)
TOOLSHEADERS := $(wildcard tools/*.hpp)
TOOLSOBJ = $(TOOLSSRC:tools/%.cpp=build/%.o)
SFMLINCS := $(shell pkg-config --cflags sfml-all)
SFMLLIBS := $(shell pkg-config --libs sfml-all)
TARGET = asteroids
CCMD = $(CXX) -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++20 -g $(SFMLINCS) -c -o $@ $< -Wall -Wextra -Woverloaded-virtual -pedantic-errors $(OPTS)
LCMD = $(CXX) -o $@ -std=c++20 -g $^ $(SFMLLIBS) $(OPTS) -ltbb
$(TARGET): $(OBJ)
$(LCMD) -O3
asan: $(AOBJ)
$(LCMD) -Og -fsanitize=address,undefined,leak
tsan: $(TOBJ)
$(LCMD) -Og -fsanitize=thread
build/%.o : src/%.cpp Makefile $(HEADERS) | build
$(CCMD) -O3
build/%.o : tools/%.cpp Makefile $(HEADERS) | build
$(CCMD) -O3
build/%.asan.o : src/%.cpp Makefile $(HEADERS) | build
$(CCMD) -Og -fsanitize=address,undefined,leak
build/%.tsan.o : src/%.cpp Makefile $(HEADERS) | build
$(CCMD) -Og -fsanitize=thread
mkres: $(TOOLSOBJ)
$(LCMD) -O3
build:
mkdir -p build
clean:
rm -rf build $(TARGET)