From: Charles McGarvey Date: Sun, 7 Apr 2013 19:10:28 +0000 (-0600) Subject: improve ability to run vimcoder in-place (i.e. jar-less) X-Git-Tag: v0.3.5~7 X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fvimcoder;a=commitdiff_plain;h=966390964526a3778aa0c971d884735fd96e59e2 improve ability to run vimcoder in-place (i.e. jar-less) --- diff --git a/Makefile b/Makefile index 3d22632..18f8c17 100644 --- a/Makefile +++ b/Makefile @@ -6,16 +6,17 @@ 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 -resources = $(wildcard src/com/dogcows/resources/*) +resource_path = com/dogcows/resources +resources = $(wildcard src/$(resource_path)/*) JAVAC = javac JAVACFLAGS = -d . -sourcepath src -classpath $(library) -classes = $(sources:src/%.java=%.class) -all: $(firstword $(classes)) +all: $(classes) $(resources:src/%=%) clean: rm -rf com @@ -31,21 +32,23 @@ fetch: $(library) jar: $(jarfile) -$(classes): $(sources) $(library) - $(JAVAC) $(JAVACFLAGS) $< +$(classes): $(sources) | $(library) + $(JAVAC) $(JAVACFLAGS) $^ + +$(resource_path): + mkdir -p "$@" + +$(resource_path)/%: src/$(resource_path)/% | $(resource_path) + cp "$<" "$@" + $(library): - @echo "Fetching dependencies..." mkdir -p lib curl -o $@ http://www.topcoder.com/contest/classes/ContestApplet.jar -$(jarfile): $(classes) $(resources) - @echo "Packaging jar file..." - mkdir -p com/dogcows/resources - cp src/com/dogcows/resources/* com/dogcows/resources +$(jarfile): all rm -f $@ jar cvf $@ COPYING README.md com - @echo "Done." .PHONY: all clean distclean dist fetch jar