summarylogtreecommitdiffstats
path: root/Makefile.patch
blob: 321b07150353656fe859edcf295c3e6efc52e643 (plain)
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
98
99
100
101
102
--- Makefile.orig	2016-10-03 23:11:34.000000000 +0300
+++ Makefile	2017-03-25 19:59:41.178474095 +0300
@@ -76,26 +76,24 @@
 quick:
 	$(MAKE) target=UNIX \
 		CC=clang \
- 		opt='-DSYZYGY -DTEST -DTRACE -DCPUS=4' \
-		CFLAGS='-mpopcnt -Wall -Wno-array-bounds -pipe -O3' \
+		opt='$(opt) -DSYZYGY -DTEST -DTRACE' \
+		CFLAGS='$(CFLAGS) -Wall -Wno-array-bounds -pipe -O3' \
 		LDFLAGS='$(LDFLAGS) -lstdc++' \
 		crafty-make
 
 unix-gcc:
 	$(MAKE) -j target=UNIX \
 		CC=gcc \
-		opt='-DSYZYGY -DTEST -DCPUS=4' \
-		CFLAGS='-Wall -Wno-array-bounds -pipe -O3 -fprofile-use \
-		-mpopcnt -fprofile-correction -pthread' \
+		opt='$(opt) -DSYZYGY -DTEST' \
+		CFLAGS='$(CFLAGS) -Wall -Wno-array-bounds -pipe -O3 -fprofile-use -fprofile-correction -pthread' \
 		LDFLAGS='$(LDFLAGS) -fprofile-use -pthread -lstdc++' \
 		crafty-make
 
 unix-gcc-profile:
 	$(MAKE) -j target=UNIX \
 		CC=gcc \
-		opt='-DSYZYGY -DTEST -DCPUS=4' \
-		CFLAGS='-Wall -Wno-array-bounds -pipe -O3 -fprofile-arcs \
-		-mpopcnt -pthread' \
+		opt='$(opt) -DSYZYGY -DTEST' \
+		CFLAGS='$(CFLAGS) -Wall -Wno-array-bounds -pipe -O3 -fprofile-arcs -pthread' \
 		LDFLAGS='$(LDFLAGS) -fprofile-arcs -pthread -lstdc++ ' \
 		crafty-make
 
@@ -103,36 +101,32 @@
 	@/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/llvm-profdata merge -output=crafty.profdata *.profraw
 	$(MAKE) -j target=UNIX \
 		CC=clang \
-		opt='-DSYZYGY -DTEST -DCPUS=4' \
-		CFLAGS='-Wall -Wno-array-bounds -pipe -O3 \
-			-mpopcnt -fprofile-instr-use=crafty.profdata' \
+		opt='$(opt) -DSYZYGY -DTEST' \
+		CFLAGS='$(CFLAGS) -Wall -Wno-array-bounds -pipe -O3 -fprofile-instr-use=crafty.profdata' \
 		LDFLAGS='$(LDFLAGS) -fprofile-use -lstdc++' \
 		crafty-make
 
 unix-clang-profile:
 	$(MAKE) -j target=UNIX \
 		CC=clang \
-		opt='-DSYZYGY -DTEST -DCPUS=4' \
-		CFLAGS='-Wall -Wno-array-bounds -pipe -O3 \
-			-mpopcnt -fprofile-instr-generate' \
+		opt='$(opt) -DSYZYGY -DTEST' \
+		CFLAGS='$(CFLAGS) -Wall -Wno-array-bounds -pipe -O3 -fprofile-instr-generate' \
 		LDFLAGS='$(LDFLAGS) -fprofile-instr-generate -lstdc++ ' \
 		crafty-make
 
 unix-icc:
 	$(MAKE) -j target=UNIX \
 		CC=icc \
-		opt='-DSYZYGY -DTEST -DCPUS=4' \
-		CFLAGS='-Wall -w -O2 -prof_use -prof_dir ./prof -fno-alias \
-                        -mpopcnt -pthread' \
+		opt='$(opt) -DSYZYGY -DTEST' \
+		CFLAGS='$(CFLAGS) -Wall -w -O2 -prof_use -prof_dir ./prof -fno-alias -pthread' \
 		LDFLAGS='$(LDFLAGS) -pthread -lstdc++' \
 		crafty-make
 
 unix-icc-profile:
 	$(MAKE) -j target=UNIX \
 		CC=icc \
-		opt='-DSYZYGY -DTEST -DCPUS=4' \
-		CFLAGS='-Wall -w -O2 -prof_gen -prof_dir ./prof -fno-alias \
-                        -mpopcnt -pthread' \
+		opt='$(opt) -DSYZYGY -DTEST' \
+		CFLAGS='$(CFLAGS) -Wall -w -O2 -prof_gen -prof_dir ./prof -fno-alias -pthread' \
 		LDFLAGS='$(LDFLAGS) -pthread -lstdc++ ' \
 		crafty-make
 
@@ -145,14 +139,14 @@
 	@mkdir prof
 	@touch *.c *.h
 	$(MAKE) -j unix-clang-profile
-	@echo "#!/bin/csh" > runprof
-	@echo "./crafty <<EOF" >>runprof
-	@echo "bench" >>runprof
-	@echo "mt=0" >>runprof
-	@echo "quit" >>runprof
-	@echo "EOF" >>runprof
+	@echo "#!/bin/bash" > runprof
+	@echo "./crafty <<EOF" >> runprof
+	@echo "bench" >> runprof
+	@echo "mt=4" >> runprof
+	@echo "quit" >> runprof
+	@echo "EOF" >> runprof
 	@chmod +x runprof
-	@./runprof
+	@bash runprof
 	@rm runprof
 	@touch *.c *.h
 	$(MAKE) -j unix-clang