blob: 494bd759dbca3b27c8c270146a163892a3009e5a (
plain) (
blame)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
ASSN = 2
CLASS= cs143
CLASSDIR= /usr/class/cs143/cool
LIB= /lib/x86_64-linux-gnu/libfl.a
SRC= cool.flex test.cl README
CSRC= lextest.cc utilities.cc stringtab.cc handle_flags.cc
TSRC= mycoolc
HSRC=
CGEN= cool-lex.cc
HGEN=
LIBS= parser semant cgen
CFIL= ${CSRC} ${CGEN}
LSRC= Makefile
OBJS= ${CFIL:.cc=.o}
OUTPUT= test.output
CPPINCLUDE= -I. -I${CLASSDIR}/include/PA${ASSN} -I${CLASSDIR}/src/PA${ASSN}
FFLAGS= -d -ocool-lex.cc
CC=g++
CFLAGS= -g -Wall -Wno-unused -Wno-write-strings ${CPPINCLUDE}
FLEX=flex ${FFLAGS}
DEPEND = ${CC} -MM ${CPPINCLUDE}
source : ${SRC} ${TSRC} ${LSRC} ${LIBS} lsource
lsource: ${LSRC}
${OUTPUT}: lexer test.cl
@rm -f test.output
-./lexer test.cl >test.output 2>&1
lexer: ${OBJS}
${CC} ${CFLAGS} ${OBJS} ${LIB} -o lexer
.cc.o:
${CC} ${CFLAGS} -c $<
cool-lex.cc: cool.flex
${FLEX} cool.flex
dotest: lexer test.cl
./lexer test.cl
${LIBS}:
${CLASSDIR}/etc/link-object ${ASSN} $@
# These dependencies allow you to get the starting files for
# the assignment. They will not overwrite a file you already have.
${SRC} :
${CLASSDIR}/etc/copy-skel ${ASSN} ${SRC}
${LSRC} :
${CLASSDIR}/etc/link-shared ${ASSN} ${LSRC}
${TSRC} ${CSRC}:
-ln -s ${CLASSDIR}/src/PA${ASSN}/$@ $@
${HSRC}:
-ln -s ${CLASSDIR}/include/PA${ASSN}/$@ $@
submit-clean: ${OUTPUT}
-rm -f *.s core ${OBJS} lexer cool-lex.cc *~ parser cgen semant
clean :
-rm -f ${OUTPUT} *.s core ${OBJS} lexer cool-lex.cc *~ parser cgen semant
clean-compile:
@-rm -f core ${OBJS} cool-lex.cc ${LSRC}
%.d: %.cc ${SRC} ${LSRC}
${SHELL} -ec '${DEPEND} $< | sed '\''s/\($*\.o\)[ :]*/\1 $@ : /g'\'' > $@'
-include ${CFIL:.cc=.d}
|