-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
97 lines (81 loc) · 2.27 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
94
95
96
97
CMAKE:=cmake
CMAKE_CACHE:=CMakeCache.txt
MKDIR:=mkdir
LN:=ln
TEST:=test
SUNFISH:=sunfish
EVAL_BIN:=eval.bin
BUILD_DIR:=build
PROF:=gprof
PROFOUT:=profile.txt
BMI2:=ON
EXT_OPTS:=-D BMI2=$(BMI2)
.PHONY: release release-pgo release-prof debug profile profile1 learn clean run-prof run-prof1
help:
@echo 'usage:'
@echo ' make release'
@echo ' make release-pgo'
@echo ' make debug'
@echo ' make test'
@echo ' make profile'
@echo ' make profile1'
@echo ' make learn'
@echo ' make clean'
release:
$(MKDIR) -p $(BUILD_DIR)/$@ 2> /dev/null
cd $(BUILD_DIR)/$@ && \
$(CMAKE) -D CMAKE_BUILD_TYPE=Release $(EXT_OPTS) ../../src && \
$(MAKE)
$(LN) -s -f $(BUILD_DIR)/$@/$(SUNFISH) $(SUNFISH)
release-pgo:
$(TEST) -f $(EVAL_BIN)
$(MKDIR) -p $(BUILD_DIR)/$@ 2> /dev/null
$(RM) -f $(BUILD_DIR)/$@/$(CMAKE_CACHE)
cd $(BUILD_DIR)/$@ && \
$(CMAKE) -D CMAKE_BUILD_TYPE=Release $(EXT_OPTS) -D PROFILE_GENERATE=ON ../../src && \
$(MAKE) clean && $(MAKE)
$(LN) -s -f $(BUILD_DIR)/$@/$(SUNFISH) $(SUNFISH)
$(MAKE) run-prof
$(RM) -f $(BUILD_DIR)/$@/$(CMAKE_CACHE)
cd $(BUILD_DIR)/$@ && \
$(CMAKE) -D CMAKE_BUILD_TYPE=Release $(EXT_OPTS) -D PROFILE_USE=ON ../../src && \
$(MAKE) clean && $(MAKE)
debug:
$(MKDIR) -p $(BUILD_DIR)/$@ 2> /dev/null
cd $(BUILD_DIR)/$@ && \
$(CMAKE) -D CMAKE_BUILD_TYPE=Debug $(EXT_OPTS) ../../src && \
$(MAKE)
$(LN) -s -f $(BUILD_DIR)/$@/$(SUNFISH) $(SUNFISH)
test:
$(MAKE) debug
$(SHELL) -c './$(SUNFISH) --test'
release-prof:
$(TEST) -f $(EVAL_BIN)
$(MKDIR) -p $(BUILD_DIR)/$@ 2> /dev/null
cd $(BUILD_DIR)/$@ && \
$(CMAKE) -D CMAKE_BUILD_TYPE=Release $(EXT_OPTS) -D PROFILE=ON ../../src && \
$(MAKE)
$(LN) -s -f $(BUILD_DIR)/$@/$(SUNFISH) $(SUNFISH)
profile:
$(MAKE) release-prof
$(MAKE) run-prof
$(SHELL) -c '$(PROF) ./$(SUNFISH) > $(PROFOUT)'
@echo "Look $(PROFOUT)."
profile1:
$(MAKE) release-prof
$(MAKE) run-prof1
$(SHELL) -c '$(PROF) ./$(SUNFISH) > $(PROFOUT)'
@echo "Look $(PROFOUT)."
learn:
$(MKDIR) -p $(BUILD_DIR)/$@ 2> /dev/null
cd $(BUILD_DIR)/$@ && \
$(CMAKE) -D CMAKE_BUILD_TYPE=Release $(EXT_OPTS) -D LEARNING=ON ../../src && \
$(MAKE)
$(LN) -s -f $(BUILD_DIR)/$@/$(SUNFISH) $(SUNFISH)
clean:
$(RM) -r $(BUILD_DIR)
$(RM) $(SUNFISH)
run-prof:
./$(SUNFISH) --profile -d 30 -t 10
run-prof1:
./$(SUNFISH) --profile1 -d 30 -t 10