-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 900 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 900 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
CXX = g++
INCLUDES = -IHeaders
STANDARD = -std=c++17
SRCS = Sources/System/Tools/SoftwareCanvas.cpp Tests/SoftwareCanvasTests.cpp Sources/System/Vector2.cpp Sources/System/Matrix3x3.cpp Sources/System/Mathf.cpp Sources/System/Color32.cpp
OBJS = $(SRCS:.cpp=.o)
# Targets
DEBUG_TARGET = test_software_canvas_debug
RELEASE_TARGET = test_software_canvas_release
# Flags
DEBUG_FLAGS = $(INCLUDES) $(STANDARD) -g -DDEBUG -DSYSTEM_PROFILER_ENABLED
RELEASE_FLAGS = $(INCLUDES) $(STANDARD) -O3 -DNDEBUG
LDFLAGS = -lgtest -lpthread -lgtest_main
# Default target
all: debug
debug: CXXFLAGS = $(DEBUG_FLAGS)
debug: $(DEBUG_TARGET)
release: CXXFLAGS = $(RELEASE_FLAGS)
release: $(RELEASE_TARGET)
$(DEBUG_TARGET): $(OBJS)
$(CXX) -o $@ $^ $(LDFLAGS)
$(RELEASE_TARGET): $(OBJS)
$(CXX) -o $@ $^ $(LDFLAGS)
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean:
rm -f $(OBJS) $(DEBUG_TARGET) $(RELEASE_TARGET)