-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (54 loc) · 1.99 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
# This makefile is defined to give you the following targets:
#
# default: The default target: Compiles $(PROG) and whatever it
# depends on.
# style: Run our style checker on the project source files. Requires that
# the source files compile.
# check: Compile $(PROG), if needed, and then for each file, F.in, in
# directory testing, use F.in as input to "java $(MAIN_CLASS)" and
# compare the output to the contents of the file names F.out.
# Report discrepencies.
# clean: Remove all the .class files produced by java compilation,
# all Emacs backup files, and testing output files.
#
# In other words, type 'gmake' to compile everything; 'gmake check' to
# compile and test everything, and 'gmake clean' to clean things up.
#
# You can use this file without understanding most of it, of course, but
# I strongly recommend that you try to figure it out, and where you cannot,
# that you ask questions. The Lab Reader contains documentation.
.PHONY: default check clean style unit acceptance
PACKAGE = ataxx
STYLEPROG = style61b
JFLAGS = -g -Xlint:unchecked -Xlint:deprecation
CLASSDEST = ..
CPATH = "..:$(CLASSPATH):;..;$(CLASSPATH)"
# All .java files in this directory.
SRCS := $(wildcard *.java)
# As a convenience, you can compile a single Java file X.java in this directory
# with 'make X.class'
%.class: %.java
javac $(JFLAGS) -cp $(CPATH) $<
# First, and therefore default, target.
default: Main.class
style: default
$(STYLEPROG) $(SRCS)
check: unit acceptance
# Unit testing
unit: Main.class
java -ea -cp $(CPATH) ataxx.UnitTest
# Acceptance testing
acceptance:
"$(MAKE)" -C .. acceptance
# 'make clean' will clean up stuff you can reconstruct.
clean:
$(RM) *~ *.class
Main.class: $(SRCS)
javac $(JFLAGS) -d $(CLASSDEST) $(SRCS)
unit-jar: unit-tests.jar
unit-tests.jar: sentinel
jar cf $@ ../$(PACKAGE)/UnitTest.class ../$(PACKAGE)/BoardTest.class
### DEPENDENCIES ###
sentinel: $(SRCS)
javac $(JFLAGS) -cp $(CPATH) $(SRCS)
touch sentinel