-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (34 loc) · 1001 Bytes
/
Makefile
File metadata and controls
56 lines (34 loc) · 1001 Bytes
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
55
56
FLAGS=-Wall -std=gnu99
# PRODUCTION_FLAGS=
CFLAGS=-g $(FLAGS)
# note: bytecode_parser.o has been discontinued
Modules = list.o object.o vm.o utils.o stdlib.o map.o ast_nodes.o bytecodes.o \
err.o grammar.tab.o lex.yy.o
Tests = test/parser_test.o
all: main
vm.o: list.o map.o debug.h object.o bytecodes.o
utils.o: debug.h
bytecodes.o: list.o
ast_nodes.o: list.o vm.o
object.o: vm.o
# parser files -> .c files
grammar.tab.h grammar.tab.c: grammar.y
bison -d grammar.y
lex.yy.c: lexer.l grammar.tab.h
flex lexer.l
# parser.c files -> .o files
grammar.tab.o: grammar.tab.c
gcc grammar.tab.c -lfl -lm -c
lex.yy.o: lex.yy.c
gcc lex.yy.c -lfl -lm -c
main: $(Modules) main.c grammar.tab.c lex.yy.c
gcc $(CFLAGS) main.c $(Modules) -lm -o main -lfl -lm
test/test: $(Modules)
clean:
rm -f cream main $(Modules)
dist: $(Modules) main.c
gcc -o cream $(FLAGS) -lfl -lm -Ofast -DNDEBUG $(Modules) main.c
# DERPS are meant for testing
derp/object_derp: object.o
test: main
./test.sh