diff options
author | Simon Glass <sjg@chromium.org> | 2022-03-11 22:37:23 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-03-31 21:18:51 -0400 |
commit | f432eb6d8a9d8a9382f6e7f0096fb4ee4672b8e8 (patch) | |
tree | d29dbc30c585a9193d27de1d1e753da48f2ca03f /Makefile | |
parent | 64b78f5721e65e96ea5a3d100d46b2e6fda722df (diff) | |
download | u-boot-f432eb6d8a9d8a9382f6e7f0096fb4ee4672b8e8.zip u-boot-f432eb6d8a9d8a9382f6e7f0096fb4ee4672b8e8.tar.gz u-boot-f432eb6d8a9d8a9382f6e7f0096fb4ee4672b8e8.tar.bz2 |
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: Simon Glass <sjg@chromium.org>
Reported-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Sean Anderson <seanga2@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 # 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 $@ cmd_gen_envp = \ if [ -s "$(ENV_FILE)" ]; then \ @@ -1844,6 +1846,7 @@ quiet_cmd_gen_envp = ENVP $@ -I$(srctree)/arch/$(ARCH)/include \ $< -o $@; \ else \ + rm $@; \ touch $@ ; \ fi include/generated/env.in: include/generated/env.txt FORCE |