summaryrefslogtreecommitdiff
path: root/build-aux/Makefile.tail.mk
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-28 18:00:39 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-28 18:00:39 -0500
commit448b71ad9d9387571e9a92f2fe4598ab5346c58c (patch)
treef0ab46636acfd76f8ca1cc8003604c4b56552d49 /build-aux/Makefile.tail.mk
parent84704dd28c3fbf50053afe26cfdf81539668c10a (diff)
parent36e62cbb6bdb17c318c00ee55f8049930438aa83 (diff)
Merge remote-tracking branch 'autothing/v3/master'
Diffstat (limited to 'build-aux/Makefile.tail.mk')
-rw-r--r--build-aux/Makefile.tail.mk35
1 files changed, 12 insertions, 23 deletions
diff --git a/build-aux/Makefile.tail.mk b/build-aux/Makefile.tail.mk
index dfbad5a..2e4adc6 100644
--- a/build-aux/Makefile.tail.mk
+++ b/build-aux/Makefile.tail.mk
@@ -17,34 +17,23 @@
include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk)))
-at.subdirs := $(patsubst ./%,%,$(addprefix $(outdir)/,$(at.subdirs)))
-at.depdirs := $(patsubst ./%,%,$(addprefix $(outdir)/,$(at.depdirs)))
+_at.tmp_targets := $(at.targets)
+_at.tmp_subdirs := $(call at.addprefix,$(outdir),$(at.subdirs))
-# Move all of the dirlocal variables to their namespaced version
-$(foreach v,$(at.dirlocal),$(eval $v/$(outdir) := $$($v)))
-$(foreach v,$(at.dirlocal),$(eval undefine $v))
+# Clean the environment
+$(eval \
+ $(foreach _at.tmp_variable,$(filter-out $(call _at.quote-pattern,_at.tmp_variable $(_at.VARIABLES)),$(.VARIABLES)),\
+ $(call _at.target_variable,$(_at.tmp_targets),$(_at.tmp_variable))$(at.nl)\
+ undefine $(_at.tmp_variable)$(at.nl)))
-# Remember that this is a directory that we've visited
-_at.outdirs := $(_at.outdirs) $(outdir)
-
-# Generic phony target declarations:
-# mark them phony
-.PHONY: $(addprefix $(outdir)/,$(at.phony))
-# have them depend on subdirs
-$(foreach t,$(at.phony),$(eval $(outdir)/$t: $(addsuffix /$t,$(at.subdirs/$(outdir)))))
-
-# Include Makefiles from other directories
+# Recurse
$(foreach _at.NO_ONCE,y,\
- $(foreach makefile,$(call at.path,$(addsuffix /Makefile,$(at.subdirs/$(outdir)) $(at.depdirs/$(outdir)))),\
- $(eval include $(filter-out $(_at.included_makefiles),$(makefile)))))
+ $(foreach _at.tmp,$(call at.path,$(addsuffix /$(at.Makefile),$(_at.tmp_subdirs))),\
+ $(if $(filter-out $(_at.MAKEFILE_LIST),$(abspath $(_at.tmp))),\
+ $(eval include $(_at.tmp)))))
# This bit only gets evaluated once, after all of the other Makefiles are read
-ifeq ($(_at.NO_ONCE),)
-
-outdir = /bogus
-srcdir = /bogus
-
-$(foreach v,$(at.dirlocal),$(eval $v=))
+ifeq ($(origin _at.NO_ONCE),undefined)
include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.tail/*.mk)))