diff options
author | Andrew McDermott <andrew.mcdermott@linaro.org> | 2014-01-23 14:08:43 +0000 |
---|---|---|
committer | Andrew McDermott <andrew.mcdermott@linaro.org> | 2014-01-23 14:08:43 +0000 |
commit | 823e0bb097b1193960c72d3b4da56759b7ee5388 (patch) | |
tree | 9861c530990397b12d96577bc78336a372d92cb5 | |
parent | 9e5dabf401271ae2622f0d1187a1dca79b556ae0 (diff) |
Makefile: allow control over output location
For example: make TOP_DIR=$HOME/openjdj8-daily-download
Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
-rw-r--r-- | Makefile | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -27,14 +27,18 @@ # Invoke as `make ARCH=jdk8' for x86 snapshot. # Invoke as `make ARCH=aarch64-port' for ARMv8 snapshot (default) +TOP_DIR ?= . +OUT_DIR ?= $(TOP_DIR)/out +NET_DIR ?= $(TOP_DIR)/net + 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/$(PORT)/%.tar.gz,$(JDK8_CORE)) -JDK8_COMPONENT_TARBALLS := $(patsubst %,net/$(PORT)/%.tar.gz,$(JDK8_COMPONENTS)) +JDK8_CORE_TARBALL := $(patsubst %,$(NET_DIR)/$(PORT)/%.tar.gz,$(JDK8_CORE)) +JDK8_COMPONENT_TARBALLS := $(patsubst %,$(NET_DIR)/$(PORT)/%.tar.gz,$(JDK8_COMPONENTS)) COMPRESSION ?= bz2 VERSION ?= snapshot @@ -45,12 +49,12 @@ ALL_DOWNLOADS := $(JDK8_CORE_TARBALL) $(JDK8_COMPONENT_TARBALLS) .PHONY: all print-commit-ids -all: print-commit-ids out/$(TARBALL) +all: $(OUT_DIR)/$(TARBALL) print-commit-ids: $(JDK8_CORE_TARBALL) $(JDK8_COMPONENT_TARBALLS) ./print-commit-ids $(JDK8_CORE_TARBALL) $(JDK8_COMPONENT_TARBALLS) -out/$(TARBALL): $(ALL_DOWNLOADS) | out +$(OUT_DIR)/$(TARBALL): $(ALL_DOWNLOADS) | $(OUT_DIR) $(RM) -r $@ $(JDK8_CORE) tar -zxf $(JDK8_CORE_TARBALL) --transform='s/^\([^-]\+\)-[0-9a-f]\{12\}/\1/' @(set -e; for i in $(JDK8_COMPONENT_TARBALLS); \ @@ -60,27 +64,27 @@ out/$(TARBALL): $(ALL_DOWNLOADS) | out done) tar -acf $@ --transform='s/^$(JDK8_CORE)/$(SNAPSHOT_NAME)/' $(JDK8_CORE) -out: +$(OUT_DIR): mkdir $@ -net/$(PORT): +$(NET_DIR)/$(PORT): @mkdir -p $@ -net/$(PORT)/jdk8.tar.gz: | net/$(PORT) +$(NET_DIR)/$(PORT)/jdk8.tar.gz: | $(NET_DIR)/$(PORT) wget -O $@ -q $(URL)/archive/tip.tar.gz -net/$(PORT)/%.tar.gz: | net/$(PORT) +$(NET_DIR)/$(PORT)/%.tar.gz: | $(NET_DIR)/$(PORT) wget -O $@ -q $(URL)/$(patsubst %.tar.gz,%,$(notdir $@))/archive/tip.tar.gz net-clean: - $(RM) -r net/$(PORT) + $(RM) -r $(NET_DIR)/$(PORT) clean: - $(RM) -r out/$(TARBALL) $(JDK8_CORE) + $(RM) -r $(OUT_DIR)/$(TARBALL) $(JDK8_CORE) spotless: clean net-clean - $(RM) -r out + $(RM) -r $(OUT_DIR) unpack: $(RM) -r $(SNAPSHOT_NAME) - tar axf out/$(TARBALL) + tar axf $(OUT_DIR)/$(TARBALL) |