-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (42 loc) · 1.29 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
55
tests = shell shell.c readfile readfile.c average average.c fib fib.c minmax minmax.c vector vector.c myname myname.c hellofile hellofile.c
obj_files = obj/tiny.o obj/lexer.o obj/parser.o obj/emitter.o obj/util.o
all: build
build: objects
cc -o tiny $(obj_files) -ggdb
tests: objects
cc -o tiny $(obj_files) -ggdb
./tiny tests/average.bas average.c
./tiny tests/fibonacci.bas fib.c
./tiny tests/minmax.bas minmax.c
./tiny tests/vector.bas vector.c
./tiny tests/myname.bas myname.c
./tiny tests/hellofile.bas hellofile.c
./tiny tests/shell.bas shell.c
./tiny tests/readfile.bas readfile.c
cc -o average average.c
cc -o fib fib.c
cc -o vector vector.c
cc -o minmax minmax.c
cc -o myname myname.c
cc -o hellofile hellofile.c
cc -o shell shell.c
cc -o readfile readfile.c
objects: lexer.o parser.o emitter.o tiny.o util.o
mkdir obj
mv *.o obj
tiny.o: src/tiny.c src/util.c inc/tiny.h
cc -c src/util.c src/tiny.c -ggdb
emitter.o: src/emitter.c inc/tiny.h
cc -c src/emitter.c -ggdb
parser.o: src/parser.c src/util.c inc/tiny.h
cc -c src/util.c src/parser.c -ggdb
lexer.o: src/lexer.c src/util.c inc/tiny.h
cc -c src/util.c src/lexer.c -ggdb
freeprint.o: src/util.c inc/tiny.h
cc -c src/util.c -ggdb
clean-build:
rm -rf obj tiny
clean-tests:
rm /$(tests)
clean:
rm -rf obj tiny $(tests)