summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 22:40:55 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 22:40:55 +0100
commit5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda (patch)
tree1acdfa5220cd13b7be43a2a01368e80d306473ca /Makefile
parentc7ab12bba64d9c20ccd79b132dac475f7bc3923e (diff)
downloadcrep-5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda.tar.gz
Add Redis source code for testing
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 54dcd92..6d732c2 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ TARGET = crep
SOURCES = $(wildcard *.c *.h)
TS_ALIBS = $(shell find vendor -name "*.a" -print)
VENDOR_DIRS = $(wildcard vendor/*)
-CFLAGS = $(EXTRA_FLAGS) -Wall -Wextra -std=gnu99 -pedantic -ggdb -O3
+CFLAGS = $(EXTRA_FLAGS) -Wall -Wextra -std=gnu99 -pedantic -O3
LIBS = -I./vendor/tree-sitter/lib/include -lpthread
$(info VENDOR_DIRS: $(VENDOR_DIRS))
@@ -14,23 +14,27 @@ $(info LIBS: $(LIBS))
$(TARGET):
$(CC) $(CFLAGS) $(SOURCES) $(LIBS) -o $(TARGET) $(TS_ALIBS)
+all: ts-build query $(TARGET)
+
+query:
+ xxd -i -n query_c queries/c.scm > queries/c.h
+ xxd -i -n query_python queries/python.scm > queries/python.h
+
ts-build:
-cd vendor/tree-sitter && make -B
-cd vendor/tree-sitter-c && make -B
-cd vendor/tree-sitter-python && make -B
- # -cd vendor/tree-sitter-json && make -B
ts-clean:
-cd vendor/tree-sitter && make clean
-cd vendor/tree-sitter-c && make clean
-cd vendor/tree-sitter-python && make clean
- -cd vendor/tree-sitter-json && make clean
valgrind:
valgrind -s --leak-check=full ./$(TARGET)
format:
- clang-format -i --style=Chromium *.c *.h
+ clang-format -i *.c *.h
clean:
rm -f *.o $(TARGET) callgrind.out.*