From 49bc31720ab6206980cda95a0a30a44e7f882fcc Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 2 Jun 2026 21:28:39 +0530 Subject: Clean up the c stuff and switch to simple bash + add example --- justfile | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'justfile') diff --git a/justfile b/justfile index cb79843..11043e7 100644 --- a/justfile +++ b/justfile @@ -1,27 +1,14 @@ -set export +setup: setup-db -CC := "cc" -CFLAGS := f"-std=c11 -O2 \ --Wall -Wextra -Wshadow -Wformat=2 -fsanitize=address,undefined \ -{{shell('pkg-config --cflags --libs sqlite3')}}" -OUTDIR := "build" +run file *args: setup-db + sqlite3 fun.db {{args}} < {{file}} -build: compile-flags - mkdir -p "{{OUTDIR}}" - {{CC}} {{CFLAGS}} src/*.c -o "{{OUTDIR}}/sqlheavy" +image image_id: + ./image.sh {{image_id}} | magick display -resize 500% - -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 +repl *args: + rlwrap sqlite3 fun.db {{args}} setup-db: rm fun.db sqlite3 fun.db < setup.sql - -image: - just run | magick display -resize 500% - -- cgit v1.3.1