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

Re: [PATCH 5/7] Makefile: add 'check-sort' target

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 17, 2021, 17:42 UTC
Message-ID
<87r1kdzngs.fsf@evledraar.gmail.com>
In-Reply-To
<YFI9QzKMKLMXYoyz@coredump.intra.peff.net>
On Wed, Mar 17 2021, Jeff King wrote:
Show 17 quoted lines
>  SCRIPT_SH += git-bisect.sh
>  SCRIPT_SH += git-difftool--helper.sh
>  SCRIPT_SH += git-filter-branch.sh
> @@ -1037,6 +1047,7 @@ LIB_OBJS += ws.o
>  LIB_OBJS += wt-status.o
>  LIB_OBJS += xdiff-interface.o
>  LIB_OBJS += zlib.o
> +$(call check-sort,LIB_OBJS)
>  
>  BUILTIN_OBJS += builtin/add.o
>  BUILTIN_OBJS += builtin/am.o
>
> And then it's just a single-liner for each block that should be checked.
> We haven't used $(call) or $(eval) yet in our Makefile, but past
> discussions have reached the conclusion that they should be safe
> (they're both in GNU make 3.80, which is the oldest version worth caring
> about).

...also this sort of thing can be guarded by "ifdef DEVELOPER" or something, which AFAICT (from trying to introduce syntax errors etc.) will get parsed first, before "make" even tries to parse what's within the ifdef.

So if we have bells & whistles in that sort of setup it can be less portable than the Makefile in general..

Previous: Jeff KingNext: Eric Sunshine
Message 13 of 24 in “Sort lists and add static-analysis”
  1. 0/7 Sort lists and add static-analysisDenton Liu, Mar 16, 2021
  2. 3/7 builtin.h: ASCII-sort list of functionsDenton Liu, Mar 16, 2021
  3. Junio C HamanoMar 17, 2021
  4. 2/7 Makefile: ASCII-sort LIB_OBJSDenton Liu, Mar 16, 2021
  5. 1/7 Makefile: mark 'check-builtins' as a .PHONY targetDenton Liu, Mar 16, 2021
  6. Eric SunshineMar 16, 2021
  7. Junio C HamanoMar 17, 2021
  8. 5/7 Makefile: add 'check-sort' targetDenton Liu, Mar 16, 2021
  9. Eric SunshineMar 16, 2021
  10. Denton LiuMar 17, 2021
  11. Ævar Arnfjörð BjarmasonMar 17, 2021
  12. Jeff KingMar 17, 2021
  13. Ævar Arnfjörð BjarmasonMar 17, 2021
  14. Eric SunshineMar 17, 2021
  15. Jeff KingMar 17, 2021
  16. Junio C HamanoMar 17, 2021
  17. Ævar Arnfjörð BjarmasonMar 17, 2021
  18. Junio C HamanoMar 17, 2021
  19. 6/7 ci/run-static-analysis.sh: make check-builtinsDenton Liu, Mar 16, 2021
  20. 4/7 test-tool.h: ASCII-sort list of functionsDenton Liu, Mar 16, 2021
  21. Junio C HamanoMar 17, 2021
  22. 7/7 ci/run-static-analysis.sh: make check-sortDenton Liu, Mar 16, 2021
  23. Bagas SanjayaMar 17, 2021
  24. Junio C HamanoMar 17, 2021

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.