aboutsummaryrefslogtreecommitdiff
path: root/mk/jars.mk
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-12-14 01:47:06 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-12-14 01:47:06 +0100
commit14955c297de82e964ea5bf44f8aaf543d4cae33a (patch)
tree264740d66d805dbbb82c03146830a2a022569d88 /mk/jars.mk
parent68b47178730a95871eba4aa4df19a845c8e5a947 (diff)
parent36c67860363c93eb00cf5b8e2ad34f6f775e6901 (diff)
Merge commit '36c67860363c93eb00cf5b8e2ad34f6f775e6901'
Diffstat (limited to 'mk/jars.mk')
-rw-r--r--mk/jars.mk15
1 files changed, 11 insertions, 4 deletions
diff --git a/mk/jars.mk b/mk/jars.mk
index 99470f374..c8513e664 100644
--- a/mk/jars.mk
+++ b/mk/jars.mk
@@ -1,4 +1,5 @@
define build-jar
+
$(1)_NAME ?= $(1)
_d := $$(strip $$($(1)_DIR))
@@ -7,14 +8,20 @@ define build-jar
$(1)_TMPDIR := $$(_d)/.$$($(1)_NAME).jar.tmp
- $$($(1)_PATH): $$($(1)_SOURCES)
+ _jars := $$(foreach jar, $$($(1)_JARS), $$($$(jar)_PATH))
+
+ $$($(1)_PATH): $$($(1)_SOURCES) $$(_jars) $$($(1)_EXTRA_DEPS)| $$($(1)_ORDER_AFTER)
@rm -rf $$($(1)_TMPDIR)
@mkdir -p $$($(1)_TMPDIR)
- $$(trace-javac) javac $(GLOBAL_JAVACFLAGS) $$($(1)_JAVACFLAGS) -d $$($(1)_TMPDIR) $$($(1)_SOURCES)
- $$(trace-jar) jar cf $$($(1)_PATH) -C $$($(1)_TMPDIR) .
+ $$(trace-javac) javac $(GLOBAL_JAVACFLAGS) $$($(1)_JAVACFLAGS) -d $$($(1)_TMPDIR) \
+ $$(foreach fn, $$($(1)_SOURCES), '$$(fn)') \
+ -cp "$$(subst $$(space),,$$(foreach jar,$$($(1)_JARS),$$($$(jar)_PATH):))$$$$CLASSPATH"
+ @echo -e '$$(subst $$(newline),\n,$$($(1)_MANIFEST))' > $$($(1)_PATH).manifest
+ $$(trace-jar) jar cfm $$($(1)_PATH) $$($(1)_PATH).manifest -C $$($(1)_TMPDIR) .
+ @rm $$($(1)_PATH).manifest
@rm -rf $$($(1)_TMPDIR)
- $(1)_INSTALL_DIR ?= $$(libdir)/java
+ $(1)_INSTALL_DIR ?= $$(jardir)
$(1)_INSTALL_PATH := $$($(1)_INSTALL_DIR)/$$($(1)_NAME).jar