X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fvimcoder;a=blobdiff_plain;f=Makefile;h=cb127255a780c50ab06e353eeb2973fdb4541563;hp=ea84d09e0eb28f7c3a9994f793096debd08e1f61;hb=fabb7e8d373d2ea2bc6b65b117c9cb0a0a03c114;hpb=7db10c9f0c1c4b358ad1a161a41ea1354a5bcecb diff --git a/Makefile b/Makefile index ea84d09..cb12725 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,21 @@ -# Use this file with ``make'' to compile and package VimCoder. +# Use this file with GNU make to compile and package VimCoder. # Supported targets: all clean distclean dist fetch jar project = VimCoder -version = 0.3.1 +version = 0.3.2 -mainclass = src/com/dogcows/VimCoder.java +sources = $(wildcard src/com/dogcows/*.java) library = lib/ContestApplet.jar jarfile = $(project)-$(version).jar +resources = $(wildcard src/com/dogcows/resources/*) JAVAC = javac JAVACFLAGS = -d . -sourcepath src -classpath $(library) -all: $(classobj) +classes = $(sources:src/%.java=%.class) +all: $(firstword $(classes)) clean: rm -rf META-INF com @@ -29,15 +31,15 @@ fetch: $(library) jar: $(jarfile) -classobj = $(mainclass:src/%.java=%.class) - +$(classes): $(sources) $(library) + $(JAVAC) $(JAVACFLAGS) $< $(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) $(resources) META-INF/MANIFEST.MF @echo "Packaging jar file..." mkdir -p com/dogcows/resources cp src/com/dogcows/resources/* com/dogcows/resources @@ -45,16 +47,11 @@ $(jarfile): $(classobj) META-INF/MANIFEST.MF zip $@ META-INF/MANIFEST.MF COPYING README $$(find com -type f | sort) @echo "Done." -$(classobj): $(mainclass) - $(JAVAC) $(JAVACFLAGS) $< - META-INF/MANIFEST.MF: + @echo "Generating MANIFEST.MF..." mkdir -p META-INF 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