aboutsummaryrefslogtreecommitdiffstats
path: root/erlang.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-10-14 14:29:32 +0200
committerLoïc Hoguin <[email protected]>2013-10-14 14:29:32 +0200
commitcfcbcb5f407e95d44948f41d2a6397d9b2e8897c (patch)
tree1918bde4439f20f832b7d903b759234be03b91cd /erlang.mk
parent6b42bd74b64ca157458aec78cb59f31c627bd350 (diff)
downloaderlang.mk-cfcbcb5f407e95d44948f41d2a6397d9b2e8897c.tar.gz
erlang.mk-cfcbcb5f407e95d44948f41d2a6397d9b2e8897c.tar.bz2
erlang.mk-cfcbcb5f407e95d44948f41d2a6397d9b2e8897c.zip
Add release support to erlang.mk
No special configuration is needed, the release will be built automatically if a relx.config file is found.
Diffstat (limited to 'erlang.mk')
-rw-r--r--erlang.mk31
1 files changed, 29 insertions, 2 deletions
diff --git a/erlang.mk b/erlang.mk
index 2c09cf8..8e769f5 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -46,8 +46,35 @@ dtl_verbose = $(dtl_verbose_$(V))
gen_verbose_0 = @echo " GEN " $@;
gen_verbose = $(gen_verbose_$(V))
-.PHONY: all clean-all app clean deps clean-deps docs clean-docs \
- build-tests tests build-plt dialyze
+.PHONY: rel clean-rel all clean-all app clean deps clean-deps \
+ docs clean-docs build-tests tests build-plt dialyze
+
+# Release.
+
+RELX_CONFIG ?= $(CURDIR)/relx.config
+
+ifneq ($(wildcard $(RELX_CONFIG)),)
+
+RELX ?= $(CURDIR)/relx
+export RELX
+
+RELX_URL ?= https://github.com/erlware/relx/releases/download/0.4.0/relx
+
+define get_relx
+ wget -O $(RELX) $(RELX_URL)
+ chmod +x $(RELX)
+endef
+
+rel: clean-rel all $(RELX)
+ $(RELX)
+
+$(RELX):
+ @$(call get_relx)
+
+clean-rel:
+ rm -rf _rel
+
+endif
# Deps directory.