Skip to contentSkip to conversation

Makefile: Conditionally add defaultenv_h to envtools target

PATCH In review Joel Stanley 2 participants 2 messages Jun 18, 2021 – Jul 15, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Conditionally add defaultenv_h to envtools target

When building the envtools target with CONFIG_USE_DEFAULT_ENV_FILE=y, the tools require generated/defaultenv_autogenerated.h.

In file included from tools/env/fw_env.c:126:
include/env_default.h:115:10: fatal error: generated/defaultenv_autogenerated.h: No such file or directory
115 | #include "generated/defaultenv_autogenerated.h"

       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---
This is the minimal patch to fix the issue I was having building under Yocto, which explicitly builds the envtools target separate to the rest of u-boot. A similar change is probably required by the 'tools' target.

Alternatively, the tools and envtools could depend on a prepare target, such as prepare1, which includes all of the prerequisites that are listed.

 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -0
index a73481d18c14..e096dc999c42 100644
@@ -1871,6 +1871,8 @@ endif
 
 ifeq ($(CONFIG_USE_DEFAULT_ENV_FILE),y)
 prepare1: $(defaultenv_h)
+
+envtools: $(defaultenv_h)
 endif
 
 archprepare: prepare1 scripts_basic
Signature · 1 line
2.32.0
#1 lore raw
Quoted 9 lines · Joel Stanley

When building the envtools target with CONFIG_USE_DEFAULT_ENV_FILE=y, the tools require generated/defaultenv_autogenerated.h.

In file included from tools/env/fw_env.c:126:
include/env_default.h:115:10: fatal error: generated/defaultenv_autogenerated.h: No such file or directory
115 | #include "generated/defaultenv_autogenerated.h"

       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Applied to u-boot/master, thanks!

Signature · 1 line
Tom