From 5d021bf639417c663c8d68636e89952598c51368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 20 Aug 2014 16:06:57 +0300 Subject: Correctly handle RELX_OUTPUT_DIR --- README.md | 5 +++++ erlang.mk | 2 ++ plugins/relx.mk | 2 ++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 42919bc..56f5c9e 100644 --- a/README.md +++ b/README.md @@ -322,6 +322,11 @@ You can change the generated releases location by setting the `RELX_OUTPUT_DIR` variable. Any other option should go in the `RELX_OPTS` variable. +If `RELX_OPTS` includes the `-o` option (instead of using +`RELX_OUTPUT_DIR`, then that option must be the first in +the list, otherwise erlang.mk will fail to find it and +will not be able to clean up the release directory. + Contributing ------------ diff --git a/erlang.mk b/erlang.mk index 10f42dc..9fde6ad 100644 --- a/erlang.mk +++ b/erlang.mk @@ -709,6 +709,8 @@ 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. diff --git a/plugins/relx.mk b/plugins/relx.mk index 3204321..ee226d3 100644 --- a/plugins/relx.mk +++ b/plugins/relx.mk @@ -16,6 +16,8 @@ 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. -- cgit v1.2.3