All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Markus Mayer <markus.mayer@linaro.org>
Cc: Michal Marek <mmarek@suse.cz>,
	Linux Build List <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable
Date: Fri, 20 Jun 2014 20:44:07 +0200	[thread overview]
Message-ID: <20140620184407.GA21269@ravnborg.org> (raw)
In-Reply-To: <1403289089-11299-2-git-send-email-markus.mayer@linaro.org>

On Fri, Jun 20, 2014 at 11:31:28AM -0700, Markus Mayer wrote:
> In order to allow the user to pass extra arguments to the host
> compiler, we no longer overwrite the host compiler flags in the
> makefile, but append them to what was passed in.
> 
> Signed-off-by: Markus Mayer <markus.mayer@linaro.org>
> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 97b2861..5795eea 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -251,8 +251,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
>  
>  HOSTCC       = gcc
>  HOSTCXX      = g++
> -HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
> -HOSTCXXFLAGS = -O2
> +HOSTCFLAGS   += -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
> +HOSTCXXFLAGS += -O2
>  
>  ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
>  HOSTCFLAGS  += -Wno-unused-value -Wno-unused-parameter \

With this patch you can only override HOSTCFLAGS.
In many cases appending to the falgs is actually what you want.

Please take a look at how we have implemented it for the kernel with KCFLAGS.
And notice that this is also described in Documentation/kbuild

	Sam

  reply	other threads:[~2014-06-20 18:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 18:31 [RFC PATCH 0/2] Make host compiler and linker flags modifyable Markus Mayer
2014-06-20 18:31 ` [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable Markus Mayer
2014-06-20 18:44   ` Sam Ravnborg [this message]
2014-06-20 19:35     ` Markus Mayer
2014-06-20 18:31 ` [RFC PATCH 2/2] Makefile: Introduce HOSTLDFLAGS environment variable Markus Mayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140620184407.GA21269@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.mayer@linaro.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.