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

Re: [PATCH v2 6/6] Makefile: allow for combining DEVELOPER=1 and CFLAGS="..."

From
Jeff King <peff@peff.net>
Date
Feb 22, 2019, 15:29 UTC
Message-ID
<20190222152926.GC21524@sigill.intra.peff.net>
In-Reply-To
<20190222144127.32248-7-avarab@gmail.com>
On Fri, Feb 22, 2019 at 03:41:27PM +0100, Ævar Arnfjörð Bjarmason wrote:
> So let's introduce a "DEVELOPER_CFLAGS" variable in config.mak.dev and
> add it to ALL_CFLAGS. Before this the ALL_CFLAGS variable
> would (basically, there's some nuance we won't go into) be set to:

Yeah, I definitely think this is the right direction, and the patch looks good to me.

> Examples of things that weren't possible before, but are now:
> 
>     # Use -O0 instead of -O2 for less painful debuggng
>     DEVELOPER=1 CFLAGS="-O0 -g"
Sort an aside, but in my config.mak I have:
  O=0
  CFLAGS = -g -O$(O)

which lets me do "make O=2", which is nice and short. I wonder if other people would want that, too.

(I default to -O0 because 99% of my compiles are for development and debugging, so the compile being fast is more important than the build result being fast; for perf testing or daily use, I use O=2).

Show 5 quoted lines
> So we could have gotten away with the much smaller change of changing
> "CFLAGS" in config.mak.dev to "DEVELOPER_CFLAGS" and adding that to
> ALL_CFLAGS earlier in the Makefile "before" the config.mak.*
> includes. But I think it's more readable to use variables "after"
> they're included.

I think the reordering does make things more readable overall. And it may be more sensible if config.mak uses any ":=" assignments.

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 18 of 20 in “Makefile: remove an out-of-date comment”
  1. Makefile: remove an out-of-date commentÆvar Arnfjörð Bjarmason, Feb 22, 2019
  2. 0/6 Makefile: allow for combining DEVELOPER= and CFLAGS="..."Ævar Arnfjörð Bjarmason, Feb 22, 2019
  3. Jeff KingFeb 22, 2019
  4. Ævar Arnfjörð BjarmasonFeb 22, 2019
  5. Jeff KingFeb 23, 2019
  6. 1/6 Makefile: remove an out-of-date commentÆvar Arnfjörð Bjarmason, Feb 22, 2019
  7. 2/6 Makefile: move "strip" assignment down from flagsÆvar Arnfjörð Bjarmason, Feb 22, 2019
  8. Jeff KingFeb 22, 2019
  9. Ramsay JonesFeb 22, 2019
  10. Jeff KingFeb 23, 2019
  11. 3/6 Makefile: add/remove comments at top and tweak whitespaceÆvar Arnfjörð Bjarmason, Feb 22, 2019
  12. 4/6 Makefile: Move *_LIBS assignment into its own sectionÆvar Arnfjörð Bjarmason, Feb 22, 2019
  13. Jeff KingFeb 22, 2019
  14. Eric SunshineFeb 22, 2019
  15. 5/6 Makefile: move the setting of *FLAGS closer to "include"Ævar Arnfjörð Bjarmason, Feb 22, 2019
  16. Junio C HamanoFeb 22, 2019
  17. 6/6 Makefile: allow for combining DEVELOPER=1 and CFLAGS="..."Ævar Arnfjörð Bjarmason, Feb 22, 2019
  18. Jeff KingFeb 22, 2019
  19. Junio C HamanoFeb 22, 2019
  20. Jeff KingFeb 22, 2019

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.