forked from Quuxplusone/Homeworlds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (33 loc) · 1.48 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
47
UNAME := $(shell uname -s)
INCLUDES = -Icore-src
CFLAGS += -W -Wall -Wextra -march=native ${INCLUDES}
CXXFLAGS += -std=c++14
# The release setup.
#CFLAGS += -O3 -fomit-frame-pointer -DNDEBUG
# The profiling setup.
#CFLAGS += -O3 -pg -DNDEBUG
# The debug setup.
CFLAGS += -O2 -g
OBJS = mprintf.o PieceCollection.o StarSystem.o GameState.o SingleAction.o WholeMove.o ApplyMove.o
AIOBJS = AllMoves.o AIMove.o AIStaticEval.o PlanetNames.o ${OBJS}
TESTOBJS = PieceCollection.t.o StarSystem.t.o GameState.t.o WholeMove.t.o AllMoves.t.o AIStaticEval.t.o PlanetNames.t.o Retrograde.t.o
all: annotate count-successors wxgui
test: test-core
./test-core
annotate: annotatemain.o getline.o InferMove.o Retrograde.o ${AIOBJS}
${CXX} ${CFLAGS} ${CXXFLAGS} $^ -o $@
count-successors: countmain.o AllMoves.o PlanetNames.o ${OBJS}
${CXX} ${CFLAGS} ${CXXFLAGS} $^ -o $@
test-core: ${TESTOBJS} InferMove.o Retrograde.o ${AIOBJS}
${CXX} ${CFLAGS} ${CXXFLAGS} $^ -lgtest -lgtest_main -o $@
wxgui: wxmain.o wxPiece.o wxSystem.o wxStash.o wxGalaxy.o wxMouse.o getline.o InferMove.o ${AIOBJS}
${CXX} ${CFLAGS} ${CXXFLAGS} $^ `wx-config --libs` -o $@
getline.o: core-src/getline.c core-src/getline.h
${CC} ${CFLAGS} $< -c -o $@
%.o: core-src/%.cc core-src/*.h
${CXX} ${CFLAGS} ${CXXFLAGS} $< -c -o $@
%.o: wxgui-src/%.cc wxgui-src/*.h core-src/*.h
${CXX} ${CFLAGS} ${CXXFLAGS} $< `wx-config --cppflags` -Wno-potentially-evaluated-expression -c -o $@
clean:
rm -f *.o annotate wxgui test-core
.PHONY: all clean test