Received: from eggs.gnu.org ([2001:4830:134:3::10]:54293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDjHH-0004Pp-Ok for qemu-devel@nongnu.org; Sun, 25 Aug 2013 18:59:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDjHA-00065b-QD for qemu-devel@nongnu.org; Sun, 25 Aug 2013 18:59:23 -0400 Received: from mail-ee0-x22e.google.com ([2a00:1450:4013:c00::22e]:43815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDjHA-00065X-Jj for qemu-devel@nongnu.org; Sun, 25 Aug 2013 18:59:16 -0400 Received: by mail-ee0-f46.google.com with SMTP id c13so1269564eek.5 for ; Sun, 25 Aug 2013 15:59:15 -0700 (PDT) Sender: =?UTF-8?B?w4Frb3MgS292w6Fjcw==?= From: =?UTF-8?q?=C3=81kos=20Kov=C3=A1cs?= Date: Mon, 26 Aug 2013 00:58:10 +0200 Message-Id: <1377471536-12423-2-git-send-email-akoskovacs@gmx.com> In-Reply-To: <1377471536-12423-1-git-send-email-akoskovacs@gmx.com> References: <1377471536-12423-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] [PATCH 01/47] 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.7.10.4