diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2013-09-13 18:25:52 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-10-16 18:21:00 +0200 |
commit | 9ef622e31e7168a9a2c80f95d245c2ad156e3fa7 (patch) | |
tree | 0c511c47b0f3eafdcb297b829e34ebe708cb21dd /rules.mak | |
parent | 837a2e267f9c01cd9204d5b701712d6d26a5220e (diff) |
rules.mak: New string testing functions
Add new string testing functions which return a y/n result:
eq : are two strings equal (ignoring leading/trailing space)?
ne : are two strings unequal?
isempty : is a string empty?
notempty : is a string non-empty?
Based on an idea by Ákos Kovács <akoskovacs@gmx.com>.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rules.mak')
-rw-r--r-- | rules.mak | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -106,6 +106,17 @@ leqv = $(if $(filter $(call lnot,$1),$(call lnot,$2)),y,n) # Logical if: like make's $(if) but with an leqv-like test lif = $(if $(subst n,,$1),$2,$3) +# String testing functions: inputs to these can be any string; +# the output is always either "y" or "n". Leading and trailing whitespace +# is ignored when comparing strings. +# String equality +eq = $(if $(subst $2,,$1)$(subst $1,,$2),n,y) +# String inequality +ne = $(if $(subst $2,,$1)$(subst $1,,$2),y,n) +# Emptiness/non-emptiness tests: +isempty = $(if $1,n,y) +notempty = $(if $1,y,n) + # Generate files with tracetool TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py |