git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: CFLAGS usage

From
David Brown <git@davidb.org>
Date
Nov 4, 2005, 18:23 UTC
Message-ID
<20051104182342.GA27711@old.davidb.org>
In-Reply-To
<7voe50wblp.fsf@assigned-by-dhcp.cox.net>
On Fri, Nov 04, 2005 at 09:45:38AM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> Morten Welinder <mwelinder@gmail.com> writes:
> 
> > Various stuff is being added to CFLAGS, but CFLAGS is not being used
> > after being composed in CFLAGS_ALL.
> 
> True.
> 
> We should move ALL_CFLAGS definition at the very end; is
> anything else needed?

Although it will work fine just as it is (it may be misleading, though). Lazy evaluation in make is important, it allows such things as having different CFLAGS that for different source files.

  foo.o: CFLAGS += -fspecial-option

And the additional CFLAGS will only apply to the compilation of foo. Since the ALL_CFLAGS is expanded lazily, it gets expanded for each target, and the rule above causes CFLAGS to have extra values only on that target.

Dave
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 6 in “CFLAGS usage”
  1. Morten WelinderNov 4, 2005
  2. David BrownNov 4, 2005
  3. Junio C HamanoNov 4, 2005
  4. David BrownNov 4, 2005
  5. Junio C HamanoNov 4, 2005
  6. Simplify CFLAGS/DEFINES in MakefileJunio C Hamano, Nov 5, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.