1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

10 Commits

Author SHA1 Message Date
Marian Buschsieweke
8c055f0f3e
makefiles/utils/strings.mk: Fix version_is_greater_or_equal
The Makefile function `version_is_greater_or_equal` is used to check if
a version of GNU Make is at least the required one. However, it has
the built-in assumption the version numbers have to format x.y.z,
but Alpine Linux currently ships GNU Make 4.4. This results in
`$(call _pad_number,3,)` which runs `printf '$03d' ''` in the shell,
which is not valid.

This fixes the issue by making `_pad_number` more robust by fall back to
printing `0` with the given padding, if the number given to print is
empty.
2023-01-12 12:03:28 +01:00
Juan Carrano
1036115f2d
makefiles/utils/ansi: Refactor ansi codes into their own file.
The escape codes and special chars now live in their own module. The
color module is only concerned with detecting whether to use colors or
not.

Additional variables are defined with hard a coded ESC char, a tab and a
newline. This removes the need for echo or printf.
2021-05-04 10:52:50 +02:00
Francisco Molina
e455ccd3c0
makefiles/utils/strings.mk: add version_greater_or_equal 2021-01-18 14:37:23 +01:00
Francisco Molina
5b10bdfcb8
makefiles/utils: add util to compare to software versions 2020-11-23 09:12:51 +01:00
8e0ac2aeab
make: Add variable definitions for comma and space 2020-10-09 12:02:27 +02:00
Gaëtan Harter
765f3e9327
makefiles/utils: functions for lowercase and uppercase
Add make only function to convert strings to lowercase and uppercase.
This can replace the `$(shell echo $(var) | tr 'a-z-' 'A-Z_')` pattern.
Using the 'make' implementation results in being around 100 times faster.
2019-08-29 13:59:31 +02:00
Gaëtan Harter
2c5eeca47a
makefiles/utils: function to memoize a variable evaluation
This allow deferring a variable evaluation to its usage but still
benefit from only evaluating it once on multiple uses.
2019-06-28 11:34:43 +02:00
Gaëtan Harter
fcf8c4782d
makefiles/utils: function to export variables for a target
This allows exporting variables only for some target.
It will allow not exporting variables when not needed, and so prevent
unnecessary evaluation.
2019-06-28 11:33:54 +02:00
Juan Carrano
f466171053 makefiles/utils: add tests for checks.mk.
make -f test-checks.mk test-ensure_value should succeed, while
make -f test-checks.mk test-ensure_value-negative should fail.
2018-12-07 18:19:38 +01:00
Juan Carrano
547d9f0802 makefiles/utils: Add a function for checking that a string is not empty.
A call to `$(ensure_value x,y)` will fail with message y if x is empty, and
otherwise return x. This can be useto write more compact makefiles, while still
producing friendly error messages.
2018-12-07 18:19:34 +01:00