From 0a5a45ff8ae437ddf1c3b8de425f30a44e6f5580 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 26 Aug 2018 23:16:00 +0200 Subject: Add benchmarks --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e397515..ed93b0a 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,7 @@ endif # DEBUG HEADERS = $(wildcard chilbert/*.hpp) $(wildcard chilbert/*.ipp) DETAIL_HEADERS = $(wildcard chilbert/detail/*.hpp) TESTS = test/test_bitvec test/test_gray_code_rank test/test_hilbert +BENCHMARKS = test/bench_bitvec test/bench_hilbert PROGS = bin/chilbert_obj bin/chilbert_svg ALL_HEADERS = $(HEADERS) $(DETAIL_HEADERS) @@ -49,6 +50,8 @@ all: $(PROGS) tests: $(TESTS) +benchmarks: $(BENCHMARKS) + test/%: test/%.cpp $(ALL_HEADERS) $(CXX) $(CXXFLAGS) -o $@ $@.cpp @@ -66,12 +69,18 @@ bin/%: bin/%.cpp $(ALL_HEADERS) FORCE: clean: - rm -f $(TESTS) $(PROGS) + rm -f $(PROGS) $(TESTS) $(BENCHMARKS) -%.run: tests +%.run: $* -test: $(addsuffix .run, $(TESTS)) FORCE +test: tests $(addsuffix .run, $(TESTS)) FORCE + +bench: $(BENCHMARKS) + mkdir -p benchmarks + cd benchmarks && ../test/bench_bitvec + cd benchmarks && ../test/bench_hilbert + cd benchmarks && ./plot.py install: FORCE install -d $(DESTDIR)$(includedir)/chilbert/ -- cgit v1.2.1