diff mbox

kbuild: Create directory for target DTB

Message ID eeaee5ea1dc1082db84c91567a9fe6260138512e.1425562715.git.michal.simek@xilinx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Simek March 5, 2015, 1:38 p.m. UTC
From: Nathan Rossi <nathan.rossi@xilinx.com>

When building specific DTBs out of the kernel tree the vendor subdirs
(boot/dts/<vendor>) are not created, ensure that they are before
building the DTB.

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Problem is visible with arm64 for out of tree builds.
make O=/tmp/kkk/ defconfig
make O=/tmp/kkk/ cavium/thunder-88xx.dtb

  DTC     arch/arm64/boot/dts/cavium/thunder-88xx.dtb
cc1: fatal error: opening output file
arch/arm64/boot/dts/cavium/.thunder-88xx.dtb.dts.tmp: No such file or
directory
compilation terminated.
make[2]: *** [arch/arm64/boot/dts/cavium/thunder-88xx.dtb] Error 1
make[1]: *** [cavium/thunder-88xx.dtb] Error 2

Building specific dtb target on arm32 is working fine
make O=/tmp/kkk4/ multi_v7_defconfig
make O=/tmp/kkk4/ zynq-zc702.dtb

This is the way how Yocto is building dtb for specific target.
---
 scripts/Makefile.lib | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Will Deacon March 17, 2015, 10:33 a.m. UTC | #1
On Thu, Mar 05, 2015 at 01:38:41PM +0000, Michal Simek wrote:
> From: Nathan Rossi <nathan.rossi@xilinx.com>
> 
> When building specific DTBs out of the kernel tree the vendor subdirs
> (boot/dts/<vendor>) are not created, ensure that they are before
> building the DTB.
> 
> Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Problem is visible with arm64 for out of tree builds.
> make O=/tmp/kkk/ defconfig
> make O=/tmp/kkk/ cavium/thunder-88xx.dtb
> 
>   DTC     arch/arm64/boot/dts/cavium/thunder-88xx.dtb
> cc1: fatal error: opening output file
> arch/arm64/boot/dts/cavium/.thunder-88xx.dtb.dts.tmp: No such file or
> directory
> compilation terminated.
> make[2]: *** [arch/arm64/boot/dts/cavium/thunder-88xx.dtb] Error 1
> make[1]: *** [cavium/thunder-88xx.dtb] Error 2
> 
> Building specific dtb target on arm32 is working fine
> make O=/tmp/kkk4/ multi_v7_defconfig
> make O=/tmp/kkk4/ zynq-zc702.dtb
> 
> This is the way how Yocto is building dtb for specific target.
> ---
>  scripts/Makefile.lib | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 044eb4f89a91..6e3356005ec4 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -282,7 +282,8 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
>  	$(call cmd,dt_S_dtb)
>  
>  quiet_cmd_dtc = DTC     $@
> -cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
> +cmd_dtc = mkdir -p `dirname ${dtc-tmp}` ; \

The backticks are fairly gross here, can you use something like $(dir
${dtc-tmp}) instead?

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 044eb4f89a91..6e3356005ec4 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -282,7 +282,8 @@  $(obj)/%.dtb.S: $(obj)/%.dtb
 	$(call cmd,dt_S_dtb)
 
 quiet_cmd_dtc = DTC     $@
-cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+cmd_dtc = mkdir -p `dirname ${dtc-tmp}` ; \
+	$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
 	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
 		-i $(dir $<) $(DTC_FLAGS) \
 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \