summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-04 21:17:13 -0700
committerBin Meng <bmeng.cn@gmail.com>2021-02-06 19:18:41 +0800
commit68f6a90ec27c46f804f7ee5a2e736fb2c24f71de (patch)
tree260b2bb5be30dc130ec20313d73ffd8107246f71 /Makefile
parent9b95f3f7ffb77fd53b2fad7197de2b379f7fac3e (diff)
downloadu-boot-68f6a90ec27c46f804f7ee5a2e736fb2c24f71de.tar.gz
u-boot-68f6a90ec27c46f804f7ee5a2e736fb2c24f71de.tar.xz
u-boot-68f6a90ec27c46f804f7ee5a2e736fb2c24f71de.zip
Makefile: Provide numeric versions
For SMBIOS we want to store the numeric version numbers in the tables. It does not make sense to parse the strings. Instead, add new #defines with the version and patchlevel. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 23dd11f723..ebbedb1fb1 100644
--- a/Makefile
+++ b/Makefile
@@ -1853,9 +1853,13 @@ prepare: prepare0
# Generate some files
# ---------------------------------------------------------------------------
+# Use sed to remove leading zeros from PATCHLEVEL to avoid using octal numbers
define filechk_version.h
(echo \#define PLAIN_VERSION \"$(UBOOTRELEASE)\"; \
echo \#define U_BOOT_VERSION \"U-Boot \" PLAIN_VERSION; \
+ echo \#define U_BOOT_VERSION_NUM $(VERSION); \
+ echo \#define U_BOOT_VERSION_NUM_PATCH $$(echo $(PATCHLEVEL) | \
+ sed -e "s/^0*//"); \
echo \#define CC_VERSION_STRING \"$$(LC_ALL=C $(CC) --version | head -n 1)\"; \
echo \#define LD_VERSION_STRING \"$$(LC_ALL=C $(LD) --version | head -n 1)\"; )
endef