aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-12 23:07:37 +0100
committerMattias Andrée <maandree@kth.se>2016-03-12 23:07:37 +0100
commita035fc10768bf48d096a33d0748e679e5a3e2540 (patch)
treec31f6b4433c3a4713f47f32a295380e40c34f7a3 /Makefile
parent64 bits (severely) outshines 16 bits and 8 bits in performance: do some cleanup (diff)
downloadlibzahl-a035fc10768bf48d096a33d0748e679e5a3e2540.tar.gz
libzahl-a035fc10768bf48d096a33d0748e679e5a3e2540.tar.bz2
libzahl-a035fc10768bf48d096a33d0748e679e5a3e2540.tar.xz
Add possibility to compare against libtommath
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5a42f89..19d3e1d 100644
--- a/Makefile
+++ b/Makefile
@@ -82,8 +82,16 @@ test-random.c: test-generate.py
test: test.c libzahl.a test-random.c
$(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -o $@ test.c libzahl.a
+ifndef BENCHMARK_LIB
benchmark: bench/benchmark.c libzahl.a
$(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -o $@ $^
+endif
+ifdef BENCHMARK_LIB
+CPPFLAGS += -DBENCHMARK_LIB='"$(BENCHMARK_LIB).h"'
+BENCHMARK_libtommath = -ltommath
+benchmark: bench/benchmark.c bench/$(BENCHMARK_LIB).h
+ $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -o $@ bench/benchmark.c $(BENCHMARK_$(BENCHMARK_LIB))
+endif
check: test
./test