-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
30 lines (22 loc) · 1.24 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
CXX=g++
CXXFLAGS=-std=c++17 -Wall -pedantic -Wfatal-errors -Wno-gnu-statement-expression -Wno-unused-function -ferror-limit=1
TARGET_LINKS=-framework OpenGL -framework Cocoa
COMMAND_SOURCE_FILES = $(wildcard src/command/*.cpp)
GAME_MODULES = app game command
GAME_INCLUDES = $(addprefix -I src/, $(GAME_MODULES))
GAME_SOURCE_FILES = $(foreach MODULE,$(GAME_MODULES),$(wildcard src/$(MODULE)/*.cpp))
FARB_MODULES = core interface reflection serialization utils
FARB_LIBS = tigr json
FARB_INCLUDES = $(addprefix -I ../farb/src/, $(FARB_MODULES)) $(addprefix -I ../farb/lib/, $(FARB_LIBS))
debug: CXXFLAGS += -DDebug -g
debug: build/bin/runtests build/bin/brushlink
all: build/bin/runtests build/bin/brushlink
build/bin/runtests: tests/RunTests.cpp src/command/* tests/command/* ../farb/build/link/farb.a
g++ ${CXXFLAGS} $(FARB_INCLUDES) $(GAME_INCLUDES) tests/RunTests.cpp $(COMMAND_SOURCE_FILES) ../farb/build/link/farb.a -g -o ./build/bin/runtests
build/bin/brushlink: src/game/* src/app/* ../farb/build/link/farb.a
$(CXX) $(CXXFLAGS) $(FARB_INCLUDES) $(GAME_INCLUDES) $(GAME_SOURCE_FILES) ../farb/build/link/farb.a -o ./build/bin/brushlink $(TARGET_LINKS)
stats:
for module in $(GAME_MODULES) ; do \
echo MODULE $$module ; \
cloc ./src/$$module ; \
done