-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (32 loc) · 951 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
CC = g++
CCFLAGS = -g -W -Wall
FLEX = flex
FLEX_OPTS = -PCalc
BISON = bison
BISON_OPTS = -t -pCalc
OBJS = Absyn.o Lexer.o Parser.o Printer.o ByteCode.o Skeleton.o
.PHONY: clean distclean
all: TestCalc
clean:
rm -f *.o TestCalc Calc.aux Calc.log Calc.pdf Calc.dvi Calc.ps Calc
TestCalc: ${OBJS} Test.o
@echo "Linking TestCalc..."
${CC} ${CCFLAGS} ${OBJS} Test.o -o TestCalc
Absyn.o: Absyn.C Absyn.H
${CC} ${CCFLAGS} -c Absyn.C
ByteCode.o: ByteCode.C ByteCode.H
${CC} ${CCFLAGS} -c ByteCode.C
Lexer.C: Calc.l
${FLEX} -oLexer.C Calc.l
Parser.C: Calc.y
${BISON} Calc.y -o Parser.C
Lexer.o: Lexer.C Parser.H
${CC} ${CCFLAGS} -c Lexer.C
Parser.o: Parser.C Absyn.H
${CC} ${CCFLAGS} -c Parser.C
Printer.o: Printer.C Printer.H Absyn.H
${CC} ${CCFLAGS} -c Printer.C
Skeleton.o: Skeleton.C Skeleton.H Absyn.H ByteCode.H
${CC} ${CCFLAGS} -c Skeleton.C
Test.o: Test.C Parser.H Printer.H Absyn.H Skeleton.H
${CC} ${CCFLAGS} -c Test.C