-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
66 lines (47 loc) · 1.7 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
56
57
58
59
60
61
62
63
64
65
66
ANALYSIS = obj/lex.yy.o obj/parser.o obj/util.o obj/memory.o obj/analyze.o obj/symtab.o
SYNTHESIS = obj/codegenerator.o obj/syntaticErrors.o obj/instructions.o obj/library.o obj/mifgenerator.o
HELPER = obj/bytes.o
PRODUCTION = obj/binarygenerator.o obj/linker.o
CC = g++
FLAGS = -Wall -g -std=c++11
cminus: $(ANALYSIS) $(SYNTHESIS) $(HELPER) $(PRODUCTION)
$(CC) $(FLAGS) -o bin/cminus obj/* main.cc -ly -lfl
lex.yy.c: scanner.l
flex scanner.l
obj/lex.yy.o: lex.yy.c cminus.tab.c
mkdir -p obj
$(CC) $(FLAGS) -c lex.yy.c -o obj/lex.yy.o
obj/util.o: util.cc
$(CC) $(FLAGS) -c util.cc -o obj/util.o
cminus.tab.c: cminus.y
bison -d cminus.y
obj/parser.o: cminus.tab.c
$(CC) $(FLAGS) -c cminus.tab.c -o obj/parser.o
obj/codegenerator.o: codegenerator.cc
$(CC) $(FLAGS) -c codegenerator.cc -o obj/codegenerator.o
obj/instructions.o: instructions.cc
$(CC) $(FLAGS) -c instructions.cc -o obj/instructions.o
obj/memory.o: memory.cc
$(CC) $(FLAGS) -c memory.cc -o obj/memory.o
obj/analyze.o: analyze.cc
$(CC) $(FLAGS) -c analyze.cc -o obj/analyze.o
obj/syntaticErrors.o: syntaticErrors.cc
$(CC) $(FLAGS) -c syntaticErrors.cc -o obj/syntaticErrors.o
obj/symtab.o: symtab.cc
$(CC) $(FLAGS) -c symtab.cc -o obj/symtab.o
obj/library.o: library.cc
$(CC) $(FLAGS) -c library.cc -o obj/library.o
obj/mifgenerator.o: mifgenerator.cc
$(CC) $(FLAGS) -c mifgenerator.cc -o obj/mifgenerator.o
obj/binarygenerator.o: binarygenerator.cc
$(CC) $(FLAGS) -c binarygenerator.cc -o obj/binarygenerator.o
obj/linker.o: linker.cc
$(CC) $(FLAGS) -c linker.cc -o obj/linker.o
obj/bytes.o: bytes.cc
$(CC) $(FLAGS) -c bytes.cc -o obj/bytes.o
view:
dot -Tps calc.dot -o graph.ps; evince graph.ps
clean:
rm -rf obj
rm *.yy.*
rm *.tab.*