-
-
Notifications
You must be signed in to change notification settings - Fork 618
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (33 loc) · 612 Bytes
/
Makefile
File metadata and controls
40 lines (33 loc) · 612 Bytes
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
IN_EXT ?= .java
OUT_EXT ?= .class
RUN ?= Main
TEST ?= test
OUTS := $(addsuffix $(OUT_EXT), $(basename $(wildcard *$(IN_EXT))))
-include Makefile_params
.PHONY: all clean run
all:
javac *.java
clean:
rm -f *$(OUT_EXT)
run: all
java -ea $(RUN)
test: all
@\
if [ -x $(TEST) ]; then \
./$(TEST) '$(OUTS)' ;\
else\
fail=false ;\
for t in $(basename $(OUTS)); do\
if ! java -ea "$$t"; then \
fail=true ;\
break ;\
fi ;\
done ;\
if $$fail; then \
echo "TEST FAILED: $$t" ;\
exit 1 ;\
else \
echo 'ALL TESTS PASSED' ;\
exit 0 ;\
fi ;\
fi ;\