[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241015212830.3899891-1-chris.packham@alliedtelesis.co.nz>
Date: Wed, 16 Oct 2024 10:28:30 +1300
From: Chris Packham <chris.packham@...iedtelesis.co.nz>
To: masahiroy@...nel.org,
nathan@...nel.org,
nicolas@...sle.eu
Cc: linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chris Packham <chris.packham@...iedtelesis.co.nz>
Subject: [PATCH] kbuild: Restore the ability to build out of tree dtbs
A build pattern to handle out of tree dtbs is to copy the .dts file into
the kernel source tree and run `make myboard.dtb`. This is supported by
the wildcard %.dtb rule in the Makefile but recent changes to split the
dtb handling out of scripts/Makefile.build stopped this from working.
Restore this functionality by looking for the relevant file extensions
in $(MAKECMDGOALS) instead of $(targets).
Fixes: e7e2941300d2 ("kbuild: split device tree build rules into scripts/Makefile.dtbs")
Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
---
Notes:
This seems to address the problem building out of tree dtbs. I think it
is correct because as far as I can tell nothing will pull .dtb and
friends into $(targets) and we explicity check for a non-empty $(dtb-y).
scripts/Makefile.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 8f423a1faf50..58404c1c5eda 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -449,7 +449,7 @@ ifneq ($(userprogs),)
include $(srctree)/scripts/Makefile.userprogs
endif
-ifneq ($(need-dtbslist)$(dtb-y)$(dtb-)$(filter %.dtb %.dtb.o %.dtbo.o,$(targets)),)
+ifneq ($(need-dtbslist)$(dtb-y)$(dtb-)$(filter %.dtb %.dtb.o %.dtbo.o,$(MAKECMDGOALS)),)
include $(srctree)/scripts/Makefile.dtbs
endif
--
2.47.0
Powered by blists - more mailing lists