-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.mk
More file actions
29 lines (20 loc) · 705 Bytes
/
compile.mk
File metadata and controls
29 lines (20 loc) · 705 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
CXXFLAGS += -g -Wall -std=c++17 -pipe
CXXFLAGS_OPT = -DNDEBUG -march=native -Ofast -flto
CXXFLAGS_DEBUG = -D_DEBUG
CXXFLAGS_COVERAGE = $(CXXFLAGS_DEBUG) -fprofile-arcs -ftest-coverage
CXXFLAGS_PROFILE = $(CXXFLAGS_OPT) -fprofile-generate
CXXFLAGS_PROFILED = $(CXXFLAGS_OPT) -fprofile-use
CXXOBJECTS = $(CXXFILES:.cpp=.o)
SOURCES = $(CXXFILES)
OBJECTS = $(CXXOBJECTS)
PCH = stdafx.h.gch
all: opt
opt: CXXFLAGS += $(CXXFLAGS_OPT)
debug: CXXFLAGS += $(CXXFLAGS_DEBUG)
coverage: CXXFLAGS += $(CXXFLAGS_COVERAGE)
profile: CXXFLAGS += $(CXXFLAGS_PROFILE)
profiled: CXXFLAGS += $(CXXFLAGS_PROFILED)
$(PCH): stdafx.h
$(CXX) $(CXXFLAGS) -x c++-header $<
%.o: %.cpp $(PCH)
$(CXX) $(CXXFLAGS) $< -c -o $@