[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] build: Fix make warning if there is no cppcheck


  • To: Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 20 May 2022 14:51:10 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zt6DIOpsmTW6jf+rRgcJ2dV3ltRHop+tG8FkJT5RAVY=; b=cSllIJJ8IDo6Fc6eoAfOwaU+HE0VjybUzCHja5OOradKZS2/u2TMMfO33oDSKeullaq0dQBhKLBXMUbpgQAlqBbcfI24htr2fk5o3sXEBOA46hFOvap3hbKAVqoAvMaqr9jrdQykkr2YblgtWfHpWBPYASSFSon816upHJ4BhCY4CJBdUywTX/lN1Ve7esFhAU7zuS44aqLlAEq+19uidBxc4Cd7w6XjsQNyJ/ln89dytp1686/uKLtAM72gdypPtBrYxnjuccRIx9xRgAUNhufrjazy/CrYP8fD9nE0T0JHo81tJ5DPcO6fFVaTkgGdJkHuQ4Byt4KQUKY/xKiPjA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h7nGei4EokwuJUIZyxIJiKw2+kvpLHaRn/TxFXqolvvlTN/g+4n7GoJuVOfw7+M/rb6I4YEh6/DPWZlpeROP/mdRXKrjDh6WdqxIYaNmrPT2IrWrtnMOnObnxF7MwSM8PAxjwgJRj41g7+7upWAkJRMkU6wDScL4jQesJas3JoD4HqgfOlVLlQzRL9alYrFDhye7Arb2UbmUVLqyngk6vjv0rFY2fZ93iQyJ+Bid4/ZpEjTnq6eZ24vzX8ji2c+KfV4Kxkr7DF1jZMZ8khcShNI61NQ8sgtqVoUSW+sWQQHEqbOHIi8wFqQJJ//kbbaPS/7CiVU4tkcP4VL7dFo+lg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 20 May 2022 12:51:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.05.2022 14:14, Bertrand Marquis wrote:
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -694,12 +694,14 @@ $(objtree)/%.c.cppcheck: $(srctree)/%.c 
> $(objtree)/include/generated/autoconf.h
>       $(call if_changed,cppcheck_xml)
>  
>  cppcheck-version:
> -ifeq ($(shell which $(CPPCHECK)),)
> -     $(error Cannot find cppcheck executable: $(CPPCHECK))
> -endif
> -ifeq ($(shell $(CPPCHECK) --version | awk '{print ($$2 < 2.7)}'),1)
> -     $(error Please upgrade your cppcheck to version 2.7 or greater)
> -endif
> +     @if ! which $(CPPCHECK) > /dev/null 2>&1; then \
> +             echo "Cannot find cppcheck executable: $(CPPCHECK)"; \
> +             exit 1; \
> +     fi
> +     @if [ "$$($(CPPCHECK) --version | awk '{print ($$2 < 2.7)}')" -eq 1 ]; 
> then \
> +             echo "Please upgrade your cppcheck to version 2.7 or greater"; \
> +             exit 1; \
> +     fi
>  
>  # Put this in generated headers this way it is cleaned by include/Makefile
>  $(objtree)/include/generated/compiler-def.h:

Fine with me, even if - as said on v1 - I would have preferred $(if ...).
One question though: Wouldn't it better be $(Q) instead of the two plain
@? Preferably with that adjustment (which I guess can be made while
committing):
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.