diff mbox series

u-boot: set B = WORKDIR/build

Message ID 8424bf73dd44e1f8a9aa940b3956dcff9de6d458.1720172151.git.joerg.sommer@navimatix.de
State New
Headers show
Series u-boot: set B = WORKDIR/build | expand

Commit Message

Jörg Sommer July 5, 2024, 9:36 a.m. UTC
From: Jörg Sommer <joerg.sommer@navimatix.de>

The build of u-boot fails, if `UBOOT_MACHINE` (instead of `UBOOT_CONFIG`) is
used. U-boot doe not like the setting of `O=$S` in the make call, which
happen when `UBOOT_MACHINE` is used. Therefore, use a dedicated build
directory to circumvent the conflict `$B == $S`.

Yocto build message:

```
| if [ -f /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/.config -o -d /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/include/config ]; then \
| 	echo >&2 "  /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'"; \
| 	echo >&2 "  in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.";\
| 	/bin/false; \
| fi;
|   /build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git is not clean, please run 'make mrproper'
|   in the '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git' directory.
| make[1]: Leaving directory '/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git'
| make[1]: *** [/build/tmp/work/da850_funkwerk_rp1_eval_board-fwkos-linux-gnueabi/u-boot-variscite/1.0-r0.fwkos.6/git/Makefile:1928: prepare3] Error 1
| ERROR: oe_runmake failed
```

U-Boot test:

```
% 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 <joerg.sommer@navimatix.de>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 54ea2e9e50..2f808d659a 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -9,6 +9,8 @@  inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kerne
 
 DEPENDS += "swig-native"
 
+B = "${WORKDIR}/build"
+
 EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
 EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
 EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'