summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-aux/Makefile.each.tail/09-nested.mk (renamed from build-aux/Makefile.each.tail/10-nested.mk)9
-rw-r--r--build-aux/Makefile.each.tail/10-files.mk6
-rw-r--r--build-aux/Makefile.once.head/10-files.mk5
-rw-r--r--build-aux/Makefile.once.head/10-nested.mk5
4 files changed, 15 insertions, 10 deletions
diff --git a/build-aux/Makefile.each.tail/10-nested.mk b/build-aux/Makefile.each.tail/09-nested.mk
index 667ec6f..ce36da3 100644
--- a/build-aux/Makefile.each.tail/10-nested.mk
+++ b/build-aux/Makefile.each.tail/09-nested.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2017 Luke Shumaker
+# Copyright (C) 2016-2018 Luke Shumaker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -13,9 +13,10 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-$(eval $(foreach _tmp.nested,$(nested.targets),\
+_nested.targets := $(notdir $(filter-out $(at.targets),$(addprefix $(outdir)/,$(nested.targets))))
+$(eval $(foreach _tmp.nested,$(_nested.targets),\
$$(outdir)/$(_tmp.nested): $$(addsuffix /$(_tmp.nested),$$(call at.addprefix,$$(outdir),$$(nested.subdirs)))$(at.nl)))
-.PHONY: $(addprefix $(outdir)/,$(nested.targets))
+.PHONY: $(addprefix $(outdir)/,$(_nested.targets))
at.subdirs += $(nested.subdirs)
-at.targets += $(addprefix $(outdir)/,$(nested.targets))
+at.targets += $(addprefix $(outdir)/,$(_nested.targets))
diff --git a/build-aux/Makefile.each.tail/10-files.mk b/build-aux/Makefile.each.tail/10-files.mk
index 787a3bd..015a0ad 100644
--- a/build-aux/Makefile.each.tail/10-files.mk
+++ b/build-aux/Makefile.each.tail/10-files.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2017 Luke Shumaker
+# Copyright (C) 2015-2018 Luke Shumaker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -26,12 +26,14 @@ _files.all = $(_files.src) $(_files.out) $(_files.sys)
at.targets += $(subst *,%,$(_files.all))
+_files.groups := $(notdir $(filter-out $(at.targets),$(addprefix $(outdir)/,$(files.groups))))
+
# Creative targets
$(outdir)/$(files.generate): $(_files.src.gen) $(_files.src.cfg)
$(outdir)/install: $(_files.sys.$(files.default))
$(outdir)/installdirs: $(sort $(dir $(_files.sys)))
$(eval \
- $(foreach _files.g,$(files.groups),\
+ $(foreach _files.g,$(_files.groups),\
$$(outdir)/$(_files.g): $$(_files.out.$(_files.g))$(at.nl))\
$(foreach _files.g,$(filter-out $(files.default),$(files.groups)),\
$$(outdir)/install-$(_files.g): $$(_files.sys.$(_files.g))$(at.nl)))
diff --git a/build-aux/Makefile.once.head/10-files.mk b/build-aux/Makefile.once.head/10-files.mk
index 564f9d6..9203d05 100644
--- a/build-aux/Makefile.once.head/10-files.mk
+++ b/build-aux/Makefile.once.head/10-files.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2017 Luke Shumaker
+# Copyright (C) 2015-2018 Luke Shumaker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -22,6 +22,7 @@ define mod.files.doc
# - `RMDIR_P ?= rmdir -p --ignore-fail-on-non-empty`
# - `TRUE ?= true`
# Inputs:
+# - Global variable : `at.targets`
# - Global variable : `files.groups ?= all`
# - Global variable : `files.default ?= all`
# - Global variable : `files.vcsclean ?= files.vcsclean`
@@ -44,7 +45,7 @@ define mod.files.doc
# - Directory variable : `files.sys`
# - Creative .PHONY targets:
# - `$(outdir)/$(files.generate)`
-# - `$(outdir)/$(group)` for `group` in `$(files.groups)`
+# - `$(outdir)/$(group)` for `group` in `$(files.groups)`, unless $(outdir)/$(group) is already declared in $(at.targets)
# - `$(outdir)/install`
# - `$(outdir)/install-$(group)` for `group` in `$(filter-out $(files.default),$(files.groups))`
# - `$(outdir)/installdirs`
diff --git a/build-aux/Makefile.once.head/10-nested.mk b/build-aux/Makefile.once.head/10-nested.mk
index d903d53..39c27e7 100644
--- a/build-aux/Makefile.once.head/10-nested.mk
+++ b/build-aux/Makefile.once.head/10-nested.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2017 Luke Shumaker
+# Copyright (C) 2016-2018 Luke Shumaker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -16,10 +16,11 @@
mod.nested.description = Easy nested .PHONY targets
define mod.nested.doc
# Inputs:
+# - Global variable : `at.targets`
# - Global variable : `nested.targets`
# - Directory variable : `nested.subdirs`
# Outputs:
-# - .PHONY Targets : `$(addprefix $(outdir)/,$(nested.targets))`
+# - .PHONY Targets : `$(addprefix $(outdir)/,$(nested.targets))`, unless $(outdir)/$(target) is already declared in $(at.targets)
# - Variable : `at.subdirs`
# - Variable : `at.targets`
#