-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
93 lines (77 loc) · 3.25 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.PHONY: clean fresh run gendeps
LDFLAGS += -pthread
OBJECTS = castro.o fileio.o gtpgeneral.o gtpplayer.o gtpsolver.o string.o \
solverab.o solverpns.o solverpns2.o solverpns_tt.o player.o playeruct.o zobrist.o
SYS := $(shell gcc -dumpmachine)
ifneq (, $(findstring linux, $(SYS)))
OBJECTS += alarm.o
else
#else ifneq(, $(findstring mingw, $(SYS)))
#else ifneq(, $(findstring cygwin, $(SYS)))
OBJECTS += alarm-timer.o
endif
ifdef DEBUG
CPPFLAGS += -g3 -Wall
else
CPPFLAGS += -O3 -funroll-loops -Wall
OSTYPE := $(shell uname -s)
ifeq ($(OSTYPE),Darwin)
CPPFLAGS += -m64
LDFLAGS += -m64
else
CPPFLAGS += -march=native
endif
endif
all: castro
mm: mm.cpp
g++ -O3 -Wall -o mm mm.cpp
castro: $(OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
clean:
rm -f *.o castro mm mm-with-freq.dat
fresh: clean all
profile:
valgrind --tool=callgrind ./castro
gendeps:
ls *.cpp -1 | xargs -L 1 cpp -M -MM
############ everything below is generated by: make gendeps
alarm.o: alarm.cpp alarm.h time.h
alarm-timer.o: alarm-timer.cpp alarm.h time.h timer.h thread.h
castro.o: castro.cpp havannahgtp.h gtp.h string.h game.h board.h move.h \
zobrist.h types.h hashset.h solver.h solverab.h solverpns.h \
compacttree.h thread.h lbdist.h log.h solverpns2.h solverpns_tt.h \
player.h time.h depthstats.h xorshift.h weightedrandtree.h
fileio.o: fileio.cpp fileio.h
gtpgeneral.o: gtpgeneral.cpp havannahgtp.h gtp.h string.h game.h board.h \
move.h zobrist.h types.h hashset.h solver.h solverab.h solverpns.h \
compacttree.h thread.h lbdist.h log.h solverpns2.h solverpns_tt.h \
player.h time.h depthstats.h xorshift.h weightedrandtree.h
gtpplayer.o: gtpplayer.cpp havannahgtp.h gtp.h string.h game.h board.h \
move.h zobrist.h types.h hashset.h solver.h solverab.h solverpns.h \
compacttree.h thread.h lbdist.h log.h solverpns2.h solverpns_tt.h \
player.h time.h depthstats.h xorshift.h weightedrandtree.h fileio.h
gtpsolver.o: gtpsolver.cpp havannahgtp.h gtp.h string.h game.h board.h \
move.h zobrist.h types.h hashset.h solver.h solverab.h solverpns.h \
compacttree.h thread.h lbdist.h log.h solverpns2.h solverpns_tt.h \
player.h time.h depthstats.h xorshift.h weightedrandtree.h
mm.o: mm.cpp
player.o: player.cpp player.h time.h types.h move.h string.h board.h \
zobrist.h hashset.h depthstats.h thread.h xorshift.h weightedrandtree.h \
lbdist.h compacttree.h log.h solverab.h solver.h solverpns.h alarm.h \
fileio.h
playeruct.o: playeruct.cpp player.h time.h types.h move.h string.h \
board.h zobrist.h hashset.h depthstats.h thread.h xorshift.h \
weightedrandtree.h lbdist.h compacttree.h log.h solverab.h solver.h \
solverpns.h
solverab.o: solverab.cpp solverab.h solver.h board.h move.h string.h \
zobrist.h types.h hashset.h time.h alarm.h log.h
solverpns2.o: solverpns2.cpp solverpns2.h solver.h board.h move.h \
string.h zobrist.h types.h hashset.h compacttree.h thread.h lbdist.h \
log.h time.h alarm.h
solverpns.o: solverpns.cpp solverpns.h solver.h board.h move.h string.h \
zobrist.h types.h hashset.h compacttree.h thread.h lbdist.h log.h time.h \
alarm.h
solverpns_tt.o: solverpns_tt.cpp solverpns_tt.h solver.h board.h move.h \
string.h zobrist.h types.h hashset.h time.h alarm.h log.h
string.o: string.cpp string.h types.h
zobrist.o: zobrist.cpp zobrist.h types.h