summaryrefslogtreecommitdiff
path: root/Makefile
blob: dae78e5327771f97db101b3c7b67da9072e56ae5 (plain) (blame)
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
CFLAGS = -g -Wall -Wextra
check: check-vec check-sptree check-map

# see scripts/coverage for coverage testing

check-vec:
	mkdir -p build
	$(CC) $(CFLAGS) $(COVERAGEFLAGS) \
		-Iinclude -Ideps/covsrv/include \
		deps/covsrv/src/client.c tests/vec.c -o build/vec
	./scripts/run-test ./build/vec

check-sptree:
	mkdir -p build
	$(CC) $(CFLAGS) $(COVERAGEFLAGS) \
		-Iinclude -Ideps/covsrv/include \
		deps/covsrv/src/client.c tests/sptree.c -o build/sptree
	./scripts/run-test ./build/sptree

check-map:
	mkdir -p build
	$(CC) $(CFLAGS) $(COVERAGEFLAGS) \
		-Iinclude -Ideps/covsrv/include \
		deps/covsrv/src/client.c tests/map.c -o build/map
	./scripts/run-test ./build/map

bench: bench-vec bench-sptree bench-map

bench-vec:
	mkdir -p build
	$(CC) $(CFLAGS) -O2 -Iinclude tests/vec.c -o build/vec_opt
	time ./build/vec_opt 2> build/vec_bench.txt

bench-sptree:
	mkdir -p build
	$(CC) $(CFLAGS) -O2 -Iinclude tests/sptree.c -o build/sptree_opt
	time ./build/sptree_opt 2> build/sptree_bench.txt

bench-map:
	mkdir -p build
	$(CC) $(CFLAGS) -O2 -Iinclude tests/map.c -o build/map_opt
	time ./build/map_opt 2> build/map_bench.txt

clean:
	rm -rf build