project = VimCoder
version = 0.3.1
-mainclass = src/com/dogcows/VimCoder.java
+sources = src/com/dogcows/VimCoder.java src/com/dogcows/Util.java src/com/dogcows/Editor.java
library = lib/ContestApplet.jar
jarfile = $(project)-$(version).jar
JAVACFLAGS = -d . -sourcepath src -classpath $(library)
-all: $(classobj)
+classes = $(sources:src/%.java=%.class)
+all: $(classes)
clean:
rm -rf META-INF com
jar: $(jarfile)
-classobj = $(mainclass:src/%.java=%.class)
-
-
$(library):
@echo "Fetching dependencies..."
mkdir -p lib
curl -o $@ http://www.topcoder.com/contest/classes/ContestApplet.jar
-$(jarfile): $(classobj) META-INF/MANIFEST.MF
+$(jarfile): $(classes) META-INF/MANIFEST.MF
@echo "Packaging jar file..."
mkdir -p com/dogcows/resources
cp src/com/dogcows/resources/* com/dogcows/resources
zip $@ META-INF/MANIFEST.MF COPYING README $$(find com -type f | sort)
@echo "Done."
-$(classobj): $(mainclass)
+$(classes): $(sources) $(library)
$(JAVAC) $(JAVACFLAGS) $<
META-INF/MANIFEST.MF:
printf "Manifest-Version: 1.0\n\n" >$@
-$(mainclass): src/com/dogcows/Util.java src/com/dogcows/Editor.java
-$(classobj): $(library)
-
.PHONY: all clean distclean dist fetch jar