X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fvimcoder;a=blobdiff_plain;f=Makefile;h=18f8c17a5f5ad32db56b49ba4f813a0e29eaf36b;hp=8442eec41ece7c136f559532367c28fbbb1bea2a;hb=c207038cc35932ef12270d1d44f6d3385b998cf4;hpb=d097989661f2974a1f3035b422a1e74813cd1108 diff --git a/Makefile b/Makefile index 8442eec..18f8c17 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,25 @@ -project := VimCoder -version := 0.3.1 +# Use this file with GNU 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.4 + +sources = $(wildcard src/com/dogcows/*.java) +classes = $(sources:src/%.java=%.class) library = lib/ContestApplet.jar jarfile = $(project)-$(version).jar +resource_path = com/dogcows/resources +resources = $(wildcard src/$(resource_path)/*) -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: $(classes) $(resources:src/%=%) clean: - rm -rf bin build + rm -rf com distclean: clean rm -rf lib @@ -25,20 +29,28 @@ dist: fetch: $(library) -jar: all $(jarfile) +jar: $(jarfile) -$(library): - sh make.sh fetch $@ +$(classes): $(sources) | $(library) + $(JAVAC) $(JAVACFLAGS) $^ -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/ +$(resource_path): + mkdir -p "$@" -$(jarfile): $(mainclass) - sh make.sh jar $@ +$(resource_path)/%: src/$(resource_path)/% | $(resource_path) + cp "$<" "$@" -$(mainclass): src/com/dogcows/Util.java src/com/dogcows/Editor.java +$(library): + mkdir -p lib + curl -o $@ http://www.topcoder.com/contest/classes/ContestApplet.jar + +$(jarfile): all + rm -f $@ + jar cvf $@ COPYING README.md com + + +.PHONY: all clean distclean dist fetch jar +# vim:noet:ts=8