All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 02/10] Makefile: Provide numeric versions
Date: Wed,  6 Jan 2021 21:21:54 -0700	[thread overview]
Message-ID: <20210106212153.2.I9efe8832e785f28cb7c4bb98d6df6322fc756150@changeid> (raw)
In-Reply-To: <20210107042202.2600568-1-sjg@chromium.org>

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>
---

 Makefile | 4 ++++
 README   | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/Makefile b/Makefile
index 110296be82f..c2b7046ce3b 100644
--- a/Makefile
+++ b/Makefile
@@ -1846,9 +1846,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
diff --git a/README b/README
index 02ed0504455..afa33dc7f30 100644
--- a/README
+++ b/README
@@ -1898,6 +1898,14 @@ The following options need to be configured:
 			     U-Boot 2020.10 (Jan 06 2021 - 08:50:36 -0700)
                              U-Boot 2021.01-rc5-00248-g60dd854f3ba-dirty (Jan 06 2021 - 08:50:36 -0700) for spring
 
+		  U_BOOT_VERSION_NUM (integer #define)
+			  Release year, e.g. 2021 for release 2021.01. Note
+			  this is an integer, not a string.
+
+		  U_BOOT_VERSION_NUM_PATCH (integer #define)
+			  Patch number, e.g. 1 for release 2020.01. Note
+			  this is an integer, not a string.
+
 		Build date/time is also included. See the generated file
 		include/generated/timestamp_autogenerated.h for the available
 		fields. For example:
-- 
2.29.2.729.g45daf8777d-goog

  parent reply	other threads:[~2021-01-07  4:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07  4:21 [PATCH 00/10] smbios: Enhancements for more flexibility Simon Glass
2021-01-07  4:21 ` [PATCH 01/10] README: Add doumentation for version information Simon Glass
2021-02-08 13:52   ` Patrick DELAUNAY
2021-02-08 17:07     ` Simon Glass
2021-01-07  4:21 ` Simon Glass [this message]
2021-02-08 13:59   ` [PATCH 02/10] Makefile: Provide numeric versions Patrick DELAUNAY
2021-01-07  4:21 ` [PATCH 03/10] smbios: Move smbios_write_type to the C file Simon Glass
2021-01-08 12:15   ` Christian Gmeiner
2021-01-07  4:21 ` [PATCH 04/10] smbios: Use char consistently for the eos member Simon Glass
2021-01-08 12:15   ` Christian Gmeiner
2021-01-07  4:21 ` [PATCH 05/10] smbios: Set BIOS release version Simon Glass
2021-01-09 19:27   ` Heinrich Schuchardt
2021-01-07  4:21 ` [PATCH 06/10] smbios: Use a struct to keep track of context Simon Glass
2021-01-07  4:21 ` [PATCH 07/10] smbios: Drop the eos parameter Simon Glass
2021-01-07  4:22 ` [PATCH 08/10] smbios: Track the end of the string table Simon Glass
2021-01-07  4:22 ` [PATCH 09/10] smbios: Add more options for the BIOS version string Simon Glass
2021-01-07  4:22 ` [PATCH 10/10] smbios: Allow a few values to come from sysinfo Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210106212153.2.I9efe8832e785f28cb7c4bb98d6df6322fc756150@changeid \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.