aboutsummaryrefslogtreecommitdiff
path: root/justfile
blob: 6c0f72852417dbd4ee5931616bb78479c0d14e55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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