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.head.mk | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 build-aux/Makefile.head.mk (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk new file mode 100644 index 0000000..e4ae329 --- /dev/null +++ b/build-aux/Makefile.head.mk @@ -0,0 +1,49 @@ +# 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 only gets evaluated once, at the very beginning +ifeq ($(_am_NO_ONCE),) + +_am = am_ + +_am_noslash = $(patsubst %/.,%,$(patsubst %/,%,$1)) +# These are all $(call _am_func,parent,child) +#_am_relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2)) +_am_is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.) +_am_relto_helper = $(if $(call _am_is_subdir,$1,$2),$(patsubst $1/%,%,$(addsuffix /.,$2)),$(addprefix ../,$(call _am_relto_helper,$(patsubst %/,%,$(dir $1)),$2))) +_am_relto = $(call _am_noslash,$(call _am_relto_helper,$(call _am_noslash,$(abspath $1)),$(call _am_noslash,$(abspath $2)))) +# Note that _am_is_subdir says that a directory is a subdirectory of +# itself. +am_path = $(foreach p,$1,$(call _am_relto,.,$p)) + +$(_am)dirlocal += $(_am)subdirs +$(_am)dirlocal += $(_am)depdirs + +include $(topsrcdir)/common.once.head.mk + +endif # _am_NO_ONCE + +# This bit gets evaluated for each Makefile + +## Set outdir and srcdir (assumes that topoutdir and topsrcdir are +## already set) +outdir := $(call am_path,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) +srcdir := $(call am_path,$(topsrcdir)/$(call _am_relto,$(topoutdir),$(outdir))) + +_am_included_makefiles := $(_am_included_makefiles) $(call am_path,$(outdir)/Makefile) + +$(foreach v,$($(_am)dirlocal),$(eval $v=)) + +include $(topsrcdir)/common.each.head.mk -- cgit v1.2.3 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.head.mk | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index e4ae329..e5ef379 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -14,36 +14,39 @@ # along with this program. If not, see . # This bit only gets evaluated once, at the very beginning -ifeq ($(_am_NO_ONCE),) +ifeq ($(_at.NO_ONCE),) + +_at.noslash = $(patsubst %/.,%,$(patsubst %/,%,$1)) +# These are all $(call _at.func,parent,child) +#_at.relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2)) +_at.is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.) +_at.relto_helper = $(if $(call _at.is_subdir,$1,$2),$(patsubst $1/%,%,$(addsuffix /.,$2)),$(addprefix ../,$(call _at.relto_helper,$(patsubst %/,%,$(dir $1)),$2))) +_at.relto = $(call _at.noslash,$(call _at.relto_helper,$(call _at.noslash,$(abspath $1)),$(call _at.noslash,$(abspath $2)))) +# Note that _at.is_subdir says that a directory is a subdirectory of +# itself. +at.path = $(foreach p,$1,$(call _at.relto,.,$p)) -_am = am_ +define at.nl -_am_noslash = $(patsubst %/.,%,$(patsubst %/,%,$1)) -# These are all $(call _am_func,parent,child) -#_am_relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2)) -_am_is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.) -_am_relto_helper = $(if $(call _am_is_subdir,$1,$2),$(patsubst $1/%,%,$(addsuffix /.,$2)),$(addprefix ../,$(call _am_relto_helper,$(patsubst %/,%,$(dir $1)),$2))) -_am_relto = $(call _am_noslash,$(call _am_relto_helper,$(call _am_noslash,$(abspath $1)),$(call _am_noslash,$(abspath $2)))) -# Note that _am_is_subdir says that a directory is a subdirectory of -# itself. -am_path = $(foreach p,$1,$(call _am_relto,.,$p)) -$(_am)dirlocal += $(_am)subdirs -$(_am)dirlocal += $(_am)depdirs +endef + +at.dirlocal += at.subdirs +at.dirlocal += at.depdirs include $(topsrcdir)/common.once.head.mk -endif # _am_NO_ONCE +endif # _at.NO_ONCE # This bit gets evaluated for each Makefile ## Set outdir and srcdir (assumes that topoutdir and topsrcdir are ## already set) -outdir := $(call am_path,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) -srcdir := $(call am_path,$(topsrcdir)/$(call _am_relto,$(topoutdir),$(outdir))) +outdir := $(call at.path,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) +srcdir := $(call at.path,$(topsrcdir)/$(call _at.relto,$(topoutdir),$(outdir))) -_am_included_makefiles := $(_am_included_makefiles) $(call am_path,$(outdir)/Makefile) +_at.included_makefiles := $(_at.included_makefiles) $(call at.path,$(outdir)/Makefile) -$(foreach v,$($(_am)dirlocal),$(eval $v=)) +$(foreach v,$(at.dirlocal),$(eval $v=)) include $(topsrcdir)/common.each.head.mk -- cgit v1.2.3 From 0b3959406003cb61c9d10e2f1d45c755ec700392 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 29 May 2016 18:39:41 -0400 Subject: add checks that top{src,out}dir are set --- build-aux/Makefile.head.mk | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index e5ef379..c680f41 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -16,6 +16,13 @@ # This bit only gets evaluated once, at the very beginning ifeq ($(_at.NO_ONCE),) +ifeq ($(topsrcdir),) +$(error topsrcdir must be set before including Makefile.head.mk) +endif +ifeq ($(topoutdir),) +$(error topoutdir must be set before including Makefile.head.mk) +endif + _at.noslash = $(patsubst %/.,%,$(patsubst %/,%,$1)) # These are all $(call _at.func,parent,child) #_at.relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2)) -- cgit v1.2.3 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.head.mk | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index c680f41..63a3462 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -25,23 +25,27 @@ endif _at.noslash = $(patsubst %/.,%,$(patsubst %/,%,$1)) # These are all $(call _at.func,parent,child) -#_at.relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2)) +#at.relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2)) _at.is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.) _at.relto_helper = $(if $(call _at.is_subdir,$1,$2),$(patsubst $1/%,%,$(addsuffix /.,$2)),$(addprefix ../,$(call _at.relto_helper,$(patsubst %/,%,$(dir $1)),$2))) _at.relto = $(call _at.noslash,$(call _at.relto_helper,$(call _at.noslash,$(abspath $1)),$(call _at.noslash,$(abspath $2)))) +at.relto = $(foreach p,$2,$(call _at.relto,$1,$p)) # Note that _at.is_subdir says that a directory is a subdirectory of # itself. -at.path = $(foreach p,$1,$(call _at.relto,.,$p)) +at.path = $(call at.relto,.,$1) define at.nl endef +_at.rest = $(wordlist 2,$(words $1),$1) +_at.reverse = $(if $1,$(call _at.reverse,$(_at.rest))) $(firstword $1) + at.dirlocal += at.subdirs at.dirlocal += at.depdirs -include $(topsrcdir)/common.once.head.mk +include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.head/*.mk)) endif # _at.NO_ONCE @@ -56,4 +60,4 @@ _at.included_makefiles := $(_at.included_makefiles) $(call at.path,$(outdir)/Mak $(foreach v,$(at.dirlocal),$(eval $v=)) -include $(topsrcdir)/common.each.head.mk +include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.head/*.mk)) -- cgit v1.2.3 From f602c8fe063392e9f38390c6eb0816bef85063ac Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 12 Jun 2016 11:12:23 -0400 Subject: (systemd) add at.addprefix, a safe root-aware addprefix for directories --- build-aux/Makefile.head.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index 63a3462..47c17c9 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -34,11 +34,16 @@ at.relto = $(foreach p,$2,$(call _at.relto,$1,$p)) # itself. at.path = $(call at.relto,.,$1) +_at.addprefix = $(if $(filter /%,$2),$2,$1/$2) +at.addprefix = $(call at.path,$(foreach f,$2, $(call _at.addprefix,$1,$f) )) + define at.nl endef +at.Makefile ?= Makefile + _at.rest = $(wordlist 2,$(words $1),$1) _at.reverse = $(if $1,$(call _at.reverse,$(_at.rest))) $(firstword $1) @@ -56,7 +61,7 @@ endif # _at.NO_ONCE outdir := $(call at.path,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) srcdir := $(call at.path,$(topsrcdir)/$(call _at.relto,$(topoutdir),$(outdir))) -_at.included_makefiles := $(_at.included_makefiles) $(call at.path,$(outdir)/Makefile) +_at.included_makefiles := $(_at.included_makefiles) $(call at.path,$(outdir)/$(at.Makefile)) $(foreach v,$(at.dirlocal),$(eval $v=)) -- cgit v1.2.3 From 893a5768ae55d8f739eb3e61f52494741495a625 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 12 Jun 2016 11:29:44 -0400 Subject: (systemd) at.addprefix: fix --- build-aux/Makefile.head.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index 47c17c9..11b1374 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -35,7 +35,7 @@ at.relto = $(foreach p,$2,$(call _at.relto,$1,$p)) at.path = $(call at.relto,.,$1) _at.addprefix = $(if $(filter /%,$2),$2,$1/$2) -at.addprefix = $(call at.path,$(foreach f,$2, $(call _at.addprefix,$1,$f) )) +at.addprefix = $(foreach f,$2, $(addsuffix $(if $(filter %/,$f),/),$(call at.path,$(call _at.addprefix,$1,$f)) )) define at.nl -- cgit v1.2.3 From 7c52645f1dcf5274d05990a25024d652934737cd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 12 Jun 2016 14:40:34 -0400 Subject: (systemd) fix --- build-aux/Makefile.head.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index 11b1374..36c2c0a 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -14,7 +14,7 @@ # along with this program. If not, see . # This bit only gets evaluated once, at the very beginning -ifeq ($(_at.NO_ONCE),) +ifeq ($(origin _at.NO_ONCE),undefined) ifeq ($(topsrcdir),) $(error topsrcdir must be set before including Makefile.head.mk) @@ -50,6 +50,9 @@ _at.reverse = $(if $1,$(call _at.reverse,$(_at.rest))) $(firstword $1) at.dirlocal += at.subdirs at.dirlocal += at.depdirs +_at.outdirs ?= +_at.included_makefiles ?= + include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.head/*.mk)) endif # _at.NO_ONCE -- cgit v1.2.3 From 8a5ecbb4fcaf0d9864074666a45d9263b73f31b8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 7 Aug 2016 21:03:44 -0400 Subject: (systemd) stuff --- build-aux/Makefile.head.mk | 101 ++++++++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 29 deletions(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index 36c2c0a..8213043 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -12,60 +12,103 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . + +_at.MAKEFILE_LIST ?= +_at.MAKEFILE_LIST := $(strip $(_at.MAKEFILE_LIST) $(abspath $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) # This bit only gets evaluated once, at the very beginning ifeq ($(origin _at.NO_ONCE),undefined) +# Internal functions ################################################### + +# These 4 functions are all $(call _at.func,parent,child) +_at.is_strict_subdir = $(filter $(abspath $1)/%,$(abspath $2)) +_at.is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.) +_at.relbase = $(strip \ + $(if $(call _at.is_subdir,$1,$2), \ + $(patsubst $(abspath $1)/%,%,$(abspath $2)/.), \ + $(abspath $2))) +_at.relto = $(strip \ + $(if $(call _at.is_subdir,$1,$2), \ + $(patsubst $(abspath $1)/%,%,$(abspath $2)/.), \ + ../$(call _at.relto,$(dir $1),$2))) + +# These 3 functions only take one operand; we define public multi-operand +# versions below. +_at.path = $(strip \ + $(if $(call _at.is_subdir,$(topoutdir),$1), \ + $(patsubst %/.,%,$(topoutdir)/$(call _at.relto,.,$1)), \ + $(if $(call _at.is_subdir,$(topsrcdir),$1), \ + $(patsubst %/.,%,$(topsrcdir)/$(call _at.relto,$(topsrcdir),$1)), \ + $(abspath $1)))) +_at.out2src = $(call _at.path,$(if $(call _at.is_subdir,$(topoutdir),$1),$(topsrcdir)/$(call _at.path,$1),$1)) +_at.addprefix = $(call _at.path,$(if $(filter-out /%,$2),$1/$2,$2)) + +_at.rest = $(wordlist 2,$(words $1),$1) +_at.reverse = $(if $1,$(call _at.reverse,$(_at.rest))) $(firstword $1) + +# Sanity checking ###################################################### +ifeq ($(filter undefine,$(.FEATURES)),) +$(error Autothing: We need a version of Make that supports 'undefine') +endif ifeq ($(topsrcdir),) -$(error topsrcdir must be set before including Makefile.head.mk) +$(error Autothing: topsrcdir must be set (and non-empty) before including Makefile.head.mk) endif ifeq ($(topoutdir),) -$(error topoutdir must be set before including Makefile.head.mk) +$(error Autothing: topoutdir must be set (and non-empty) before including Makefile.head.mk) endif +ifneq ($(call _at.is_strict_subdir,$(topoutdir),$(topsrcdir)),) +$(error Autothing: topsrcdir=$(topsrcdir) must not be a subdirectory of topoutdir=$(topoutdir)) +endif + +# Internal setup ####################################################### -_at.noslash = $(patsubst %/.,%,$(patsubst %/,%,$1)) -# These are all $(call _at.func,parent,child) -#at.relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2)) -_at.is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.) -_at.relto_helper = $(if $(call _at.is_subdir,$1,$2),$(patsubst $1/%,%,$(addsuffix /.,$2)),$(addprefix ../,$(call _at.relto_helper,$(patsubst %/,%,$(dir $1)),$2))) -_at.relto = $(call _at.noslash,$(call _at.relto_helper,$(call _at.noslash,$(abspath $1)),$(call _at.noslash,$(abspath $2)))) -at.relto = $(foreach p,$2,$(call _at.relto,$1,$p)) -# Note that _at.is_subdir says that a directory is a subdirectory of -# itself. -at.path = $(call at.relto,.,$1) +# External provisions ################################################## -_at.addprefix = $(if $(filter /%,$2),$2,$1/$2) -at.addprefix = $(foreach f,$2, $(addsuffix $(if $(filter %/,$f),/),$(call at.path,$(call _at.addprefix,$1,$f)) )) +# These 4 functions are all $(call _at.func,parent,child) +at.is_subdir = $(_at.is_subdir) +at.is_strict_subdir = $(_at.is_strict_subdir) +#at.relbase = $(if $2,$(shell realpath -sm --relative-base=$1 -- $2)) +at.relbase = $(foreach _at.tmp,$2,$(call _at.relbase,$1,$(_at.tmp))) +#at.relto = $(if $2,$(shell realpath -sm --relative-to=$1 -- $2)) +at.relto = $(foreach _at.tmp,$2,$(call _at.relto,$1,$(_at.tmp))) + +at.path = $(foreach _at.tmp,$1,$(call _at.path,$(_at.tmp))) +at.out2src = $(foreach _at.tmp,$1,$(call _at.out2src,$(_at.tmp))) +at.addprefix = $(foreach _at.tmp,$2,$(call _at.addprefix,$1,$(_at.tmp))) define at.nl endef +# External configuration ############################################### at.Makefile ?= Makefile -_at.rest = $(wordlist 2,$(words $1),$1) -_at.reverse = $(if $1,$(call _at.reverse,$(_at.rest))) $(firstword $1) - -at.dirlocal += at.subdirs -at.dirlocal += at.depdirs - -_at.outdirs ?= -_at.included_makefiles ?= - +# Include modules ###################################################### include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.head/*.mk)) +_at.tmp_targets = +_at.tmp_subdirs = +_at.VARIABLES = +_at.VARIABLES := $(.VARIABLES) endif # _at.NO_ONCE # This bit gets evaluated for each Makefile -## Set outdir and srcdir (assumes that topoutdir and topsrcdir are -## already set) -outdir := $(call at.path,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) -srcdir := $(call at.path,$(topsrcdir)/$(call _at.relto,$(topoutdir),$(outdir))) +outdir := $(call _at.path,$(dir $(lastword $(_at.MAKEFILE_LIST)))) +ifeq ($(call _at.is_subdir,$(topoutdir),$(outdir)),) +$(error Autothing: not a subdirectory of topoutdir=$(topoutdir): $(outdir)) +endif -_at.included_makefiles := $(_at.included_makefiles) $(call at.path,$(outdir)/$(at.Makefile)) +# Don't use at.out2src because we *know* that $(outdir) is inside $(topoutdir), +# and has already had $(_at.path) called on it. +srcdir := $(call _at.path,$(topsrcdir)/$(outdir)) +ifeq ($(call _at.is_subdir,$(topsrcdir),$(srcdir)),) +$(error Autothing: not a subdirectory of topsrcdir=$(topsrcdir): $(srcdir)) +endif -$(foreach v,$(at.dirlocal),$(eval $v=)) +at.subdirs = +at.targets = include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.each.head/*.mk)) -- cgit v1.2.3 From bf8f76973a833659ce4ac730c4918c382192d3e0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 8 Aug 2016 01:09:59 -0400 Subject: (systemd) speed up --- build-aux/Makefile.head.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index 8213043..105432c 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -47,6 +47,10 @@ _at.addprefix = $(call _at.path,$(if $(filter-out /%,$2),$1/$2,$2)) _at.rest = $(wordlist 2,$(words $1),$1) _at.reverse = $(if $1,$(call _at.reverse,$(_at.rest))) $(firstword $1) +_at.target_variable = $(_at.target_variable.$(flavor $2)) +_at.target_variable.recursive = $1: private $2 = $(subst $(at.nl),$$(at.nl),$(value $2)) +_at.target_variable.simple = $1: private $2 := $$($2) + # Sanity checking ###################################################### ifeq ($(filter undefine,$(.FEATURES)),) $(error Autothing: We need a version of Make that supports 'undefine') @@ -61,8 +65,6 @@ ifneq ($(call _at.is_strict_subdir,$(topoutdir),$(topsrcdir)),) $(error Autothing: topsrcdir=$(topsrcdir) must not be a subdirectory of topoutdir=$(topoutdir)) endif -# Internal setup ####################################################### - # External provisions ################################################## # These 4 functions are all $(call _at.func,parent,child) -- cgit v1.2.3 From 88d181c25d2f99f8b510afe2f2cc7e1ba1fa012c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Aug 2016 11:22:38 -0400 Subject: (systemd) fix build system --- build-aux/Makefile.head.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index 105432c..c2ce307 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -24,13 +24,13 @@ ifeq ($(origin _at.NO_ONCE),undefined) # These 4 functions are all $(call _at.func,parent,child) _at.is_strict_subdir = $(filter $(abspath $1)/%,$(abspath $2)) _at.is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.) -_at.relbase = $(strip \ - $(if $(call _at.is_subdir,$1,$2), \ - $(patsubst $(abspath $1)/%,%,$(abspath $2)/.), \ +_at.relbase = $(strip \ + $(if $(call _at.is_subdir,$1,$2), \ + $(patsubst %/.,$(patsubst $(abspath $1)/%,%,$(abspath $2)/.)), \ $(abspath $2))) -_at.relto = $(strip \ - $(if $(call _at.is_subdir,$1,$2), \ - $(patsubst $(abspath $1)/%,%,$(abspath $2)/.), \ +_at.relto = $(strip \ + $(if $(call _at.is_subdir,$1,$2), \ + $(patsubst %/.,%,$(patsubst $(abspath $1)/%,%,$(abspath $2)/.)), \ ../$(call _at.relto,$(dir $1),$2))) # These 3 functions only take one operand; we define public multi-operand @@ -51,6 +51,8 @@ _at.target_variable = $(_at.target_variable.$(flavor $2)) _at.target_variable.recursive = $1: private $2 = $(subst $(at.nl),$$(at.nl),$(value $2)) _at.target_variable.simple = $1: private $2 := $$($2) +_at.quote-pattern = $(subst %,\%,$(subst \,\\,$1)) + # Sanity checking ###################################################### ifeq ($(filter undefine,$(.FEATURES)),) $(error Autothing: We need a version of Make that supports 'undefine') -- cgit v1.2.3 From 106c6cf6365794dd9bc6315358d12a5d4400a586 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 16 Jan 2017 19:24:18 -0500 Subject: core: Derp, the at.relbase function was broken. --- build-aux/Makefile.head.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index c2ce307..e6b4a19 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.mk @@ -24,9 +24,9 @@ ifeq ($(origin _at.NO_ONCE),undefined) # These 4 functions are all $(call _at.func,parent,child) _at.is_strict_subdir = $(filter $(abspath $1)/%,$(abspath $2)) _at.is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.) -_at.relbase = $(strip \ - $(if $(call _at.is_subdir,$1,$2), \ - $(patsubst %/.,$(patsubst $(abspath $1)/%,%,$(abspath $2)/.)), \ +_at.relbase = $(strip \ + $(if $(call _at.is_subdir,$1,$2), \ + $(patsubst %/.,%,$(patsubst $(abspath $1)/%,%,$(abspath $2)/.)), \ $(abspath $2))) _at.relto = $(strip \ $(if $(call _at.is_subdir,$1,$2), \ -- cgit v1.2.3 From dd98e1c994520acc817d3dfa651ccf291827630d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 17 Jan 2017 02:20:31 -0500 Subject: Backport fixes from work on parabola-hackers.git. - core: Actually support at.Makefile; how it set the internal variable _at.MAKEFILE_LIST was broken if $(at.Makefile) != Makefile - mod: dist: * Don't try to distribute $(files.src.int) files. * Add a comment noting that the lack of the `-P` flag to `cp` is not a bug. - mod: gitfiles: * Correctly list files in $(topsrcdir). * Also enumerate files in git submodules. --- build-aux/Makefile.head.mk | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'build-aux/Makefile.head.mk') diff --git a/build-aux/Makefile.head.mk b/build-aux/Makefile.head.mk index e6b4a19..f4eb51d 100644 --- a/build-aux/Makefile.head.mk +++ b/build-aux/Makefile.head.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 @@ -13,8 +13,9 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +at.Makefile ?= Makefile _at.MAKEFILE_LIST ?= -_at.MAKEFILE_LIST := $(strip $(_at.MAKEFILE_LIST) $(abspath $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) +_at.MAKEFILE_LIST := $(strip $(_at.MAKEFILE_LIST) $(lastword $(filter %/$(at.Makefile),$(abspath $(MAKEFILE_LIST))))) # This bit only gets evaluated once, at the very beginning ifeq ($(origin _at.NO_ONCE),undefined) @@ -86,9 +87,6 @@ define at.nl endef -# External configuration ############################################### -at.Makefile ?= Makefile - # Include modules ###################################################### include $(sort $(wildcard $(topsrcdir)/build-aux/Makefile.once.head/*.mk)) _at.tmp_targets = -- cgit v1.2.3