-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (65 loc) · 2.46 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
JAVA=java
JAVAC=javac
JFLEX=$(JAVA) -jar jflex-1.8.2/lib/jflex-full-1.8.2.jar
CUPJAR=./java-cup-11b.jar
CUP=$(JAVA) -jar $(CUPJAR)
CP=.:$(CUPJAR)
MYDIR = .
default: run
.SUFFIXES: $(SUFFIXES) .class .java
.java.class:
$(JAVAC) -cp $(CP) $*.java
# FILE= Lexer.java parser.java sym.java \
# LexerTest.java
FILE = Lexer.java parser.java sym.java \
ParserTest.java TypeCheckingTest.java\
SuperToken.java SymbolTable.java VarType.java\
Program.java Memberdecls.java Fielddecls.java \
Methoddecls.java Fielddecl.java Methoddecl.java \
Argdecls.java ArgdeclList.java Argdecl.java \
Stmts.java Stmt.java Name.java \
Args.java Readlist.java Printlist.java \
Printlinelist.java Expr.java BinaryOp.java Token.java
run: list
list: all
rm -rf ./test-results/results.txt;
for file in ./p3TestsCorrected/*.as ; do \
echo "Processing" $${file} >> ./test-results/results.txt; \
echo "Processing" $${file}; \
$(JAVA) -cp $(CP) TypeCheckingTest $$file >> ./test-results/results.txt; \
echo "\n" >> ./test-results/results.txt; \
done; \
cat -n ./test-results/results.txt;
typeCheckTest.as: all
$(JAVA) -cp $(CP) TypeCheckingTest ./p3TestsCorrected/testFile.as > ./test-results/testFile-output.txt
cat -n ./test-results/testFile-output.txt
myTest.as: all
$(JAVA) -cp $(CP) TypeCheckingTest ./p3TestsCorrected/testFile.as > ./test-results/testFile-output.txt
cat -n ./test-results/testFile-output.txt
test1.as: all
$(JAVA) -cp $(CP) ParserTest ./tests/test1.as > ./test-results/output1.txt
cat -n ./test-results/output1.txt
test2.as: all
$(JAVA) -cp $(CP) ParserTest ./tests/test2.as > ./test-results/output2.txt
cat -n ./test-results/output2.txt
test3.as: all
$(JAVA) -cp $(CP) ParserTest ./tests/test3.as > ./test-results/output3.txt
cat -n ./test-results/output3.txt
test4.as: all
$(JAVA) -cp $(CP) ParserTest ./tests/test4.as > ./test-results/output4.txt
cat -n ./test-results/output4.txt
test5.as: all
$(JAVA) -cp $(CP) ParserTest ./tests/test5.as > ./test-results/output5.txt
cat -n ./test-results/output5.txt
testFile: all
$(JAVA) -cp $(CP) LexerTest basicRegex.txt > testFile-output.txt
cat -n testFile-output.txt
all: Lexer.java parser.java $(FILE:java=class)
clean:
rm -f *.class *~ *.bak Lexer.java parser.java sym.java
Lexer.java: grammar.jflex
$(JFLEX) grammar.jflex
parser.java: tokens.cup
$(CUP) -interface < tokens.cup
parserD.java: tokens.cup
$(CUP) -interface -dump < tokens.cup