-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
61 lines (38 loc) · 1.17 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
# Use this file with GNU make to compile and package VimCoder.
# Supported targets: all clean distclean dist fetch jar
project = VimCoder
version = 0.3.6
sources = $(wildcard src/com/dogcows/*.java)
classes = $(sources:src/%.java=%.class)
library = lib/ContestApplet.jar
jarfile = $(project)-$(version).jar
resource_path = com/dogcows/resources
resources = $(wildcard src/$(resource_path)/*)
JAVAC = javac
JAVACFLAGS = -d . -sourcepath src -classpath $(library)
PROVE = prove
all: $(classes) $(resources:src/%=%)
clean:
rm -rf com
distclean: clean
rm -rf lib
dist:
git archive HEAD --prefix=vimcoder-$(version)/ | bzip2 >vimcoder-$(version).tar.bz2
fetch: $(library)
jar: $(jarfile)
test: all
$(PROVE)
$(classes): $(sources) | $(library)
$(JAVAC) $(JAVACFLAGS) $^
$(resource_path):
mkdir -p "$@"
$(resource_path)/%: src/$(resource_path)/% | $(resource_path)
cp "$<" "$@"
$(library):
mkdir -p lib
curl -o $@ http://www.topcoder.com/contest/classes/ContestApplet.jar
$(jarfile): all
rm -f $@
jar cvf $@ COPYING README.md com
.PHONY: all clean distclean dist fetch jar test
# vim:noet:ts=8