From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPNqZ-0006lj-Sp for qemu-devel@nongnu.org; Thu, 26 Sep 2013 22:32:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPNqU-00077K-3y for qemu-devel@nongnu.org; Thu, 26 Sep 2013 22:31:59 -0400 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:51622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPNqT-00077D-S3 for qemu-devel@nongnu.org; Thu, 26 Sep 2013 22:31:54 -0400 Received: by mail-ee0-f52.google.com with SMTP id c41so917761eek.11 for ; Thu, 26 Sep 2013 19:31:53 -0700 (PDT) Sender: =?UTF-8?B?w4Frb3MgS292w6Fjcw==?= From: =?UTF-8?q?=C3=81kos=20Kov=C3=A1cs?= Date: Fri, 27 Sep 2013 04:30:22 +0200 Message-Id: <1380249092-4775-2-git-send-email-akoskovacs@gmx.com> In-Reply-To: <1380249092-4775-1-git-send-email-akoskovacs@gmx.com> References: <1380249092-4775-1-git-send-email-akoskovacs@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [v2 01/71] rules.mak: New logical functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?=C3=81kos=20Kov=C3=A1cs?= lnot, land, lor, lif, eq, ne, isempty, notempty functions added Example usage: obj-$(call lor,$(CONFIG_LINUX),$(CONFIG_BSD)) += feature.o Signed-off-by: Ákos Kovács --- rules.mak | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 = $(if $(subst $2,,$1)$(subst $1,,$2),n,y) + +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.8.1.2