Просмотр исходного кода

Correctly handle RELX_OUTPUT_DIR

Loïc Hoguin 10 лет назад
Родитель
Сommit
5d021bf639
3 измененных файлов с 9 добавлено и 0 удалено
  1. 5 0
      README.md
  2. 2 0
      erlang.mk
  3. 2 0
      plugins/relx.mk

+ 5 - 0
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
 ------------
 

+ 2 - 0
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.

+ 2 - 0
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.