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

Re: [PATCH 8/8] Makefiles: add and use wildcard "mkdir -p" template

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Dec 24, 2021, 17:41 UTC
Message-ID
<211224.867dbthpcd.gmgdl@evledraar.gmail.com>
In-Reply-To
<CAPig+cQt47U9E8kUFiTBecEPcTaLhRCi5X_T=nPqZM-HJR=n0g@mail.gmail.com>
On Fri, Dec 17 2021, Eric Sunshine wrote:
Show 22 quoted lines
> On Thu, Dec 16, 2021 at 11:40 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> [...]
>> But as it turns out we can use this neat trick of only doing a "mkdir
>> -p" if the $(wildcard) macro tells us the path doesn't exist. A re-run
>> of a performance test similar to thatnoted downthread of [1] in [2]
>> shows that this is faster, in addition to being less verbose and more
>> reliable (this uses my "git-hyperfine" thin wrapper for "hyperfine"[3]):
>
> s/thatnoted/that noted/
>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
>> diff --git a/shared.mak b/shared.mak
>> @@ -90,3 +92,18 @@ ifndef V
>> +## Is racy, but in a good way; we might redundantly (and safely)
>> +## "mkdir -p" when running in parallel, but won't need to exhaustively
>> +## individual rules for "a" -> "prefix" -> "dir" -> "file" if given a
>> +## "a/prefix/dir/file". This can instead be inserted at the start of
>> +## the "a/prefix/dir/file" rule.
>
> Is there a word missing between "exhaustively" and "individual"?

Thanks. I addressed both of these in the v2, for which I accidentally broke the threading by omitting In-Reply-To (sorry!): https://lore.kernel.org/git/cover-v2-0.8-00000000000-20211224T173558Z-avarab@gmail.com/

Previous: Eric SunshineNext: Ævar Arnfjörð Bjarmason
Message 10 of 11 in “Makefile: optimize noop runs, add shared.mak”
  1. 0/8 Makefile: optimize noop runs, add shared.makÆvar Arnfjörð Bjarmason, Dec 17, 2021
  2. 2/8 Makefile: disable GNU make built-in wildcard rulesÆvar Arnfjörð Bjarmason, Dec 17, 2021
  3. 1/8 Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to itÆvar Arnfjörð Bjarmason, Dec 17, 2021
  4. 3/8 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)Ævar Arnfjörð Bjarmason, Dec 17, 2021
  5. 4/8 Makefile: move ".SUFFIXES" rule to shared.makÆvar Arnfjörð Bjarmason, Dec 17, 2021
  6. 5/8 Makefile: move $(comma), $(empty) and $(space) to shared.makÆvar Arnfjörð Bjarmason, Dec 17, 2021
  7. 6/8 Makefile: add "$(QUIET)" boilerplate to shared.makÆvar Arnfjörð Bjarmason, Dec 17, 2021
  8. 8/8 Makefiles: add and use wildcard "mkdir -p" templateÆvar Arnfjörð Bjarmason, Dec 17, 2021
  9. Eric SunshineDec 17, 2021
  10. Ævar Arnfjörð BjarmasonDec 24, 2021
  11. 7/8 Makefile: use $(wspfx) for $(QUIET...) in shared.makÆvar Arnfjörð Bjarmason, Dec 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.