From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqDU4-0006eR-7P for qemu-devel@nongnu.org; Fri, 21 Jun 2013 22:23:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqDU1-00072d-Oh for qemu-devel@nongnu.org; Fri, 21 Jun 2013 22:23:24 -0400 Received: from mail-ee0-x230.google.com ([2a00:1450:4013:c00::230]:41881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqDU1-00072T-IL for qemu-devel@nongnu.org; Fri, 21 Jun 2013 22:23:21 -0400 Received: by mail-ee0-f48.google.com with SMTP id b47so4900813eek.35 for ; Fri, 21 Jun 2013 19:23:20 -0700 (PDT) From: akoskovacs0@gmail.com Date: Sat, 22 Jun 2013 04:23:08 +0200 Message-Id: <51c50a98.c4730e0a.40e4.6fb8@mx.google.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 1/3] rules.mak: New logical functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, =?UTF-8?q?=C3=81kos=20Kov=C3=A1cs?= From: Ákos Kovács 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 --- 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