]> Dogcows Code - chaz/vimcoder/commitdiff
makefile dependencies weren't quite right
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 23 Jun 2011 18:39:16 +0000 (12:39 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 23 Jun 2011 18:39:16 +0000 (12:39 -0600)
Makefile

index ea84d09e0eb28f7c3a9994f793096debd08e1f61..d2e8823fc4c571268dc944bdd50b183211489dd4 100644 (file)
--- 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
 
This page took 0.027227 seconds and 4 git commands to generate.