Skip to content

Commit fabb7e8

Browse files
committed
make the jar file also depend on the resources
1 parent 9117819 commit fabb7e8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

2-
# Use this file with ``make'' to compile and package VimCoder.
2+
# Use this file with GNU make to compile and package VimCoder.
33
# Supported targets: all clean distclean dist fetch jar
44

55
project = VimCoder
66
version = 0.3.2
77

8-
sources = src/com/dogcows/VimCoder.java src/com/dogcows/Util.java src/com/dogcows/Editor.java
8+
sources = $(wildcard src/com/dogcows/*.java)
99
library = lib/ContestApplet.jar
1010
jarfile = $(project)-$(version).jar
11+
resources = $(wildcard src/com/dogcows/resources/*)
1112

1213
JAVAC = javac
1314
JAVACFLAGS = -d . -sourcepath src -classpath $(library)
@@ -30,23 +31,24 @@ fetch: $(library)
3031
jar: $(jarfile)
3132

3233

34+
$(classes): $(sources) $(library)
35+
$(JAVAC) $(JAVACFLAGS) $<
36+
3337
$(library):
3438
@echo "Fetching dependencies..."
3539
mkdir -p lib
3640
curl -o $@ http://www.topcoder.com/contest/classes/ContestApplet.jar
3741

38-
$(jarfile): $(firstword $(classes)) META-INF/MANIFEST.MF
42+
$(jarfile): $(classes) $(resources) META-INF/MANIFEST.MF
3943
@echo "Packaging jar file..."
4044
mkdir -p com/dogcows/resources
4145
cp src/com/dogcows/resources/* com/dogcows/resources
4246
rm -f $@
4347
zip $@ META-INF/MANIFEST.MF COPYING README $$(find com -type f | sort)
4448
@echo "Done."
4549

46-
$(classes): $(sources) $(library)
47-
$(JAVAC) $(JAVACFLAGS) $<
48-
4950
META-INF/MANIFEST.MF:
51+
@echo "Generating MANIFEST.MF..."
5052
mkdir -p META-INF
5153
printf "Manifest-Version: 1.0\n\n" >$@
5254

0 commit comments

Comments
 (0)