summaryrefslogtreecommitdiff
path: root/build-aux/Makefile.each.tail
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/Makefile.each.tail')
-rw-r--r--build-aux/Makefile.each.tail/00-var.mk6
-rw-r--r--build-aux/Makefile.each.tail/10-files.mk34
-rw-r--r--build-aux/Makefile.each.tail/10-nested.mk3
-rw-r--r--build-aux/Makefile.each.tail/11-texinfo.mk4
4 files changed, 22 insertions, 25 deletions
diff --git a/build-aux/Makefile.each.tail/00-var.mk b/build-aux/Makefile.each.tail/00-var.mk
index c2fd9d7..954defb 100644
--- a/build-aux/Makefile.each.tail/00-var.mk
+++ b/build-aux/Makefile.each.tail/00-var.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 Luke Shumaker
+# Copyright (C) 2016-2017 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,10 +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/>.
-mod.var.depends += quote write-ifchanged
+mod.var.depends += files quote write-ifchanged
$(outdir)/.var.%: _var.FORCE
@printf '%s' $(call quote.shell,$($*)) | sed 's/^/#/' | $(WRITE_IFCHANGED) $@
-include $(wildcard $(outdir)/.var.*)
-at.targets += $(addprefix $(outdir)/,.var.%)
+files.out.int += .var.*
diff --git a/build-aux/Makefile.each.tail/10-files.mk b/build-aux/Makefile.each.tail/10-files.mk
index 3bb3bc2..e22b216 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-2016 Luke Shumaker
+# Copyright (C) 2015-2017 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
@@ -37,21 +37,21 @@ $(eval \
$$(outdir)/install-$(_files.g): $$(_files.sys.$(_files.g))$(at.nl)))
# Destructive targets
-_files.uninstall = $(_files.sys)
-_files.mostlyclean = $(filter-out $(_files.out.slow) $(_files.out.cfg),$(_files.out))
-_files.clean = $(filter-out $(_files.out.cfg),$(_files.out))
-_files.distclean = $(_files.out)
-$(addprefix $(outdir)/,uninstall mostlyclean clean distclean): %: %-hook
- $(RM) -- $(sort $(filter-out %/,$(_files.$(@F))))
- $(RM) -r -- $(sort $(filter %/,$(_files.$(@F))))
- $(RMDIR_P) -- $(sort $(dir $(_files.$(@F))))
-_files.maintainer-clean = $(filter-out $(_files.src.cfg) $(_files.src.src),$(_files.src))
-_files.$(files.vcsclean) = $(filter-out $(_files.src.src),$(_files.src))
-$(addprefix $(outdir)/,maintainer-clean $(files.vcsclean)): $(outdir)/%: $(outdir)/distclean $(outdir)/%-hook
- @echo 'This command is intended for maintainers to use; it'
- @echo 'deletes files that may need special tools to rebuild.'
- $(RM) -- $(sort $(filter-out %/,$(_files.$(@F))))
- $(RM) -r -- $(sort $(filter %/,$(_files.$(@F))))
- $(RMDIR_P) -- $(sort $(dir $(_files.$(@F))))
+#
+# We do our on $(srcdir) / $(outdir) prefixing here because
+# at.addprefix (while necessary for dependency lists) doesn't preserve
+# trailing slashes, which we care about here; while also not caring
+# about the path normalization that at.addprefix does.
+_files.uninstall = $(addprefix $(DESTDIR),$(files.sys))
+_files.mostlyclean = $(addprefix $(srcdir)/,$(filter-out $(files.out.slow) $(files.out.cfg),$(files.out)))
+_files.clean = $(addprefix $(srcdir)/,$(filter-out $(files.out.cfg),$(files.out)))
+_files.distclean = $(addprefix $(srcdir)/, $(files.out))
+_files.maintainer-clean = $(files.distclean) $(addprefix $(srcdir)/,$(filter-out $(files.src.cfg) $(files.src.src),$(files.src)))
+_files.$(files.vcsclean) = $(files.distclean) $(addprefix $(srcdir)/,$(filter-out $(files.src.src),$(files.src)))
+$(addprefix $(outdir)/,uninstall mostlyclean clean distclean maintainer-clean $(files.vcsclean)): %: %-hook
+ $(call _files.XARGS,$(RM) -- {}, $(sort $(filter-out %/,$(_files.$(@F)))) )
+ $(call _files.XARGS,$(RM) -r -- {}, $(sort $(filter %/,$(_files.$(@F)))) )
+ $(call _files.XARGS,$(RMDIR_P) -- {} 2>/dev/null || true,$(filter-out ./,$(sort $(dir $(_files.$(@F))))))
+$(addprefix $(outdir)/,maintainer-clean $(files.vcsclean)): _files.maintainer-clean-warning
$(foreach t,uninstall mostlyclean clean distclean maintainer-clean $(files.vcsclean), $(outdir)/$t-hook)::
.PHONY: $(foreach t,uninstall mostlyclean clean distclean maintainer-clean $(files.vcsclean), $(outdir)/$t-hook)
diff --git a/build-aux/Makefile.each.tail/10-nested.mk b/build-aux/Makefile.each.tail/10-nested.mk
index 5e5a40b..667ec6f 100644
--- a/build-aux/Makefile.each.tail/10-nested.mk
+++ b/build-aux/Makefile.each.tail/10-nested.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 Luke Shumaker
+# Copyright (C) 2016-2017 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
@@ -18,3 +18,4 @@ $(eval $(foreach _tmp.nested,$(nested.targets),\
.PHONY: $(addprefix $(outdir)/,$(nested.targets))
at.subdirs += $(nested.subdirs)
+at.targets += $(addprefix $(outdir)/,$(nested.targets))
diff --git a/build-aux/Makefile.each.tail/11-texinfo.mk b/build-aux/Makefile.each.tail/11-texinfo.mk
index 9491820..1ee5843 100644
--- a/build-aux/Makefile.each.tail/11-texinfo.mk
+++ b/build-aux/Makefile.each.tail/11-texinfo.mk
@@ -26,10 +26,6 @@ files.sys.html += $(foreach f,$(texinfo.docs), $(htmldir)/$f.html )
files.sys.pdf += $(foreach f,$(texinfo.docs), $(pdfdir)/$f.pdf )
files.sys.ps += $(foreach f,$(texinfo.docs), $(psdir)/$f.ps )
-$(outdir)/install:
- $(POST_INSTALL)
- $(foreach f,$(texinfo.docs),$(INSTALL_INFO) $(DESTDIR)$(infodir)/$f.info $(DESTDIR)$(infodir)/dir$(at.nl))
-
$(outdir)/%.info: $(srcdir)/%.texi; $(MAKEINFO) -o $(@D) $<
$(outdir)/%.info: $(outdir)/%.texi; $(MAKEINFO) -o $(@D) $<
$(outdir)/%.dvi : $(srcdir)/%.texi; $(TEXI2DVI) -o $(@D) $<