[riot-notifications] [RIOT-OS/RIOT] build system: add machine-readable RIOT_VERSION_CODE macro (#16765)

benpicco notifications at github.com
Tue Sep 21 15:42:52 CEST 2021


@benpicco commented on this pull request.



> +# Generate machine readable RIOT VERSION macro
+RIOT_VERSION_CODE ?= $(shell echo ${RIOT_VERSION} | \
+                      sed -E 's/([0-9]+).([0-9]+).?([0-9]+)?.*/KERNEL_VERSION\\\(\1,\2,0\3,${RIOT_EXTRAVERSION}\\\)/')

```patch
--- a/Makefile.include
+++ b/Makefile.include
@@ -519,7 +519,7 @@ ifneq (,$(RIOT_VERSION_OVERRIDE))
 endif
 
 # Generate machine readable RIOT VERSION macro
-RIOT_VERSION_CODE ?= $(shell echo ${RIOT_VERSION} | \
+RIOT_VERSION_CODE ?= $(shell echo eval 1>&2 && echo ${RIOT_VERSION} | \
                       sed -E 's/([0-9]+).([0-9]+).?([0-9]+)?.*/KERNEL_VERSION\\\(\1,\2,0\3,${RIOT_EXTRAVERSION}\\\)/')
 
 # Set module by prepending APPLICATION name with 'application_'.
```

prints `eval` exactly once 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16765#discussion_r713053903
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210921/226134cd/attachment.htm>


More information about the notifications mailing list