From 8cc34f6b2306b9acf2a33c3643b9008ebd0703d9 Mon Sep 17 00:00:00 2001 From: Abdoulaye Walsimou Gaye Date: Wed, 17 Aug 2016 21:59:22 +0200 Subject: Build system: macros: add helpers to compare integers Signed-off-by: Abdoulaye Walsimou Gaye --- core/mk/macros.mk | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'core') 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 @@ -132,6 +132,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 # -- cgit v1.2.3