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 <[email protected]>

Jan


Reply via email to