From: Jörg Sommer <[email protected]>

The u-boot Makefile (even v2024.07) doesn't like it, when `O=…` is the same
directory as the source directory and complains about a dirty source
directory; see below. This happens when `UBOOT_MACHINE` is set and not
`UBOOT_CONFIG`.

```
% make O=$PWD all
make[1]: Entering directory '/home/joerg/git/u-boot'
  UPD     include/generated/timestamp_autogenerated.h
  Using /home/joerg/git/u-boot as source for U-Boot
  /home/joerg/git/u-boot is not clean, please run 'make mrproper'
  in the '/home/joerg/git/u-boot' directory.
make[1]: *** [/home/joerg/git/u-boot/Makefile:1928: prepare3] Error 1
make[1]: Leaving directory '/home/joerg/git/u-boot'
make: *** [Makefile:177: sub-make] Error 2
```

Signed-off-by: Jörg Sommer <[email protected]>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)


Would it be possible to get this patch into kirkstone and scarthgap?


diff --git a/meta/recipes-bsp/u-boot/u-boot.inc 
b/meta/recipes-bsp/u-boot/u-boot.inc
index fc36c21ec2..8172551c0c 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -82,11 +82,15 @@ do_compile () {
         done
         unset i
     else
-        oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
+        if [ "${S}" != "${B}" ]; then
+            O="O=${B}"
+        fi
+
+        oe_runmake -C ${S} ${O:+"$O"} ${UBOOT_MAKE_TARGET}
 
         # Generate the uboot-initial-env
         if [ -n "${UBOOT_INITIAL_ENV}" ]; then
-            oe_runmake -C ${S} O=${B} u-boot-initial-env
+            oe_runmake -C ${S} ${O:+"$O"} u-boot-initial-env
         fi
     fi
 
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#201584): 
https://lists.openembedded.org/g/openembedded-core/message/201584
Mute This Topic: https://lists.openembedded.org/mt/107043175/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to