-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (45 loc) · 1.91 KB
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
build: setup
gcc -std=c99 -Wall -Wextra -pedantic -I./src/lib -o .bin/quillc src/bin/quillc.c src/lib/**/*.c
build-release: setup
gcc -std=c99 -O3 -Wall -Wextra -pedantic -I./src/lib -o .bin/quillc src/bin/quillc.c src/lib/**/*.c
test-lexer: setup
gcc -std=c99 -Wall -Wextra -pedantic -I./src/lib -o .bin/lexer_test tests/lexer.c src/lib/**/*.c
.bin/lexer_test
rm .bin/lexer_test
test: test-lexer
example-hello: clean build
mkdir -p ./.bin/tmp \
&& .bin/quillc ./examples/hello.ql -D=./.bin/tmp -lstd=./runtime/std/std.ql ./runtime/std/io.ql ./runtime/std/ds.ql ./runtime/std/conv.ql -llibc=./runtime/libc/stdlib.ql ./runtime/libc/stdio.ql ./runtime/libc/string.ql \
&& cd ./.bin \
&& gcc -std=c99 -o main -I./tmp ./tmp/*.c \
&& clear \
&& ./main \
&& cd ..
example-fizzbuzz: clean build
mkdir -p ./.bin/tmp \
&& .bin/quillc ./examples/fizzbuzz.ql -D=./.bin/tmp -lstd=./runtime/std/std.ql ./runtime/std/io.ql ./runtime/std/ds.ql ./runtime/std/conv.ql -llibc=./runtime/libc/stdlib.ql ./runtime/libc/stdio.ql ./runtime/libc/string.ql \
&& cd ./.bin \
&& gcc -std=c99 -o main -I./tmp ./tmp/*.c \
&& clear \
&& ./main 50 \
&& cd ..
example-fibonacci: clean build
mkdir -p ./.bin/tmp \
&& .bin/quillc ./examples/fibonacci.ql -D=./.bin/tmp -lstd=./runtime/std/std.ql ./runtime/std/io.ql ./runtime/std/ds.ql ./runtime/std/conv.ql -llibc=./runtime/libc/stdlib.ql ./runtime/libc/stdio.ql ./runtime/libc/string.ql \
&& cd ./.bin \
&& gcc -std=c99 -o main -I./tmp ./tmp/*.c \
&& clear \
&& ./main 50 \
&& cd ..
example-defer: clean build
mkdir -p ./.bin/tmp \
&& .bin/quillc ./examples/defer.ql -D=./.bin/tmp -lstd=./runtime/std/std.ql ./runtime/std/io.ql ./runtime/std/ds.ql ./runtime/std/conv.ql -llibc=./runtime/libc/stdlib.ql ./runtime/libc/stdio.ql ./runtime/libc/string.ql \
&& cd ./.bin \
&& gcc -std=c99 -o main -I./tmp ./tmp/*.c \
&& clear \
&& ./main \
&& cd ..
setup:
mkdir -p ./.bin
clean:
rm -rf ./.bin