]> Dogcows Code - chaz/vimcoder/commitdiff
cleaned up build system
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 23 Jun 2011 17:55:19 +0000 (11:55 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 23 Jun 2011 17:55:19 +0000 (11:55 -0600)
Makefile
make.sh [deleted file]

index 8442eec41ece7c136f559532367c28fbbb1bea2a..ea84d09e0eb28f7c3a9994f793096debd08e1f61 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,22 @@
 
-project                := VimCoder
-version                := 0.3.1
+# Use this file with ``make'' to compile and package VimCoder.
+# Supported targets: all clean distclean dist fetch jar
 
-mainclass      = bin/com/dogcows/VimCoder.class
+project                = VimCoder
+version                = 0.3.1
+
+mainclass      = src/com/dogcows/VimCoder.java
 library                = lib/ContestApplet.jar
 jarfile                = $(project)-$(version).jar
 
-JAVAC          := javac
-JAVACFLAGS     := -d bin -sourcepath src -classpath bin:$(library)
-
+JAVAC          = javac
+JAVACFLAGS     = -d . -sourcepath src -classpath $(library)
 
-.PHONY: all clean distclean dist fetch jar
 
-all: $(library) $(mainclass)
+all: $(classobj)
 
 clean:
-       rm -rf bin build
+       rm -rf META-INF com
 
 distclean: clean
        rm -rf lib
@@ -25,20 +26,35 @@ dist:
 
 fetch: $(library)
 
-jar: all $(jarfile)
+jar: $(jarfile)
+
+
+classobj       = $(mainclass:src/%.java=%.class)
 
 
 $(library):
-       sh make.sh fetch $@
+       @echo "Fetching dependencies..."
+       mkdir -p lib
+       curl -o $@ http://www.topcoder.com/contest/classes/ContestApplet.jar
+
+$(jarfile): $(classobj) META-INF/MANIFEST.MF
+       @echo "Packaging jar file..."
+       mkdir -p com/dogcows/resources
+       cp src/com/dogcows/resources/* com/dogcows/resources
+       rm -f $@
+       zip $@ META-INF/MANIFEST.MF COPYING README $$(find com -type f | sort)
+       @echo "Done."
 
-bin/com/dogcows/%.class: src/com/dogcows/%.java
-       mkdir -p bin/com/dogcows/resources &&\
-$(JAVAC) $(JAVACFLAGS) $< &&\
-cp -R src/com/dogcows/resources bin/com/dogcows/
+$(classobj): $(mainclass)
+       $(JAVAC) $(JAVACFLAGS) $<
 
-$(jarfile): $(mainclass)
-       sh make.sh jar $@
+META-INF/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
 
diff --git a/make.sh b/make.sh
deleted file mode 100755 (executable)
index 0bb3d82..0000000
--- a/make.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-action=$1
-shift
-
-case "$action"
-in
-
-       fetch)
-               echo "Fetching dependencies..."
-               mkdir -p lib
-               curl -o $1 http://www.topcoder.com/contest/classes/ContestApplet.jar
-               ;;
-
-       jar)
-               echo "Packaging jar file..."
-               rm -rf build
-               mkdir -p build/META-INF
-               printf "Manifest-Version: 1.0\n\n" >build/META-INF/MANIFEST.MF
-               cp -R bin/com COPYING README build/
-               cd build
-               files=$(find com -type f | sort)
-               zip $1 META-INF/MANIFEST.MF README COPYING $files
-               cd ..
-               mv build/$1 .
-               rm -rf build
-               echo "Done."
-               ;;
-esac
-
This page took 0.02593 seconds and 4 git commands to generate.