From: Charles McGarvey Date: Thu, 23 Jun 2011 18:39:16 +0000 (-0600) Subject: makefile dependencies weren't quite right X-Git-Tag: v0.3.2~9 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=d6931adf12355c9d0cccde8cbc3d8ee92fc9100e;p=chaz%2Fvimcoder makefile dependencies weren't quite right --- diff --git a/Makefile b/Makefile index ea84d09..d2e8823 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ 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 @@ -13,7 +13,8 @@ JAVAC = javac JAVACFLAGS = -d . -sourcepath src -classpath $(library) -all: $(classobj) +classes = $(sources:src/%.java=%.class) +all: $(classes) clean: rm -rf META-INF com @@ -29,15 +30,12 @@ fetch: $(library) 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 @@ -45,7 +43,7 @@ $(jarfile): $(classobj) META-INF/MANIFEST.MF 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: @@ -53,8 +51,5 @@ 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