aboutsummaryrefslogtreecommitdiff
path: root/justfile
diff options
context:
space:
mode:
Diffstat (limited to 'justfile')
-rw-r--r--justfile21
1 files changed, 21 insertions, 0 deletions
diff --git a/justfile b/justfile
new file mode 100644
index 0000000..6c0f728
--- /dev/null
+++ b/justfile
@@ -0,0 +1,21 @@
+set export
+
+CC := "gcc"
+CFLAGS := f"-std=c11 -O2 \
+-Wall -Wextra -Wshadow -Wformat=2 -fsanitize=address,undefined \
+{{shell('pkg-config --cflags --libs sqlite3')}}"
+OUTDIR := "build"
+
+build: compile-flags
+ mkdir -p "{{OUTDIR}}"
+ {{CC}} {{CFLAGS}} src/*.c -o "{{OUTDIR}}/sqlheavy"
+
+run: build
+ "./{{OUTDIR}}/sqlheavy"
+
+@compile-flags:
+ echo '{{CFLAGS}}' | tr ' ' '\n' > ./compile_flags.txt
+
+format:
+ find src/ -iname '*.h' -o -iname '*.c' | xargs clang-format -i
+