From 656238ed7c0e7dd87f99cc50300cf260b4baa15d Mon Sep 17 00:00:00 2001 From: erickson Date: Sat, 21 Jul 2007 18:59:31 +0000 Subject: [PATCH] Patch from Ed Summers: Attached is a minor patch to OpenSRF/src/java/Makefile for creating a opensrf.jar. I was thinking an opensrf.jar would make it easy to deploy OpenSRF client in a Woodchip/OpenTaps instance. It's not yet clear to me what the build environment is (or will be) for Woodchip--but .jar files are used to across the board to manage external dependencies in Javaland. - - - I've also given the depencies their own vars for easier handling and made the dependency fetching smarter to prevent re-fetching existing deps git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1052 9efc2488-bf62-4759-914b-345cdb29e865 --- src/java/Makefile | 49 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/src/java/Makefile b/src/java/Makefile index 7bcd020..844c7c5 100644 --- a/src/java/Makefile +++ b/src/java/Makefile @@ -1,18 +1,42 @@ -#JAVA_LIBS = .:lib:ext/json-jdk1.5-2007-05-01.jar:ext/wstx-asl-3.2.1.jar:ext/stax-api-1.0.1.jar:ext/xercesImpl-1.4.4-2.jar -JAVA_LIBDIR = .lib +# dependencies +STAX=stax-api-1.0.1.jar +WSTX=wstx-lgpl-3.2.1.jar +MEMCACHE=java_memcached-release_1.5.1.jar +JSON=json.zip + +STAX_URL=http://woodstox.codehaus.org/$(STAX) +WSTX_URL=http://woodstox.codehaus.org/3.2.1/$(WSTX) +MEMCACHE_URL=http://img.whalin.com/memcached/jdk5/standard/$(MEMCACHE) +JSON_URL=http://www.json.org/java/$(JSON) + + JAVAC=javac -J-Xmx256m JAVA=java -Xmx256m -JAVA_LIBS = .:$(JAVA_LIBDIR):ext/json-jdk1.5-2007-05-01.jar:ext/wstx-lgpl-3.2.1.jar:ext/stax-api-1.0.1.jar:ext/java_memcached-release_1.5.1.jar +JAVA_LIBDIR = .lib +JAVA_LIBS = .:$(JAVA_LIBDIR):ext/$(WSTX):ext/$(STAX):ext/$(MEMCACHE) JAVA_SRC = \ org/opensrf/net/xmpp/*.java \ org/opensrf/util/*.java \ org/opensrf/*.java \ org/opensrf/test/*.java -all: + +#------------------------------------------------------------------ + +all: jar + + +dirs: mkdir -p $(JAVA_LIBDIR) + +opensrf: deps $(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 +jar: opensrf + rm -f opensrf.jar + echo "creating opensrf.jar" + jar cvf opensrf.jar -C .lib org/opensrf/ + # only prints the first 30 lines of errors slim: mkdir -p $(JAVA_LIBDIR) @@ -29,10 +53,11 @@ run: deps: mkdir -p ext - wget 'http://woodstox.codehaus.org/stax-api-1.0.1.jar' -O ext/stax-api-1.0.1.jar - wget 'http://woodstox.codehaus.org/3.2.1/wstx-lgpl-3.2.1.jar' -O ext/wstx-lgpl-3.2.1.jar - wget 'http://img.whalin.com/memcached/jdk5/standard/java_memcached-release_1.5.1.jar' -O ext/java_memcached-release_1.5.1.jar - mkdir -p .tmp && cd .tmp && wget 'http://www.json.org/java/json.zip' && unzip json.zip + mkdir -p $(JAVA_LIBDIR) + if [ ! -f ext/$(STAX) ]; then wget '$(STAX_URL)' -O ext/$(STAX); fi + if [ ! -f ext/wstx-lgpl-3.2.1.jar ]; then wget '$(WSTX_URL)' -O ext/$(WSTX); fi + if [ ! -f ext/java_memcached-release_1.5.1.jar ]; then wget '$(MEMCACHE_URL)' -O ext/$(MEMCACHE); fi + if [ ! -f .tmp/$(JSON) ]; then mkdir -p .tmp && cd .tmp && wget '$(JSON_URL)' && unzip $(JSON); fi $(JAVAC) -d $(JAVA_LIBDIR) .tmp/org/json/*.java docs: @@ -40,8 +65,10 @@ docs: javadoc -classpath $(JAVA_LIBS) -d doc @files; rm files; -clean: - rm -r $(JAVA_LIBDIR) - +clean: + rm -rf $(JAVA_LIBDIR) opensrf.jar +dep_clean: + rm -rf ext .tmp + -- 2.43.2