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

Re: [PATCH 4/4] Makefile: Don't pass $(ALL_CFLAGS) to the linker

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jun 26, 2010, 17:59 UTC
Message-ID
<4C264019.6030408@ramsay1.demon.co.uk>
In-Reply-To
<20100623210820.GA24242@burratino>
Jonathan Nieder wrote:
Show 13 quoted lines
> Ramsay Jones wrote:
> 
>>     LINK : warning LNK4044: unrecognized option '/Zi'; ignored
>>
>> In order to suppress the warning, we refrain from passing the
>> $(ALL_CFLAGS) macro to the linker.
>>
>> Note that, should it be necessary in the future, an option
>> intended for both the (front-end) compiler and the linker can
>> be included in both CFLAGS and LDFLAGS.
> 
> I think traditionally CPPFLAGS is meant to be used for the purpose
> you are describing (see [1] for example).
Really? I thought that the general scheme was something like:
    - LDFLAGS is for options which only affects the operation of
      the linker (e.g. -L).
    - CPPFLAGS is for options which only affects the operation of
      the C pre-processor (e.g. -I, -D, -U)
    - CFLAGS is for options which only affects the operation of
      the compiler proper.

If an option affects multiple phases, then (one option) is to include it into each of the above macros to which it applies.

In practice, of course, I've yet to see a Makefile which faithfully implements the above scheme. ;-)

Also, the last time I was forced to use automake (yuck), I noticed that it passed CPPFLAGS to the linker; I consider this to be a bug in automake. :-P

[CFLAGS et. al. are also supposed to be user settable ...]
Show 17 quoted lines
> I realize that the Makefile does not currently use the terms this way:
> making it consistent would require
> 
>  . s/BASIC_CFLAGS/BASIC_CPPFLAGS/, except that the
> 
> 	BASIC_CFLAGS += -Kthread
> 
>    settings should probably stay as-is
> 
>  . Windows BASIC_CFLAGS would probably need to be split:
> 
> 	BASIC_CFLAGS = -nologo
> 	BASIC_CPPFLAGS = -I. -I../zlib ... -DWIN32 ...
> 
>  . s/COMPAT_CFLAGS/COMPAT_CPPFLAGS
> 
> What do you think?

I think I am missing something, since I don't see how this relates to my patch!

I'm sure the misunderstanding is mine; sorry to be so dense!

ATB, Ramsay Jones

Previous: Jonathan NiederNext: Jonathan Nieder
Message 3 of 12 in “Makefile: Don't pass $(ALL_CFLAGS) to the linker”
  1. 4/4 Makefile: Don't pass $(ALL_CFLAGS) to the linkerRamsay Jones, Jun 23, 2010
  2. Jonathan NiederJun 23, 2010
  3. Ramsay JonesJun 26, 2010
  4. Jonathan NiederJun 26, 2010
  5. Ramsay JonesJun 30, 2010
  6. Andreas SchwabJun 30, 2010
  7. Bernhard R. LinkJun 27, 2010
  8. Peter HarrisJun 24, 2010
  9. Ramsay JonesJun 25, 2010
  10. Peter HarrisJun 27, 2010
  11. Ramsay JonesJun 30, 2010
  12. Peter HarrisJul 1, 2010

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.