-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (45 loc) · 1.56 KB
/
Makefile
File metadata and controls
62 lines (45 loc) · 1.56 KB
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
.PHONY: test
ifndef VERBOSE
.SILENT:
endif
SHARED_PATH := "common"
clean:
rm -rf out
############## Testing ##############
TEST_CPP_FILES := $(shell find tests -iname "*.cpp" | sort)
test: out/test
./out/test
out/test: *.h $(shell find tests -iname "*.h") $(shell find tests -iname "*.cpp")
echo "building tests: ${TEST_CPP_FILES}"
mkdir -p out
g++ -std=c++11 -Wall -Wextra -Wfatal-errors -O0 \
-Wpedantic -pedantic-errors \
"${SHARED_PATH}/test/main.cpp" -I "${SHARED_PATH}" \
-I tests/ ${TEST_CPP_FILES} \
-o out/test
############## Benchmarking ##############
graphs:
python benchmark/graphs.py
benchmarks: test benchmark-main benchmark-kissfft benchmark-fftw graphs
BENCHMARK_TEST_TIME := 0.05
# Generic versions
benchmark-%: out/benchmark-%
mkdir -p out/results
cd out && ./benchmark-$* --test-time=${BENCHMARK_TEST_TIME}
out/benchmark-%: *.h $(shell find benchmark -iname "*.h") $(shell find benchmark -iname "*.cpp")
mkdir -p out
g++ -std=c++11 -msse2 -mavx -Wfatal-errors -O3 \
"${SHARED_PATH}/test/main.cpp" -I "${SHARED_PATH}" \
-I benchmark/ benchmark/$*.cpp \
-o out/benchmark-$*
# Custom versions which need more config
out/benchmark-fftw: $(shell find benchmark -iname "*.h") $(shell find benchmark -iname "*.cpp")
mkdir -p out
g++ -std=c++11 -msse2 -mavx -Wfatal-errors -g -O3 \
"${SHARED_PATH}/test/main.cpp" -I "${SHARED_PATH}" \
-I benchmark/ benchmark/fftw.cpp \
-lfftw3 \
-o out/benchmark-fftw
############## Development ##############
# After an initial "make benchmark", you can continue
dev: test benchmark-main graphs