-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (34 loc) · 1.36 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
# 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:
# gmake
# (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
# gmake clean
# To run style61b (our style enforcer) over your source files, type
# gmake style
# Finally, you can run any tests you'd care to with
# gmake check
# This first runs your program on the input files tests/*.inp and checks
# to see that it completes normally and that the results are those in the
# files tests/*.out. It also runs the program on the input files tests/*.err
# and checks that the program properly reports an error as given in the
# specification. It's up to you to come up with the test files; the
# skeleton just includes some simple samples.
.PHONY: default style check clean
SHELL = bash
SRC = $(wildcard enigma/*.java)
default: enigma/Main.class
enigma/Main.class: $(SRC)
javac -g $(SRC)
style:
style61b enigma/*.java
check: enigma/Main.class
@code=0; \
echo "Testing correct inputs:"; \
if ! bash test-correct tests/*.inp; then code=1; fi; \
echo; echo "Testing erroneous inputs:"; \
if ! bash test-error tests/*.err; then code=1; fi; \
test $$code -eq 0
clean:
$(RM) enigma/*.class */*~ *~ OUT