From 42f72fea1078ddb379dd4e6df80a98e1072ba726 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 27 May 2016 21:09:58 -0400 Subject: move everything into build-aux --- build-aux/Makefile.tail.mk | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 build-aux/Makefile.tail.mk (limited to 'build-aux/Makefile.tail.mk') diff --git a/build-aux/Makefile.tail.mk b/build-aux/Makefile.tail.mk new file mode 100644 index 0000000..472d2db --- /dev/null +++ b/build-aux/Makefile.tail.mk @@ -0,0 +1,52 @@ +# Copyright (C) 2015-2016 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# This bit gets evaluated for each Makefile processed + +include $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk) + +# Make the namespaced versions of all of the dirlocal variables +$(foreach v,$($(_am)dirlocal),$(eval $v/$(outdir) = $($v))) + +# Remember that this is a directory that we've visited +_am_outdirs := $(_am_outdirs) $(outdir) + +# Generic phony target declarations: +# mark them phony +.PHONY: $(addprefix $(outdir)/,$($(_am)phony)) +# have them depend on subdirs +$(foreach t,$($(_am)phony),$(eval $(outdir)/$t: $(addsuffix /$t,$(subdirs)))) + +# Include Makefiles from other directories + +define _am_nl + + +endef +$(foreach _am_NO_ONCE,y,\ + $(foreach makefile,$(call am_path,$(addsuffix /Makefile,$($(_am)subdirs) $($(_am)depdirs))),\ + $(eval include $(filter-out $(_am_included_makefiles),$(makefile))))) + +# This bit only gets evaluated once, after all of the other Makefiles are read +ifeq ($(_am_NO_ONCE),) + +outdir = /bogus +srcdir = /bogus + +$(foreach v,$($(_am)dirlocal),$(eval $v=)) + +include $(wildcard $(topsrcdir)/build-aux/Makefile.once.tail/*.mk) + +endif # _am_NO_ONCE -- cgit v1.2.2 From feadb8948e04996a4d024896dc50c82e62ceac56 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 29 May 2016 16:05:16 -0400 Subject: work on things --- build-aux/Makefile.tail.mk | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'build-aux/Makefile.tail.mk') diff --git a/build-aux/Makefile.tail.mk b/build-aux/Makefile.tail.mk index 472d2db..bb197dc 100644 --- a/build-aux/Makefile.tail.mk +++ b/build-aux/Makefile.tail.mk @@ -18,35 +18,30 @@ include $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk) # Make the namespaced versions of all of the dirlocal variables -$(foreach v,$($(_am)dirlocal),$(eval $v/$(outdir) = $($v))) +$(foreach v,$(at.dirlocal),$(eval $v/$(outdir) = $($v))) # Remember that this is a directory that we've visited -_am_outdirs := $(_am_outdirs) $(outdir) +_at.outdirs := $(_at.outdirs) $(outdir) # Generic phony target declarations: # mark them phony -.PHONY: $(addprefix $(outdir)/,$($(_am)phony)) +.PHONY: $(addprefix $(outdir)/,$(at.phony)) # have them depend on subdirs -$(foreach t,$($(_am)phony),$(eval $(outdir)/$t: $(addsuffix /$t,$(subdirs)))) +$(foreach t,$(at.phony),$(eval $(outdir)/$t: $(addsuffix /$t,$(subdirs)))) # Include Makefiles from other directories - -define _am_nl - - -endef -$(foreach _am_NO_ONCE,y,\ - $(foreach makefile,$(call am_path,$(addsuffix /Makefile,$($(_am)subdirs) $($(_am)depdirs))),\ - $(eval include $(filter-out $(_am_included_makefiles),$(makefile))))) +$(foreach _at.NO_ONCE,y,\ + $(foreach makefile,$(call am_path,$(addsuffix /Makefile,$(at.subdirs) $(at.depdirs))),\ + $(eval include $(filter-out $(_at.included_makefiles),$(makefile))))) # This bit only gets evaluated once, after all of the other Makefiles are read -ifeq ($(_am_NO_ONCE),) +ifeq ($(_at.NO_ONCE),) outdir = /bogus srcdir = /bogus -$(foreach v,$($(_am)dirlocal),$(eval $v=)) +$(foreach v,$(at.dirlocal),$(eval $v=)) include $(wildcard $(topsrcdir)/build-aux/Makefile.once.tail/*.mk) -endif # _am_NO_ONCE +endif # _at.NO_ONCE -- cgit v1.2.2 From b910b85b2d7d732ccfeaf69ab7ec79140a4a7802 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 30 May 2016 23:58:38 -0400 Subject: fix - Make at.relto public, as mod-dist needs it - Include the correct files in .head.mk - Sort the head includes forwards - Sort the tail includes backwards - Correctly prefix at.{sub,dep}dirs with $(outdir) - Undefine variables after they have been namespaced. - Don't try to access at.{sub,dep}dirs after they have been undefined --- build-aux/Makefile.tail.mk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'build-aux/Makefile.tail.mk') diff --git a/build-aux/Makefile.tail.mk b/build-aux/Makefile.tail.mk index bb197dc..f7d42b9 100644 --- a/build-aux/Makefile.tail.mk +++ b/build-aux/Makefile.tail.mk @@ -15,10 +15,14 @@ # This bit gets evaluated for each Makefile processed -include $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk) +include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk))) -# Make the namespaced versions of all of the dirlocal variables -$(foreach v,$(at.dirlocal),$(eval $v/$(outdir) = $($v))) +at.subdirs := $(addprefix $(outdir)/,$(at.subdirs)) +at.depdirs := $(addprefix $(outdir)/,$(at.depdirs)) + +# 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)) # Remember that this is a directory that we've visited _at.outdirs := $(_at.outdirs) $(outdir) @@ -27,11 +31,11 @@ _at.outdirs := $(_at.outdirs) $(outdir) # mark them phony .PHONY: $(addprefix $(outdir)/,$(at.phony)) # have them depend on subdirs -$(foreach t,$(at.phony),$(eval $(outdir)/$t: $(addsuffix /$t,$(subdirs)))) +$(foreach t,$(at.phony),$(eval $(outdir)/$t: $(addsuffix /$t,$(at.subdirs/$(outdir))))) # Include Makefiles from other directories $(foreach _at.NO_ONCE,y,\ - $(foreach makefile,$(call am_path,$(addsuffix /Makefile,$(at.subdirs) $(at.depdirs))),\ + $(foreach makefile,$(call at.path,$(addsuffix /Makefile,$(at.subdirs/$(outdir)) $(at.depdirs/$(outdir)))),\ $(eval include $(filter-out $(_at.included_makefiles),$(makefile))))) # This bit only gets evaluated once, after all of the other Makefiles are read @@ -42,6 +46,6 @@ srcdir = /bogus $(foreach v,$(at.dirlocal),$(eval $v=)) -include $(wildcard $(topsrcdir)/build-aux/Makefile.once.tail/*.mk) +include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.tail/*.mk))) endif # _at.NO_ONCE -- cgit v1.2.2 From 00eedbd6178cd92409be08d62b395f92680858ef Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 31 May 2016 00:54:10 -0400 Subject: avoid prefixing things with ./ --- build-aux/Makefile.tail.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'build-aux/Makefile.tail.mk') diff --git a/build-aux/Makefile.tail.mk b/build-aux/Makefile.tail.mk index f7d42b9..dfbad5a 100644 --- a/build-aux/Makefile.tail.mk +++ b/build-aux/Makefile.tail.mk @@ -17,8 +17,8 @@ include $(call _at.reverse,$(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.tail/*.mk))) -at.subdirs := $(addprefix $(outdir)/,$(at.subdirs)) -at.depdirs := $(addprefix $(outdir)/,$(at.depdirs)) +at.subdirs := $(patsubst ./%,%,$(addprefix $(outdir)/,$(at.subdirs))) +at.depdirs := $(patsubst ./%,%,$(addprefix $(outdir)/,$(at.depdirs))) # Move all of the dirlocal variables to their namespaced version $(foreach v,$(at.dirlocal),$(eval $v/$(outdir) := $$($v))) -- cgit v1.2.2