diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2016-08-17 21:59:22 +0200 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2016-08-17 21:59:22 +0200 |
commit | 8cc34f6b2306b9acf2a33c3643b9008ebd0703d9 (patch) | |
tree | 556a67ab232884004fcfcc4f527f029c7133bcfc | |
parent | 462ce25bed22933c833f4fadb20d0aa4a82045f4 (diff) | |
download | embtoolkit-8cc34f6b2306b9acf2a33c3643b9008ebd0703d9.tar.gz embtoolkit-8cc34f6b2306b9acf2a33c3643b9008ebd0703d9.tar.bz2 embtoolkit-8cc34f6b2306b9acf2a33c3643b9008ebd0703d9.tar.xz |
Build system: macros: add helpers to compare integers
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r-- | core/mk/macros.mk | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/mk/macros.mk b/core/mk/macros.mk index e2c4ff1..b8208d5 100644 --- a/core/mk/macros.mk +++ b/core/mk/macros.mk @@ -133,6 +133,31 @@ endef embtk_abspath = $(abspath $(patsubst %/,%,$(call embtk_uquote,$(1)))) # +# Macro to test if integer $(1) is greater than $(2) +# +embtk_gt = $(shell test $(1) -gt $(2) && echo y) + +# +# Macro to test if integer $(1) is greater than or equal to $(2) +# +embtk_ge = $(shell test $(1) -ge $(2) && echo y) + +# +# Macro to test if integer $(1) is less than $(2) +# +embtk_lt = $(shell test $(1) -lt $(2) && echo y) + +# +# Macro to test if integer $(1) is less than or equal to $(2) +# +embtk_le = $(shell test $(1) -le $(2) && echo y) + +# +# Macro to test if integer $(1) is equal to $(2) +# +embtk_eq = $(shell test $(1) -eq $(2) && echo y) + +# # Packages management macros # include core/mk/pkg-macros/vars.mk |