-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
63 lines (48 loc) · 1.85 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
# This a Makefile, an input file for the 'make' program. For you
# command-line and Emacs enthusiasts, this makes it possible to build
# this program with a single command:
# make
# (or just 'make' if you are on a system that uses GNU make by default,
# such as Linux.) You can also clean up junk files and .class files with
# make clean
# To run style61b (our style enforcer) over your source files, type
# make style
# Finally, you can run tests with
# make check
# This is not an especially efficient Makefile, because it's not easy to
# figure out the minimal set of Java files that need to be recompiled.
# So if any .class file does not exist or is older than its .java file,
# we just remove all the .class files, compile the main class, and
# then compile everything in the plugin directory.
STYLEPROG = style61b
# All source files
SRCS := $(wildcard *.java)
# Flags to pass to Java compilations (include debugging info and report
# "unsafe" operations.)
JFLAGS = -g -Xlint:unchecked -Xlint:deprecation \
-sourcepath .. -classpath ..:$(CLASSPATH)
CLASSES = $(SRCS:.java=.class)
# Tell make that these are not really files.
.PHONY: clean default check regression-test unit-test style
# By default, make sure all classes are present and check if any sources have
# changed since the last build.
default: $(CLASSES)
$(CLASSES): sentinel
# If any class is missing, or any source changed since the main classes were
# compiled, remove all class files and recompile.
sentinel: $(SRCS)
$(RM) $@
javac $(JFLAGS) $(SRCS)
touch $@
# Run Tests.
check: unit-test
# Run Junit tests.
unit-test: $(CLASSES)
java -ea -classpath ..:$(CLASSPATH) graph.UnitTest
# Check style of source files with style61b.
style:
$(STYLEPROG) $(SRCS)
# Find and remove all *~, *.class, and testing output files.
# Do not touch .svn directories.
clean :
$(RM) *~ *.class sentinel