summaryrefslogtreecommitdiff
path: root/build-aux/Makefile.once.head/zz-mod.mk
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-08-10 11:22:38 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-08-10 11:22:38 -0400
commit88d181c25d2f99f8b510afe2f2cc7e1ba1fa012c (patch)
tree8034e6048fcf1e96d8eb79dcdaac375891caaa87 /build-aux/Makefile.once.head/zz-mod.mk
parent2d47b10c0a19c9f986d2b1c4e5a06d8a49d36096 (diff)
(systemd) fix build system
Diffstat (limited to 'build-aux/Makefile.once.head/zz-mod.mk')
-rw-r--r--build-aux/Makefile.once.head/zz-mod.mk32
1 files changed, 24 insertions, 8 deletions
diff --git a/build-aux/Makefile.once.head/zz-mod.mk b/build-aux/Makefile.once.head/zz-mod.mk
index 7e52606..438f01e 100644
--- a/build-aux/Makefile.once.head/zz-mod.mk
+++ b/build-aux/Makefile.once.head/zz-mod.mk
@@ -13,14 +13,30 @@
# 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/>.
-mod.mod.description = Print information about Autothing modules
+mod.mod.description = Display information about Autothing modules
-_mod.target = at-mod-info
-_mod.modules := $(sort $(patsubst %.mk,%,$(filter %.mk,$(subst -, ,$(notdir $(wildcard $(topsrcdir)/build-aux/Makefile.*/??-*.mk))))))
-_mod.quote = '$(subst ','\'',$1)'
+# The trickery that is _mod.empty/_mod.space is from ยง6.2 of the GNU Make
+# manual, "The Two Flavors of Variables".
+_mod.empty :=
+_mod.space := $(_mod.empty) #
+undefine _mod.empty
+# _mod.rest is equivalent to GMSL rest.
+_mod.rest = $(wordlist 2,$(words $1),$1)
-$(eval $(foreach _mod.tmp,$(_mod.modules),mod.$(_mod.tmp).description ?=$(at.nl)mod.$(_mod.tmp).depends ?=$(at.nl)))
+_mod.file2mod = $(foreach _mod.tmp,$(patsubst %.mk,%,$(notdir $1)),$(subst $(_mod.space),-,$(call _mod.rest,$(subst -, ,$(_mod.tmp)))))
-_mod.vars = $(filter $(addsuffix .%,$(_mod.modules)),$(.VARIABLES))
-_mod.once := $(_mod.vars)
-_mod.each :=
+_mod.modules := $(sort $(call _mod.file2mod,$(wildcard $(topsrcdir)/build-aux/Makefile.*/??-*.mk)))
+undefine _mod.rest
+undefine _mod.file2mod
+
+$(eval $(foreach _mod.tmp,$(_mod.modules),\
+ mod.$(_mod.tmp).description ?=$(at.nl)\
+ mod.$(_mod.tmp).depends ?=$(at.nl)\
+ mod.$(_mod.tmp).files ?=$(at.nl)))
+
+_mod.quote-pattern = $(subst %,\%,$(subst \,\\,$1))
+_mod.quote-shell-each = $(foreach _mod.tmp,$1,$(call _mod.quote-shell,$(_mod.tmp)))
+
+# I put this as the last line in the file because it confuses Emacs syntax
+# highlighting and makes the remainder of the file difficult to edit.
+_mod.quote-shell = $(subst $(at.nl),'$$'\n'','$(subst ','\'',$1)')