-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (51 loc) · 1.68 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
#Add javacc binaries to the path
PATH := $(PATH):../javacc-5.0/bin
JJTREE=jjtree
JAVACC=javacc
JJDOC=jjdoc
JAVAC=javac
GRAMMAR=java1_7
MODELS=$(notdir $(wildcard src/com/namal/reing/models/*.java))
MODELS_CLASS=$(patsubst %.java,%.class,$(MODELS))
VISITOR=$(notdir $(wildcard src/com/namal/reing/visitors/*.java))
VISITOR_CLASS=$(patsubst %.java,%.class,$(VISITOR))
UTILS=$(notdir $(wildcard src/com/namal/reing/utils/*.java))
UTILS_CLASS=$(patsubst %.java,%.class,$(UTILS))
OUPUTJ=$(notdir $(wildcard src/com/namal/reing/output/*.java))
OUPUT_CLASS=$(patsubst %.java,%.class,$(OUPUTJ))
OUTPUT=target/com/namal/reing
.PHONY: compile clean mrproper
compile: clean
mkdir -p target
mkdir -p target/com
mkdir -p target/com/namal
mkdir -p $(OUTPUT)
mkdir -p $(OUTPUT)/models
mkdir -p $(OUTPUT)/visitors
mkdir -p $(OUTPUT)/utils
mkdir -p $(OUTPUT)/output
mkdir -p graphs
$(JJTREE) $(GRAMMAR).jjt
$(JAVACC) $(GRAMMAR).jj
$(JJDOC) $(GRAMMAR).jj
ls *.java | xargs -I{} cp {} src/com/namal/reing
#cp -rf visitors/*.java .
#cp -rf src/models/*.java .
#cp -rf src/output/*.java .
find src/ -name "*.java" | xargs -I{} cp {} .
$(JAVAC) *.java
mv $(MODELS) $(MODELS_CLASS) $(OUTPUT)/models
mv $(VISITOR) $(VISITOR_CLASS) $(OUTPUT)/visitors
mv $(UTILS) $(UTILS_CLASS) $(OUTPUT)/utils
mv $(OUTPUTJ) $(OUPUT_CLASS) $(OUTPUT)/output
mv *.java *.class $(OUTPUT)
test: compile
java -cp target com.namal.reing.JavaParser1_7 @examples/filelist.txt
project: compile
java -cp target com.namal.reing.JavaParser1_7 @projects/zest-java.txt
wordcount: compile
java -cp target com.namal.reing.JavaParser1_7 examples/WordCount.java
clean:
rm -rf com *.java *.class graphs/
mrproper: clean
rm -rf *~ $(GRAMMAR).html