This repository has been archived by the owner on Mar 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (48 loc) · 1.79 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
all: compile
N_PROC := $(shell nproc)
build_dir:
@if [ ! -d "./build" ];then \
cmake -S . -B ./build -Wdev -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D CMAKE_CXX_COMPILER=g++ ; \
fi
@if [ -f ./build/compile_commands.json ]; then \
mv ./build/compile_commands.json ./src/ ; \
fi
check:
cpplint --verbose=2 --linelength=150 --filter=-legal/copyright ./src/*
cppcheck --enable=all ./src
compile: build_dir
cmake --build ./build --parallel $(N_PROC) -- --no-print-directory
clean: build_dir
@$(RM) analysis gmon.out
@cd ./build && make clean --no-print-directory
really_clean:
@$(RM) -rf build/
test: compile
cmake --build ./build --target test --parallel $(N_PROC) -- --no-print-directory ARGS=-V
coverage: compile test
cmake --build ./build --target coverage --parallel $(N_PROC) -- --no-print-directory
@rm -rf ./build/html
genhtml --output-directory ./build/html ./build/challenger.info
optimized: build_dir
cmake --build ./build --target optimized --parallel $(N_PROC) -- --no-print-directory
windows: build_dir
cmake --build ./build --target windows_challenger --parallel $(N_PROC) -- --no-print-directory
benchmark: build_dir
cmake --build ./build --target benchmark --parallel $(N_PROC) -- --no-print-directory
./build/benchmark_challenger >> benchmarking_reference
perft: build_dir
cmake --build ./build --target perft --parallel $(N_PROC) -- --no-print-directory
profile: compile
@if [ -f "./gmon.out" ]; then \
$(RM) "./gmon.out"; \
fi
@echo "position startpos\ngo depth 7\nquit" > tmp_input_challenger
@./build/challenger < tmp_input_challenger
@$(RM) tmp_input_challenger
gprof -b ./build/challenger gmon.out > tmp_analysis
@echo " " >> analysis
@echo " " >> analysis
@echo " " >> analysis
@echo " " >> analysis
@echo " " >> analysis
head -n 30 tmp_analysis >> analysis