summaryrefslogtreecommitdiff
path: root/.justfile
blob: 188e852cce1b35d5fba3e578b058cce5b2f6f8fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
src := "src/main.c3"
bin := "build/csh"

default:
    @just --list

tangle:
    emacs -Q --batch --eval "(require 'org)" --eval '(org-babel-tangle-file "README.org")'

run: tangle _prep
    c3c compile-run {{src}} -o {{bin}}

build: tangle _prep
    c3c compile {{src}} -O0 -g -o {{bin}}

release: tangle _prep
    c3c compile {{src}} -O5 -o {{bin}}

asan: tangle _prep
    c3c compile-run {{src}} -O0 -g --sanitize=address -o {{bin}}

tsan: tangle _prep
    c3c compile-run {{src}} -O0 -g --sanitize=thread -o {{bin}}

example name: tangle _prep
    c3c compile-run src/{{name}}.c3 -o build/{{name}}

valgrind: build
    valgrind --leak-check=full --error-exitcode=1 ./{{bin}}

clean:
    rm -rf build src

_prep:
    @mkdir -p build