Skip to content
Snippets Groups Projects
Commit f432eb6d authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

env: Avoid using a leftover text-environment file

If include/generated/environment.h exists (perhaps leftover from a build
of another board) it is used, even if the board currently being built does
not have a text environment.

This causes a build error. Fix it by emptying the file if it should not be
there.

Fixes: https://source.denx.de/u-boot/u-boot/-/issues/9


Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reported-by: default avatarSean Anderson <seanga2@gmail.com>
Tested-by: default avatarSean Anderson <seanga2@gmail.com>
parent 64b78f57
No related branches found
No related tags found
No related merge requests found
...@@ -1833,7 +1833,9 @@ ENV_FILE := $(if $(ENV_SOURCE_FILE),$(ENV_FILE_CFG),$(wildcard $(ENV_FILE_BOARD) ...@@ -1833,7 +1833,9 @@ ENV_FILE := $(if $(ENV_SOURCE_FILE),$(ENV_FILE_CFG),$(wildcard $(ENV_FILE_BOARD)
# Run the environment text file through the preprocessor, but only if it is # Run the environment text file through the preprocessor, but only if it is
# non-empty, to save time and possible build errors if something is wonky with # non-empty, to save time and possible build errors if something is wonky with
# the board # the board.
# If there is no ENV_FILE, produce an empty output file, to prevent a previous
# build's file being used in the case of in-tree builds.
quiet_cmd_gen_envp = ENVP $@ quiet_cmd_gen_envp = ENVP $@
cmd_gen_envp = \ cmd_gen_envp = \
if [ -s "$(ENV_FILE)" ]; then \ if [ -s "$(ENV_FILE)" ]; then \
...@@ -1844,6 +1846,7 @@ quiet_cmd_gen_envp = ENVP $@ ...@@ -1844,6 +1846,7 @@ quiet_cmd_gen_envp = ENVP $@
-I$(srctree)/arch/$(ARCH)/include \ -I$(srctree)/arch/$(ARCH)/include \
$< -o $@; \ $< -o $@; \
else \ else \
rm $@; \
touch $@ ; \ touch $@ ; \
fi fi
include/generated/env.in: include/generated/env.txt FORCE include/generated/env.in: include/generated/env.txt FORCE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment