From 1f57645d9550e486a5bc209a0652bfad7fb8872a Mon Sep 17 00:00:00 2001
From: Kimplul <kimi.h.kuparinen@gmail.com>
Date: Sun, 27 Oct 2024 21:57:02 +0200
Subject: add map

---
 Makefile | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

(limited to 'Makefile')

diff --git a/Makefile b/Makefile
index 48e8cb8..ff1eea3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,37 @@
-check:
+CFLAGS = -g -std=c23 -Wall -Wextra
+check: check-vec check-sptree check-map
+
+check-vec:
 	mkdir -p build
-	$(CC) -g -Iinclude tests/vec.c -o build/vec
-	$(CC) -g -Iinclude tests/htrie.c -o build/htrie
+	$(CC) $(CFLAGS) -Iinclude tests/vec.c -o build/vec
 	valgrind -q --error-exitcode=1 ./build/vec
-	valgrind -q --error-exitcode=1 ./build/htrie
 
-bench:
+check-sptree:
+	mkdir -p build
+	$(CC) $(CFLAGS) -Iinclude tests/sptree.c -o build/sptree
+	valgrind -q --error-exitcode=1 ./build/sptree
+
+check-map:
+	mkdir -p build
+	$(CC) $(CFLAGS) -Iinclude tests/map.c -o build/map
+	valgrind -q --error-exitcode=1 ./build/map
+
+bench: bench-vec bench-sptree bench-map
+
+bench-vec:
 	mkdir -p build
-	$(CC) -g -O2 -Iinclude tests/vec.c -o build/vec_opt
-	$(CC) -g -O2 -Iinclude tests/htrie.c -o build/htrie_opt
+	$(CC) $(CFLAGS) -O2 -Iinclude tests/vec.c -o build/vec_opt
 	time ./build/vec_opt 2> build/vec_bench.txt
-	time ./build/htrie_opt 2> build/htrie_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
-- 
cgit v1.2.3