From patchwork Fri Sep 13 17:25:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 20292 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83B8528E97 for ; Fri, 13 Sep 2013 17:26:01 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id jy13sf1606393veb.4 for ; Fri, 13 Sep 2013 10:26:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=UGSDsz8LtZZzzO0A4fGqV/gI+znFioUHYNUgyQy6fdM=; b=k8AZeC+4zTXnAat0BbyOh9NNL1g0JaR7fNERBiYrPu28LSe7f6HyNrl/ypoJagSnDE x3HCA4YQGTOSn2aHpuEP5wjLKXVbk0uprmkNsmQE75tXQF7By/GORxxWmnaTK5xcntZX ug7u0lVn1ZI+PC6Sp9BTrRL9YSaCX4V/Oxfhwgu8QZY30yv9M3VK40voBBHc2sFXC/Z8 hrszD+uZbLl+Kdq4V36hP/icMoB3bANEoloPFSgwo4pJIaXlq9V1xi7tte63iIsXDQiA LsZ9MPf/Vu4dxKo1nWv0CWcxwCux4exo7FmEIddDWuKx8wYCAVaepIrmZsE2I7RksSom LpQA== X-Gm-Message-State: ALoCoQkEQCQYWL2w001qoIW73aRPRMMc4iTC6E25S2kuuYsbgdGKHLxeNv3O9aL773H0OLerGqV7 X-Received: by 10.236.93.45 with SMTP id k33mr5589483yhf.19.1379093161221; Fri, 13 Sep 2013 10:26:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.225 with SMTP id f1ls1158338qeo.66.gmail; Fri, 13 Sep 2013 10:26:00 -0700 (PDT) X-Received: by 10.58.44.37 with SMTP id b5mr13039103vem.4.1379093160924; Fri, 13 Sep 2013 10:26:00 -0700 (PDT) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id uh5si3440634vcb.52.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 10:26:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.46; Received: by mail-vb0-f46.google.com with SMTP id p13so1147274vbe.5 for ; Fri, 13 Sep 2013 10:26:00 -0700 (PDT) X-Received: by 10.220.186.202 with SMTP id ct10mr13163161vcb.14.1379093160795; Fri, 13 Sep 2013 10:26:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp91967vcz; Fri, 13 Sep 2013 10:26:00 -0700 (PDT) X-Received: by 10.205.3.197 with SMTP id nz5mr2554135bkb.35.1379093157094; Fri, 13 Sep 2013 10:25:57 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id j5si1660264bko.47.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 10:25:57 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VKX7y-0002xd-IU; Fri, 13 Sep 2013 18:25:54 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?=C3=81kos=20Kov=C3=A1cs?= , Anthony Liguori , Paolo Bonzini Subject: [PATCH v2 2/4] rules.mak: New string testing functions Date: Fri, 13 Sep 2013 18:25:52 +0100 Message-Id: <1379093154-11348-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379093154-11348-1-git-send-email-peter.maydell@linaro.org> References: <1379093154-11348-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add new string testing functions which return a y/n result: eq : are two strings equal (ignoring leading/trailing space)? ne : are two strings unequal? isempty : is a string empty? notempty : is a string non-empty? Based on an idea by Ákos Kovács . Signed-off-by: Peter Maydell --- rules.mak | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rules.mak b/rules.mak index 65a1b96..49edb9b 100644 --- a/rules.mak +++ b/rules.mak @@ -106,6 +106,17 @@ leqv = $(if $(filter $(call lnot,$1),$(call lnot,$2)),y,n) # Logical if: like make's $(if) but with an leqv-like test lif = $(if $(subst n,,$1),$2,$3) +# String testing functions: inputs to these can be any string; +# the output is always either "y" or "n". Leading and trailing whitespace +# is ignored when comparing strings. +# String equality +eq = $(if $(subst $2,,$1)$(subst $1,,$2),n,y) +# String inequality +ne = $(if $(subst $2,,$1)$(subst $1,,$2),y,n) +# Emptiness/non-emptiness tests: +isempty = $(if $1,n,y) +notempty = $(if $1,y,n) + # Generate files with tracetool TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py