From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leonard Crestez Subject: [PATCH 1/3] kbuild: Add wilddt function Date: Mon, 7 Jan 2019 19:31:26 +0000 Message-ID: <7fe1bbe77ddec38678a60e75512dabdd7e97ab1c.1546888138.git.leonard.crestez@nxp.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Masahiro Yamada , Rob Herring , Olof Johansson , Shawn Guo Cc: Michal Marek , Fabio Estevam , Mark Rutland , Aisheng Dong , Leo Li , "linux-kbuild@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , dl-linux-imx , "kernel@pengutronix.de" , "linux-kernel@vger.kernel.org" List-Id: devicetree@vger.kernel.org Many SOCs have very simple naming conventions for all boards using a certain chip and long dtb lists can be collapsed using wildcards. Since this applied to many architectures add a wilddt function to Kbuild.include. Example usage: dtb-$CONFIG_SOC_ABC123 +=3D $(call wilddt,abc123-*) Signed-off-by: Leonard Crestez --- scripts/Kbuild.include | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 46bf1a073f5d..6b8c0cca07c1 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -197,10 +197,16 @@ clean :=3D -f $(srctree)/scripts/Makefile.clean obj # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.headersinst obj=3D # Usage: # $(Q)$(MAKE) $(hdr-inst)=3Ddir hdr-inst :=3D -f $(srctree)/scripts/Makefile.headersinst obj =20 +### +# Return list of .dtb for all .dts matching $1 in current directory +# +# Example usage: dtb-$CONFIG_SOC_ABC123 +=3D $(call wilddt,abc123-*) +wilddt =3D $(patsubst $(srctree)/$(src)/%.dts,%.dtb, $(wildcard $(srctree)= /$(src)/$(1).dts)) + # Prefix -I with $(srctree) if it is not an absolute path. # skip if -I has no parameter addtree =3D $(if $(patsubst -I%,%,$(1)), \ $(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(= 1)),$(1)),$(1)) =20 --=20 2.17.1