Browse Source

Fix relx plugin to have targets defined even if file is missing

Loïc Hoguin 11 years ago
parent
commit
be51eb9620
2 changed files with 18 additions and 18 deletions
  1. 9 9
      erlang.mk
  2. 9 9
      plugins/relx.mk

+ 9 - 9
erlang.mk

@@ -685,14 +685,12 @@ distclean-edoc:
 # Copyright (c) 2013-2014, Loïc Hoguin <essen@ninenines.eu>
 # Copyright (c) 2013-2014, Loïc Hoguin <essen@ninenines.eu>
 # This file is part of erlang.mk and subject to the terms of the ISC License.
 # 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.
 # Configuration.
 
 
 RELX_CONFIG ?= $(CURDIR)/relx.config
 RELX_CONFIG ?= $(CURDIR)/relx.config
 
 
-ifneq ($(wildcard $(RELX_CONFIG)),)
-
 RELX ?= $(CURDIR)/relx
 RELX ?= $(CURDIR)/relx
 export RELX
 export RELX
 
 
@@ -706,10 +704,11 @@ endif
 
 
 # Core targets.
 # 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.
 # Plugin-specific targets.
 
 
@@ -721,10 +720,11 @@ endef
 $(RELX):
 $(RELX):
 	@$(call relx_fetch)
 	@$(call relx_fetch)
 
 
-distclean-rel:
+relx-rel: $(RELX)
+	@$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS)
+
+distclean-relx-rel:
 	$(gen_verbose) rm -rf $(RELX_OUTPUT_DIR)
 	$(gen_verbose) rm -rf $(RELX_OUTPUT_DIR)
 
 
 distclean-relx:
 distclean-relx:
 	$(gen_verbose) rm -rf $(RELX)
 	$(gen_verbose) rm -rf $(RELX)
-
-endif

+ 9 - 9
plugins/relx.mk

@@ -1,14 +1,12 @@
 # Copyright (c) 2013-2014, Loïc Hoguin <essen@ninenines.eu>
 # Copyright (c) 2013-2014, Loïc Hoguin <essen@ninenines.eu>
 # This file is part of erlang.mk and subject to the terms of the ISC License.
 # 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.
 # Configuration.
 
 
 RELX_CONFIG ?= $(CURDIR)/relx.config
 RELX_CONFIG ?= $(CURDIR)/relx.config
 
 
-ifneq ($(wildcard $(RELX_CONFIG)),)
-
 RELX ?= $(CURDIR)/relx
 RELX ?= $(CURDIR)/relx
 export RELX
 export RELX
 
 
@@ -22,10 +20,11 @@ endif
 
 
 # Core targets.
 # 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.
 # Plugin-specific targets.
 
 
@@ -37,10 +36,11 @@ endef
 $(RELX):
 $(RELX):
 	@$(call relx_fetch)
 	@$(call relx_fetch)
 
 
-distclean-rel:
+relx-rel: $(RELX)
+	@$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS)
+
+distclean-relx-rel:
 	$(gen_verbose) rm -rf $(RELX_OUTPUT_DIR)
 	$(gen_verbose) rm -rf $(RELX_OUTPUT_DIR)
 
 
 distclean-relx:
 distclean-relx:
 	$(gen_verbose) rm -rf $(RELX)
 	$(gen_verbose) rm -rf $(RELX)
-
-endif