-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (46 loc) · 1.8 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
__build_name = main
__test_name = test
__bench_name = bench
__graph_name = graph_bench
__grind_name = grind
default:
@echo "This is Make for Iridium."
@echo "Build profiles supported are:"
@echo "make build - compile the main game."
@echo "make test - compile and run tests on all components."
@echo "make bench - compile and run a benchmark with text readout."
@echo "make graph - compile and run a benchmark and generate a callgraph."
build:
g++ -std=c++2a -Ofast -Wall -Wextra -Werror -Wpedantic src/main.cpp -o target/$(__build_name)
# test:
# g++ -std=c++2a -Ofast -Wall -Wextra -Werror -Wpedantic src/test.cpp -o target/$(__test_name)
# ./$(__test_name)
bench:
@echo "Running benchmark..."
g++ -std=c++2a -Ofast -Wall -Wextra -Werror -Wpedantic src/UTTTbench.cpp -o target/UTTT$(__bench_name)
g++ -std=c++2a -Ofast -Wall -Wextra -Werror -Wpedantic src/C4bench.cpp -o target/C4$(__bench_name)
g++ -std=c++2a -Ofast -Wall -Wextra -Werror -Wpedantic src/gomokubench.cpp -o target/gomoku$(__bench_name)
./target/UTTT$(__bench_name) 500 5000
./target/C4$(__bench_name) 500 5000
./target/gomoku$(__bench_name) 500 5000
grind:
g++ -std=c++2a -ggdb3 -Wall -Wextra -Werror -Wpedantic src/main.cpp -o target/$(__grind_name)
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=valgrind-out.txt \
./target/grind
graph_bench:
@echo "Running callgraph benchmark..."
g++ -std=c++2a -pg -Wall -Wextra -Werror -Wpedantic src/gomokubench.cpp -o target/$(__graph_name)
./target/$(__graph_name) 100 5000
gprof ./target/$(__graph_name) | gprof2dot -s | dot -Tpng -o graph_bench.png
clean:
rm -f target/$(__build_name)
rm -f target/$(__test_name)
rm -f target/$(__bench_name)
rm -f target/$(__graph_name)
rm -f target/$(__grind_name)
rm -f gmon.out
rm -f graph_bench.png