aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/relx.mk
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/relx.mk')
-rw-r--r--plugins/relx.mk24
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/relx.mk b/plugins/relx.mk
index 3f7fd87..43f3d69 100644
--- a/plugins/relx.mk
+++ b/plugins/relx.mk
@@ -1,31 +1,32 @@
-# Copyright (c) 2013-2014, Loïc Hoguin <[email protected]>
+# Copyright (c) 2013-2015, Loïc Hoguin <[email protected]>
# This file is part of erlang.mk and subject to the terms of the ISC License.
-.PHONY: distclean-rel
+.PHONY: relx-rel distclean-relx-rel distclean-relx
# Configuration.
RELX_CONFIG ?= $(CURDIR)/relx.config
-ifneq ($(wildcard $(RELX_CONFIG)),)
-
RELX ?= $(CURDIR)/relx
export RELX
-RELX_URL ?= https://github.com/erlware/relx/releases/download/v1.0.2/relx
+RELX_URL ?= https://github.com/erlware/relx/releases/download/v2.0.0/relx
RELX_OPTS ?=
RELX_OUTPUT_DIR ?= _rel
ifeq ($(firstword $(RELX_OPTS)),-o)
RELX_OUTPUT_DIR = $(word 2,$(RELX_OPTS))
+else
+ RELX_OPTS += -o $(RELX_OUTPUT_DIR)
endif
# Core targets.
-rel:: distclean-rel $(RELX)
- @$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS)
+ifneq ($(wildcard $(RELX_CONFIG)),)
+rel:: distclean-relx-rel relx-rel
+endif
-distclean:: distclean-rel distclean-relx
+distclean:: distclean-relx-rel distclean-relx
# Plugin-specific targets.
@@ -37,10 +38,11 @@ endef
$(RELX):
@$(call relx_fetch)
-distclean-rel:
+relx-rel: $(RELX)
+ @$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS)
+
+distclean-relx-rel:
$(gen_verbose) rm -rf $(RELX_OUTPUT_DIR)
distclean-relx:
$(gen_verbose) rm -rf $(RELX)
-
-endif