From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleksandr Suvorov Date: Tue, 20 Apr 2021 17:43:00 +0300 Subject: [PATCH v2] Makefile: fix generating environment file Message-ID: <20210420144300.103757-1-oleksandr.suvorov@toradex.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de If the CONFIG_USE_DEFAULT_ENV_FILE=y and CONFIG_DEFAULT_ENV_FILE points to the empty environment file, the auto-generated file has the wrong syntax so it leads to the compilation failure: In file included from include/env_default.h:115, from env/common.c:29: include/generated/defaultenv_autogenerated.h:1:1: error: expected expression before ?,? token 1 | , 0x00 | ^ make[1]: *** [scripts/Makefile.build:266: env/common.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:1744: env] Error 2 Fix this issue conditionally adding the delimiter ", ". Signed-off-by: Oleksandr Suvorov --- Changes in v2: - Fix the hex-decimal class matching. Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e423f6de746..4e0a9b51cb7 100644 --- a/Makefile +++ b/Makefile @@ -1853,7 +1853,9 @@ define filechk_defaultenv.h grep -v '^$$' | \ tr '\n' '\0' | \ sed -e 's/\\\x0\s*//g' | \ - xxd -i ; echo ", 0x00" ; ) + xxd -i | \ + sed -r 's/([0-9a-f])$$/\1, /'; \ + echo "0x00" ; ) endef define filechk_dt.h -- 2.31.1