From patchwork Fri Jun 5 07:39:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11589165 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 689E8739 for ; Fri, 5 Jun 2020 07:43:23 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F7B7207D5 for ; Fri, 5 Jun 2020 07:43:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VwdtgmSv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F7B7207D5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jh70c-0008LK-FR for patchwork-qemu-devel@patchwork.kernel.org; Fri, 05 Jun 2020 03:43:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jh6xg-00020d-Cr for qemu-devel@nongnu.org; Fri, 05 Jun 2020 03:40:20 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:28344 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jh6xf-00051y-JY for qemu-devel@nongnu.org; Fri, 05 Jun 2020 03:40:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591342818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EjTnugmHQF57SpUUQ7kXu5I8kuNEH9ZLUz5L6DRtXdw=; b=VwdtgmSvinurPQ1vO7ynui3DdeJH7qkwUvr9ac8nXlpZJONXph1UlG03zZZ++ROoqXBZ56 ufFvq/NXzXs5lbPMR5oNRMgTHSx6uaGS6zsCr7TUfY9xfHe5It5hDQBJqv//U0RYH8uL2d rQLnnswWaJN1vg5L5DbsYoN8/gycxdg= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-365-PSgsnAyRNqiukZkWh4NTRQ-1; Fri, 05 Jun 2020 03:40:17 -0400 X-MC-Unique: PSgsnAyRNqiukZkWh4NTRQ-1 Received: by mail-wr1-f69.google.com with SMTP id w16so3402793wru.18 for ; Fri, 05 Jun 2020 00:40:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EjTnugmHQF57SpUUQ7kXu5I8kuNEH9ZLUz5L6DRtXdw=; b=YtLy3dtJv0hcYhwro2CeQBGBw6fJlj22fx8Mj327MGheX5wcrCBa0Qr9yn6w3DVb0L KeFVWJc6n4jfHF0t1ADeRnam4fdOUU3xYRKifs8nUTwA99rIar3KoQALTVPFdzOU/PT/ DHJtvCIOVi6ADDAOHutoFvGqhCeH0By2CVYeOveFEnQbAyr9/kaQ2LaWgJ+oEqDUVQq9 OlIRs9RtcBi2kj/EFxQmKg6ufdGC9kEHQEsKdTT3sVnwNMToYOXoXKdWCOWXzZ89y88o QPqlSmuS0NEzAcv9suEUIjqAE1azZcN9gTRhjbY7dRUdolyG2UcYKGq9i232ul1f+aln pUfw== X-Gm-Message-State: AOAM533H1gKMn12WISuknviwX6DjBtzg8kVdYTr2CMqJly1Dt2F3+oyt 6bS/RK7lluuxqV5EBwYaskv3qGh+UCun1xEJ40ufiDn/d831DHzdWFUwIyajYSYTFHt32bB29Gq WTvlXhUO00PkYesc= X-Received: by 2002:a5d:62c2:: with SMTP id o2mr7933451wrv.51.1591342815900; Fri, 05 Jun 2020 00:40:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQayMquIzJxv5b4YMZdlMR4T7N8POT838zHVttlRHQBYEzZu3o5yMQsQn8FIrfhsMQW8Klvg== X-Received: by 2002:a5d:62c2:: with SMTP id o2mr7933431wrv.51.1591342815670; Fri, 05 Jun 2020 00:40:15 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id j18sm11440178wrn.59.2020.06.05.00.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 00:40:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v5 04/11] rules.mak: Add strequal() and startwith() and rules Date: Fri, 5 Jun 2020 09:39:46 +0200 Message-Id: <20200605073953.19268-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200605073953.19268-1-philmd@redhat.com> References: <20200605073953.19268-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/05 03:07:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add a rule to test if two strings are equal, and another to test if a string starts with a substring, Signed-off-by: Philippe Mathieu-Daudé --- rules.mak | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rules.mak b/rules.mak index 694865b63e..ccc1c49604 100644 --- a/rules.mak +++ b/rules.mak @@ -191,6 +191,20 @@ ne = $(if $(subst $2,,$1)$(subst $1,,$2),y,n) isempty = $(if $1,n,y) notempty = $(if $1,y,n) +# strequal +# Usage: $(call strequal, str1, str2) +# +# This macro returns a string (TRUE) when @str1 and @str2 +# are equal, else returns the empty string (FALSE) +strequal = $(if $(subst $2,,$1)$(subst $1,,$2),,$1) + +# startwith +# Usage: $(call startwith, startstr, fullstr) +# +# This macro returns a string (TRUE) when @fullstr starts with +# @startstr, else returns the empty string (FALSE) +startwith = $(findstring :$1,:$2) + # Generate files with tracetool TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py