From patchwork Sat Jun 22 02:23:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Frb3MgS292w6Fjcw==?= X-Patchwork-Id: 253334 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 074602C0448 for ; Sat, 22 Jun 2013 12:23:49 +1000 (EST) Received: from localhost ([::1]:47034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqDUQ-0006gJ-RM for incoming@patchwork.ozlabs.org; Fri, 21 Jun 2013 22:23:46 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=QrijofVFx07x5DA38vq/B42amw1B26z49dSufRfiK1A=; b=g2Jpv+6y6jBjjOBmVHFEWlXSbSxkHRWXjt68v+qRxIwgcRSFvEQcp8N8f2UJqxS+XH oIm6/qrlE5Tg4mRDXJK2I1Lw05wefGGsdBKRlfzpTMabjjNSG9r9Ma9JiTdCCEZXPd9E ReNpLF1ErXfITJitEbxvn2R08TWqP6uuMQxI450dgeeN6StFb8CjRWgfPaCy1buzVtJH xGg0CLMR7623IzzxJu70lUHt2gKR9PYkT+riLcZ6z9P4waTwGL6zUgszXtD8g6pm7v02 MGwAeakWpdkEYzS4RgYh6PzGO7VJXbcUNEfHZa+5XWN8RoA2Zs2CKwdegctxD8Xu3FC3 F3EA== X-Received: by 10.14.220.66 with SMTP id n42mr15061415eep.67.1371867800860; Fri, 21 Jun 2013 19:23:20 -0700 (PDT) Received: from localhost.localdomain (zion.teteny.elte.hu. [157.181.97.138]) by mx.google.com with ESMTPSA id e44sm11506618eeh.11.2013.06.21.19.23.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Jun 2013 19:23:20 -0700 (PDT) From: akoskovacs0@gmail.com To: qemu-devel@nongnu.org Date: Sat, 22 Jun 2013 04:23:08 +0200 Message-Id: <51c50a98.c4730e0a.40e4.6fb8@mx.google.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::230 Cc: pbonzini@redhat.com, =?UTF-8?q?=C3=81kos=20Kov=C3=A1cs?= Subject: [Qemu-devel] [PATCH 1/3] rules.mak: New logical functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 :=)