summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McDermott <andrew.mcdermott@linaro.org>2013-11-29 17:51:52 +0000
committerAndrew McDermott <andrew.mcdermott@linaro.org>2013-12-06 17:55:00 +0000
commitb3853f539547265d46333cb51b205b92909cfe60 (patch)
tree0c10710002fada2fab42853d670cb82d2c7c378e
parent979127c135c9bc4d0fb140a3b068427d312626c4 (diff)
Makefile: allow custom tarball name
For example: $ make VERSION=jdk8-b111 Allow for different compression types. Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
-rw-r--r--Makefile32
1 files changed, 17 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 0536ce3..fbd9c60 100644
--- a/Makefile
+++ b/Makefile
@@ -27,28 +27,30 @@
# Invoke as `make ARCH=jdk8' for x86 snapshot.
# Invoke as `make ARCH=aarch64-port' for ARMv8 snapshot (default)
-VERSION ?= aarch64-port
-OPENJDK_URL ?= http://hg.openjdk.java.net/$(VERSION)/jdk8
+PORT ?= aarch64-port
+URL ?= http://hg.openjdk.java.net/$(PORT)/jdk8
JDK8_CORE := jdk8
JDK8_COMPONENTS := corba jaxp jaxws langtools jdk hotspot nashorn
-JDK8_CORE_TARBALL := $(patsubst %,net/$(VERSION)/%.tar.gz,$(JDK8_CORE))
-JDK8_COMPONENT_TARBALLS := $(patsubst %,net/$(VERSION)/%.tar.gz,$(JDK8_COMPONENTS))
+JDK8_CORE_TARBALL := $(patsubst %,net/$(PORT)/%.tar.gz,$(JDK8_CORE))
+JDK8_COMPONENT_TARBALLS := $(patsubst %,net/$(PORT)/%.tar.gz,$(JDK8_COMPONENTS))
-SNAPSHOT_NAME := openjdk8-$(VERSION)-snapshot
-JDK8_TIP_TARBALL := $(SNAPSHOT_NAME).tar.bz2
+COMPRESSION ?= bz2
+VERSION ?= snapshot
+SNAPSHOT_NAME := openjdk8-$(PORT)-$(VERSION)
+TARBALL := $(SNAPSHOT_NAME).tar.$(COMPRESSION)
ALL_DOWNLOADS := $(JDK8_CORE_TARBALL) $(JDK8_COMPONENT_TARBALLS)
.PHONY: all print-commit-ids
-all: $(JDK8_TIP_TARBALL)
+all: $(TARBALL)
print-commit-ids:
./print-commit-ids $(JDK8_COMPONENT_TARBALLS)
-$(JDK8_TIP_TARBALL): $(ALL_DOWNLOADS)
+$(TARBALL): $(ALL_DOWNLOADS)
$(RM) -r $@ $(JDK8_CORE)
./print-commit-ids $(JDK8_COMPONENT_TARBALLS)
tar -zxf $(JDK8_CORE_TARBALL) --transform='s/^\([^-]\+\)-[0-9a-f]\{12\}/\1/'
@@ -59,18 +61,18 @@ $(JDK8_TIP_TARBALL): $(ALL_DOWNLOADS)
done)
tar -acf $@ --transform='s/^$(JDK8_CORE)/$(SNAPSHOT_NAME)/' $(JDK8_CORE)
-net/$(VERSION):
+net/$(PORT):
@mkdir -p $@
-net/$(VERSION)/jdk8.tar.gz: | net/$(VERSION)
- wget -O $@ -q $(OPENJDK_URL)/archive/tip.tar.gz
+net/$(PORT)/jdk8.tar.gz: | net/$(PORT)
+ wget -O $@ -q $(URL)/archive/tip.tar.gz
-net/$(VERSION)/%.tar.gz: | net/$(VERSION)
- wget -O $@ -q $(OPENJDK_URL)/$(patsubst %.tar.gz,%,$(notdir $@))/archive/tip.tar.gz
+net/$(PORT)/%.tar.gz: | net/$(PORT)
+ wget -O $@ -q $(URL)/$(patsubst %.tar.gz,%,$(notdir $@))/archive/tip.tar.gz
clean:
- $(RM) -r $(JDK8_TIP_TARBALL) $(JDK8_CORE) net/$(VERSION)
+ $(RM) -r $(TARBALL) $(JDK8_CORE) net/$(PORT)
unpack:
$(RM) -r $(SNAPSHOT_NAME)
- tar axf $(JDK8_TIP_TARBALL)
+ tar axf $(TARBALL)