-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
25 lines (19 loc) · 925 Bytes
/
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
CFLAGS = -Wall -Wextra -pedantic -Wswitch-enum -fshort-enums -std=c11
# https://stackoverflow.com/questions/12824134/undefined-reference-to-pow-in-c-despite-including-math-h
LFLAGS = -lm
setup-build-dirs:
@mkdir bin bin/tests bin/logs
tests-vm: src/vm/test-cases.c
$(CC) $(CFLAGS) src/vm/test-cases.c -o bin/tests/test-tsvm $(LFLAGS)
vm: src/vm/main.c
$(CC) $(CFLAGS) src/vm/main.c -o bin/tsvm $(LFLAGS)
tests-assembler: src/assembler/test-cases.c
$(CC) $(CFLAGS) src/assembler/test-cases.c -o bin/tests/test-tsassembler $(LFLAGS)
assembler: src/assembler/assembler.c
$(CC) $(CFLAGS) src/assembler/main.c -o bin/tsassembler $(LFLAGS)
run-vm: tests-vm vm
./bin/tests/test-tsvm > ./bin/logs/vm-tests.log
./bin/tsvm ./samples/bin/push10-push5-plus.vmp
run-assembler: tests-assembler assembler
./bin/tests/test-tsassembler > ./bin/logs/assembler-tests.log
./bin/tsassembler ./samples/asm/push10-push5-plus.tsasm