Re: [PATCH] build: assign extra flags to ALL_CFLAGS instead of CFLAGS

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

 



On Wed, 2017-10-18 at 11:07 -0400, Jeff Layton wrote:
> From: Jeff Layton <jlayton@xxxxxxxxxx>
> 
> The fedora packaging tools want to override $CFLAGS when building
> sparse, but that fails on a couple of targets.
> 
> There are a couple of build targets in the makefile that want to add
> options to $CFLAGS. When we do a build though, we pass $ALL_CFLAGS
> to the compiler, and that ends up not getting options passed in
> via $CFLAGS on the command line.
> 
> Fix the two specific build targets to add the options to $ALL_CFLAGS
> instead of $CFLAGS.
> 
> Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>


I had revised this and still sent out the old version. That patch
description should read:

    build: assign extra flags to ALL_CFLAGS instead of CFLAGS
    
    The fedora packaging tools want to override $CFLAGS when building
    sparse, but that fails on a couple of targets.
    
    There are a couple of build targets in the makefile that want to add
    options to $CFLAGS. When we do a build though, we pass $ALL_CFLAGS to
    the compiler, and that ends up without those extra options, if CFLAGS=
    was specified on the command line.
    
    I'm not sure if this is a recursive variable expansion bug in make, but
    we can work around it either way. Fix the two specific build targets to
    add the options to $ALL_CFLAGS instead of $CFLAGS.
    
    Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>


Let me know if you'd like me to resend it.

> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index d0341764158e..b24680b885fe 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -83,7 +83,7 @@ PROGRAMS += test-inspect
>  INST_PROGRAMS += test-inspect
>  test-inspect_EXTRA_DEPS := ast-model.o ast-view.o ast-inspect.o
>  test-inspect_OBJS := test-inspect.o $(test-inspect_EXTRA_DEPS)
> -$(test-inspect_OBJS) $(test-inspect_OBJS:.o=.sc): CFLAGS += $(GTK_CFLAGS)
> +$(test-inspect_OBJS) $(test-inspect_OBJS:.o=.sc): ALL_CFLAGS += $(GTK_CFLAGS)
>  test-inspect_EXTRA_OBJS := $(GTK_LIBS)
>  else
>  $(warning Your system does not have gtk3/gtk2, disabling test-inspect)
> @@ -208,7 +208,7 @@ ifneq ($(DEP_FILES),)
>  include $(DEP_FILES)
>  endif
>  
> -c2xml.o c2xml.sc: CFLAGS += $(LIBXML_CFLAGS)
> +c2xml.o c2xml.sc: ALL_CFLAGS += $(LIBXML_CFLAGS)
>  
>  pre-process.sc: CHECKER_FLAGS += -Wno-vla
>  

-- 
Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux