This makes it easy to depend on the kernel.targetinstall stage by
depending on one of the .dtb's that it installs into the image dir, e.g.
when building a custom recipe for a FIT image. As a nice side-effect,
you can simply call "ptxdist image <board.dtb>" to build the device
tree.

Signed-off-by: Roland Hieber <r...@pengutronix.de>
---
PATCH v3:
 * do the same for the kernel template

PATCH v2: 
https://lore.ptxdist.org/ptxdist/20230831104425.2874985-1-...@pengutronix.de
 * change ifneq syntax

PATCH v1: 
https://lore.ptxdist.org/ptxdist/20230822121234.2040303-1-...@pengutronix.de
---
 rules/kernel.make                    | 4 ++++
 rules/templates/template-kernel-make | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/rules/kernel.make b/rules/kernel.make
index 59ecdf19973f..7b1c663ffb7d 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -283,6 +283,10 @@ endif
 # Target-Install
 # ----------------------------------------------------------------------------
 
+ifneq ($(KERNEL_DTB_FILES),)
+$(addprefix $(IMAGEDIR)/,$(KERNEL_DTB_FILES)): $(STATEDIR)/kernel.targetinstall
+endif
+
 $(STATEDIR)/kernel.targetinstall:
        @$(call targetinfo)
 
diff --git a/rules/templates/template-kernel-make 
b/rules/templates/template-kernel-make
index c5f0c9303b51..cd1b717c51ba 100644
--- a/rules/templates/template-kernel-make
+++ b/rules/templates/template-kernel-make
@@ -106,6 +106,10 @@ $(STATEDIR)/kernel-@package@.install:
 # Target-Install
 # ----------------------------------------------------------------------------
 
+ifneq ($(KERNEL_@PACKAGE@_DTB_FILES),)
+$(addprefix $(IMAGEDIR)/,$(KERNEL_@PACKAGE@_DTB_FILES)): 
$(STATEDIR)/kernel-@package@.targetinstall
+endif
+
 $(STATEDIR)/kernel-@package@.targetinstall:
        @$(call targetinfo)
 
-- 
2.39.2


Reply via email to