From: akoskovacs0@gmail.com
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, "Ákos Kovács" <akoskovacs@gmx.com>
Subject: [Qemu-devel] [PATCH 1/3] rules.mak: New logical functions
Date: Sat, 22 Jun 2013 04:23:08 +0200 [thread overview]
Message-ID: <51c50a98.c4730e0a.40e4.6fb8@mx.google.com> (raw)
In-Reply-To: <y>
From: Ákos Kovács <akoskovacs@gmx.com>
New functions are added: lnot, land, lor, lif, eq, ne, isempty, notempty
Example usage:
obj-$(call lor,$(CONFIG_LINUX),$(CONFIG_BSD)) += feature.o
Signed-off-by: Ákos Kovács <akoskovacs@gmx.com>
---
rules.mak | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/rules.mak b/rules.mak
index 4499745..7e8e3bd 100644
--- a/rules.mak
+++ b/rules.mak
@@ -106,6 +106,22 @@ clean: clean-timestamp
obj := .
old-nested-dirs :=
+# Logical functions
+lnot = $(if $(subst n,,$1),n,y)
+
+land-yy = y
+land = $(land-$1$2)
+
+lor = $(findstring y,$1,$2)
+
+lif = $(if $(subst n,,$1),$2,$3)
+
+eq = $(if $(subst $2,,$1)$(subst $1,,$2),n,y)
+ne = $(if $(subst $2,,$1)$(subst $1,,$2),y,n)
+
+isempty = $(call eq,$1,)
+notempty = $(call ne,$1,)
+
define push-var
$(eval save-$2-$1 = $(value $1))
$(eval $1 :=)
--
1.7.2.5
reply other threads:[~2013-06-22 2:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51c50a98.c4730e0a.40e4.6fb8@mx.google.com \
--to=akoskovacs0@gmail.com \
--cc=akoskovacs@gmx.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).