-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
72 lines (55 loc) · 1.51 KB
/
makefile
File metadata and controls
72 lines (55 loc) · 1.51 KB
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
# Java Makefile
# Reference: http://www.voidcn.com/article/p-hkdryezy-ob.html
# Project Structure
# Makefile
# READMEP1
# /src
# /*.java
# /target
# /*.class
# set the entry of the java application
ENTRY_POINT = part2Eval/LispApp
# set your source file name
SOURCE_FILES = \
part1Scan/exception/LispException.java \
part1Scan/exception/InvalidSexpException.java \
part1Scan/exception/IncompletenessException.java \
part1Scan/exception/EvaluationException.java \
part1Scan/enums/PrimitiveEnum.java \
part1Scan/enums/RunStateEnum.java \
part1Scan/enums/SexpTypeEnum.java \
part1Scan/TokenHandler.java \
part1Scan/Sexp.java \
part1Scan/utils/SexpUtil.java \
part1Scan/utils/SymTableUtil.java \
part1Scan/Parser.java \
part2Eval/Evaluator.java \
part2Eval/LispApp.java \
# set file path related to the makefie location
TARGET = target
SOURCE = src
# set your java compiler:
JAVAC = javac
# set compiler option
ENCODING = -encoding UTF-8
JFLAGS = $(ENCODING)
vpath %.class $(TARGET)
vpath %.java $(SOURCE)
# show help message by default:
Default:
@echo "make init: build the target directory."
@echo "make build: compile the source file."
@echo "make clean: clear classes generated."
@echo "make rebuild: rebuild project."
@echo "make run: run the application at the entry point."
build: $(SOURCE_FILES:.java=.class)
%.class: %.java
$(JAVAC) -classpath $(TARGET) -d $(TARGET) $<
rebuild: clean build
.PHONY: init clean run
init:
mkdir -pv $(TARGET)
clean:
rm -frv $(TARGET)/*
run:
java -classpath $(TARGET) $(ENTRY_POINT)