From 58b99e7f457bc056e91d2d1721cbb65fcd517afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 28 May 2014 22:07:54 +0200 Subject: Cut erlang.mk into many small components * The build.config says what gets into the generated erlang.mk. * The default erlang.mk in the repository hasn't changed yet. * Clean targets were separated into "clean" and "distclean". * The "help" target was added to display some help message. I probably broke a couple things... --- plugins/relx.mk | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 plugins/relx.mk (limited to 'plugins/relx.mk') diff --git a/plugins/relx.mk b/plugins/relx.mk new file mode 100644 index 0000000..5213318 --- /dev/null +++ b/plugins/relx.mk @@ -0,0 +1,43 @@ +# Copyright (c) 2013-2014, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-rel + +# Configuration. + +RELX_CONFIG ?= $(CURDIR)/relx.config + +ifneq ($(wildcard $(RELX_CONFIG)),) + +RELX ?= $(CURDIR)/relx +export RELX + +RELX_URL ?= https://github.com/erlware/relx/releases/download/v0.6.0/relx +RELX_OPTS ?= +RELX_OUTPUT_DIR ?= _rel + +ifneq ($(firstword $(subst -o,,$(RELX_OPTS))),) + RELX_OUTPUT_DIR = $(firstword $(subst -o,,$(RELX_OPTS))) +endif + +# Core targets. + +rel:: distclean-rel $(RELX) + @$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS) + +distclean:: distclean-rel + +# Plugin-specific targets. + +define relx_fetch + $(call core_http_get,$(RELX),$(RELX_URL)) + chmod +x $(RELX) +endef + +$(RELX): + @$(call relx_fetch) + +distclean-rel: + $(gen_verbose) rm -rf $(RELX_OUTPUT_DIR) + +endif -- cgit v1.2.3