[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
177/376: Improved support for building JARs
From: |
Ludovic Courtès |
Subject: |
177/376: Improved support for building JARs |
Date: |
Wed, 28 Jan 2015 22:04:51 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit 44e7e3bb9b36bca7023d207c51b7380b78ccfc4c
Author: Eelco Dolstra <address@hidden>
Date: Thu Sep 11 15:28:30 2014 +0200
Improved support for building JARs
---
jars.mk | 9 +++++++--
lib.mk | 5 +++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/jars.mk b/jars.mk
index 99470f3..186a81d 100644
--- a/jars.mk
+++ b/jars.mk
@@ -1,4 +1,5 @@
define build-jar
+
$(1)_NAME ?= $(1)
_d := $$(strip $$($(1)_DIR))
@@ -7,10 +8,14 @@ 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)
@rm -rf $$($(1)_TMPDIR)
@mkdir -p $$($(1)_TMPDIR)
- $$(trace-javac) javac $(GLOBAL_JAVACFLAGS) $$($(1)_JAVACFLAGS) -d
$$($(1)_TMPDIR) $$($(1)_SOURCES)
+ $$(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"
$$(trace-jar) jar cf $$($(1)_PATH) -C $$($(1)_TMPDIR) .
@rm -rf $$($(1)_TMPDIR)
diff --git a/lib.mk b/lib.mk
index aa92d8d..16a43f4 100644
--- a/lib.mk
+++ b/lib.mk
@@ -14,6 +14,11 @@ dist-files :=
OS = $(shell uname -s)
+# Hack to define a literal space.
+space :=
+space +=
+
+
# Default installation paths.
prefix ?= /usr/local
libdir ?= $(prefix)/lib
- 171/376: Fix build-remote.pl, (continued)
- 171/376: Fix build-remote.pl, Ludovic Courtès, 2015/01/28
- 172/376: tests/remote-builds.nix: Time out faster, Ludovic Courtès, 2015/01/28
- 176/376: Add support for using a build directory, Ludovic Courtès, 2015/01/28
- 178/376: Support specifying a JAR manifest, Ludovic Courtès, 2015/01/28
- 181/376: Add some hyperlinks between NIXPATH and -I, Ludovic Courtès, 2015/01/28
- 165/376: Add disallowedReferences / disallowedRequisites, Ludovic Courtès, 2015/01/28
- 173/376: Tweak, Ludovic Courtès, 2015/01/28
- 168/376: Fix boost::too_many_args error, Ludovic Courtès, 2015/01/28
- 174/376: build-remote.pl: UTF-8-decode errors, Ludovic Courtès, 2015/01/28
- 180/376: Don't rely on process substitution, Ludovic Courtès, 2015/01/28
- 177/376: Improved support for building JARs,
Ludovic Courtès <=
- 187/376: Drop reference to FreeBSD, Ludovic Courtès, 2015/01/28
- 189/376: Tweak some chapter titles, Ludovic Courtès, 2015/01/28
- 175/376: Hack to prevent Makefile.config from being regenerated by "make clean", Ludovic Courtès, 2015/01/28
- 186/376: Remove pointless "license" section, Ludovic Courtès, 2015/01/28
- 190/376: Undocument NIX_OTHER_STORES, Ludovic Courtès, 2015/01/28
- 184/376: Nicer file names for the release notes, Ludovic Courtès, 2015/01/28
- 198/376: Derive Emacs nix-mode from prog-mode., Ludovic Courtès, 2015/01/28
- 179/376: Fix JAR installation, Ludovic Courtès, 2015/01/28
- 194/376: Style tweak, Ludovic Courtès, 2015/01/28
- 192/376: Fix references to version.txt, Ludovic Courtès, 2015/01/28