-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (57 loc) · 2.22 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
# 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.
STYLEPROG = style61b
JFLAGS = -g -Xlint:unchecked -Xlint:deprecation
CLASSDIR = ../classes
DOCS = ../docs
JAVADOC_FLAGS = -private -Xdoclint:none
# See comment in ../Makefile
PYTHON = python3
RMAKE = "$(MAKE)"
# A CLASSPATH value that (seems) to work on both Windows and Unix systems.
# To Unix, it looks like ..:$(CLASSPATH):JUNK and to Windows like
# JUNK;..;$(CLASSPATH).
CPATH = "..:$(CLASSPATH):;..;$(CLASSPATH)"
# All .java files in this directory.
SRCS := $(wildcard *.java)
.PHONY: default check clean style acceptance unit doc
# 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: compile
compile: $(SRCS)
javac $(JFLAGS) -cp $(CPATH) $(SRCS)
style: default
$(STYLEPROG) $(SRCS)
check:
$(RMAKE) -C .. PYTHON=$(PYTHON) check
acceptance:
$(RMAKE) -C .. PYTHON=$(PYTHON) acceptance
unit: default
java -ea -cp $(CPATH) gitlet.UnitTest
doc:
if [ ! -d $(DOCS) ]; then mkdir $(DOCS); fi
javadoc -d $(DOCS) -link https://docs.oracle.com/javase/10/docs/api \
$(JAVADOC_FLAGS) -sourcepath .. gitlet
# 'make clean' will clean up stuff you can reconstruct.
clean:
$(RM) *~ *.class sentinel