{"thread":{"id":"57101","subject":"[PATCH 0/8] Makefile: optimize noop runs, add shared.mak","startedAt":"2021-12-17T01:39:33Z","lastAt":"2021-12-24T17:42:15Z","messageCount":11,"participants":["Ævar Arnfjörð Bjarmason","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"444307","messageId":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":null,"subject":"[PATCH 0/8] Makefile: optimize noop runs, add shared.mak","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:18Z","receivedAt":"2021-12-17T01:39:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This topic is split-up from v4 of ab/make-dependency[1], and is the\nlast topic I've split up from that which I'll submit before the\noutstanding ones land.\n\nThis speeds up noop runs of \"make\" by a lot. After a \"make\" running a\n\"make -j1\" with this is ~1.5 faster than on \"master\"[2], and around 3x\nas fast with \"make -j1 NO_TCLTK=Y\" (the TCL part takes a lot of time,\nbut that's another matter).\n\nAs shown in 8/8 the only meaningful change to existing Makefile rules\nmakes things simpler, while making them much faster. In 3/8 a rather\ntrivial change to use \":=\" instead of \"=\" for a \"$(shell)\" assignment\nlikewise speeds things up.\n\nThe \"shared.mak\" introduced while getting to 8/8 will then be used by\nfollow-on topics to make introducing shared behavior (particularly via\n$(call), which we can now rely on) easier.\n\nThe range-diff to [1] shows changes from that topic. Most of them are\nfrom pulling this topic out of those larger changes. I also re-ran all\nthe benchmarks & updated those in the commit messages.\n\n1. https://lore.kernel.org/git/cover-v4-00.23-00000000000-20211117T101807Z-avarab@gmail.com/\n2. $ git -c hyperfine.hook.setup= hyperfine -L rev origin/master,HEAD~0 -s 'make' 'make -j1' --warmup 1\n   Benchmark 1: make -j1' in 'origin/master\n     Time (mean ± σ):     563.1 ms ±  14.5 ms    [User: 453.3 ms, System: 117.6 ms]\n     Range (min … max):   542.7 ms … 595.0 ms    10 runs\n\n   Benchmark 2: make -j1' in 'HEAD~0\n     Time (mean ± σ):     362.5 ms ±   4.5 ms    [User: 299.7 ms, System: 73.9 ms]\n     Range (min … max):   356.9 ms … 369.4 ms    10 runs\n\n   Summary\n     'make -j1' in 'HEAD~0' ran\n       1.55 ± 0.04 times faster than 'make -j1' in 'origin/master'\n3. git -c hyperfine.hook.setup= hyperfine -L rev origin/master,HEAD~0 -s 'make' 'make -j1 NO_TCLTK=Y' --warmup 1\n   Benchmark 1: make -j1 NO_TCLTK=Y' in 'origin/master\n     Time (mean ± σ):     291.1 ms ±  24.1 ms    [User: 225.6 ms, System: 68.9 ms]\n     Range (min … max):   275.0 ms … 353.9 ms    10 runs\n\n   Benchmark 2: make -j1 NO_TCLTK=Y' in 'HEAD~0\n     Time (mean ± σ):      95.8 ms ±   0.7 ms    [User: 81.9 ms, System: 18.1 ms]\n     Range (min … max):    94.8 ms …  98.4 ms    31 runs\n\n   Summary\n     'make -j1 NO_TCLTK=Y' in 'HEAD~0' ran\n       3.04 ± 0.25 times faster than 'make -j1 NO_TCLTK=Y' in 'origin/master'\n\nÆvar Arnfjörð Bjarmason (8):\n  Makefiles: add \"shared.mak\", move \".DELETE_ON_ERROR\" to it\n  Makefile: disable GNU make built-in wildcard rules\n  Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)\n  Makefile: move \".SUFFIXES\" rule to shared.mak\n  Makefile: move $(comma), $(empty) and $(space) to shared.mak\n  Makefile: add \"$(QUIET)\" boilerplate to shared.mak\n  Makefile: use $(wspfx) for $(QUIET...) in shared.mak\n  Makefiles: add and use wildcard \"mkdir -p\" template\n\n Documentation/Makefile |  63 +++-------------------\n Makefile               | 118 +++++++++++++----------------------------\n config.mak.uname       |   1 -\n shared.mak             | 109 +++++++++++++++++++++++++++++++++++++\n t/Makefile             |   3 ++\n t/interop/Makefile     |   3 ++\n templates/Makefile     |   8 ++-\n 7 files changed, 160 insertions(+), 145 deletions(-)\n create mode 100644 shared.mak\n\nRange-diff:\n 1:  1621ca72c1d <  -:  ----------- Makefile: don't invoke msgfmt with --statistics\n 2:  b7c36c9fea0 <  -:  ----------- Makefile: don't set up \"perl/build\" rules under NO_PERL=Y\n 3:  29b000eb0f1 <  -:  ----------- Makefile: use \"=\" not \":=\" for po/* and perl/*\n 4:  daead5ec293 <  -:  ----------- Makefile: clean perl/build/ even with NO_PERL=Y\n 5:  3c987590740 <  -:  ----------- Makefile: remove \"mv $@ $@+\" dance redundant to .DELETE_ON_ERROR\n 6:  b57f582ccd3 <  -:  ----------- Makefile: guard Perl-only variable assignments\n 7:  fcdee92f64c <  -:  ----------- Makefile: change \"ifndef NO_PERL\" to \"ifdef NO_PERL\"\n 8:  1e25b532ca2 <  -:  ----------- Makefile: adjust Perl-related comments & whitespace\n 9:  77d9855bfcf <  -:  ----------- Makefile: correct \"GIT-PERL-{DEFINES,HEADER}\" dependency graph\n10:  6004cdcd8d9 <  -:  ----------- Makefile: create a GIT-PYTHON-DEFINES, like \"PERL\"\n11:  17b30e96057 <  -:  ----------- Makefile: stop needing @@GIT_VERSION@@ in *.perl scripts\n12:  30ddf7da2c8 !  1:  f74b47662b7 Makefiles: add \"shared.mak\", move \".DELETE_ON_ERROR\" to it\n    @@ shared.mak (new)\n     +#\n     +#    info make --index-search=.DELETE_ON_ERROR\n     +.DELETE_ON_ERROR:\n    +\n    + ## t/Makefile ##\n    +@@\n    ++# Import tree-wide shared Makefile behavior and libraries\n    ++include ../shared.mak\n    ++\n    + # Run tests\n    + #\n    + # Copyright (c) 2005 Junio C Hamano\n    +\n    + ## t/interop/Makefile ##\n    +@@\n    ++# Import tree-wide shared Makefile behavior and libraries\n    ++include ../../shared.mak\n    ++\n    + -include ../../config.mak\n    + export GIT_TEST_OPTIONS\n    + \n    +\n    + ## templates/Makefile ##\n    +@@\n    ++# Import tree-wide shared Makefile behavior and libraries\n    ++include ../shared.mak\n    ++\n    + # make and install sample templates\n    + \n    + ifndef V\n21:  dd569a59c74 !  2:  b0c63abe091 Makefile: disable GNU make built-in wildcard rules\n    @@ Commit message\n         Makefile: disable GNU make built-in wildcard rules\n     \n         Override built-in rules of GNU make that use a wildcard target. This\n    -    speeds things up significantly as we don't need to stat() so many\n    -    files just in case we'd be able to retrieve their contents from RCS or\n    -    SCCS. See [1] for an old mailing list discussion about how to disable\n    -    these.\n    -\n    -    This gives us a noticeable speedup on a no-op run:\n    -\n    -        $ git hyperfine -L rev HEAD~1,HEAD~0 -s 'make -j8 all NO_TCLTK=Y' 'make NO_TCLTK=Y' --warmup 10 -M 10\n    -        Benchmark 1: make NO_TCLTK=Y' in 'HEAD~1\n    -          Time (mean ± σ):     182.2 ms ±   4.1 ms    [User: 146.8 ms, System: 49.5 ms]\n    -          Range (min … max):   179.6 ms … 193.4 ms    10 runs\n    -\n    -        Benchmark 2: make NO_TCLTK=Y' in 'HEAD~0\n    -          Time (mean ± σ):     167.9 ms ±   1.3 ms    [User: 127.8 ms, System: 55.6 ms]\n    -          Range (min … max):   166.1 ms … 170.4 ms    10 runs\n    -\n    -        Summary\n    -          'make NO_TCLTK=Y' in 'HEAD~0' ran\n    -            1.09 ± 0.03 times faster than 'make NO_TCLTK=Y' in 'HEAD~1'\n    -\n    -    Running the same except with 'strace -c -S calls make' as the\n    -    benchmark command shows (under --show-output) that we went from ~7716\n    -    syscalls to ~7519, mostly a reduction in [l]stat().\n    -\n    -    We could also invoke make with \"-r\" by setting \"MAKEFLAGS = -r\" early,\n    -    adding a \"-r\" variant to the above benchmark shows that it may be 1.01\n    -    or so faster (but in my tests, always with a much bigger error\n    -    bar). But doing so is a much bigger hammer, since it will disable all\n    -    built-in rules, some (all?) of which can be seen with:\n    +    can speeds things up significantly as we don't need to stat() so many\n    +    files. GNU make does that by default to see if it can retrieve their\n    +    contents from RCS or SCCS. See [1] for an old mailing list discussion\n    +    about how to disable these.\n    +\n    +    The speed-up may wary. I've seen 1-10% depending on the speed of the\n    +    local disk, caches, -jN etc. Running:\n    +\n    +        strace -f -c -S calls make -j1 NO_TCLTK=Y\n    +\n    +    Shows that we reduce the number of syscalls we make, mostly in \"stat\"\n    +    calls.\n    +\n    +    We could also invoke make with \"-r\" by setting \"MAKEFLAGS = -r\"\n    +    early. Doing so might make us a bit faster still. But doing so is a\n    +    much bigger hammer, since it will disable all built-in rules,\n    +    some (all?) of which can be seen with:\n     \n             make -f/dev/null -p | grep -v -e ^# -e ^$\n     \n22:  4168a7e3b30 !  3:  c6c6f7cf8d8 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)\n    @@ Commit message\n     \n         This speeds things up a lot:\n     \n    -        $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make -j8 all NO_TCLTK=Y' 'make NO_TCLTK=Y' --war\n    -        mup 10 -M 10\n    -        Benchmark 1: make NO_TCLTK=Y' in 'HEAD~1\n    -          Time (mean ± σ):      99.5 ms ±   0.5 ms    [User: 83.4 ms, System: 20.7 ms]\n    -          Range (min … max):    98.8 ms … 100.2 ms    10 runs\n    +        $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make NO_TCLTK=Y' 'make -j1 NO_TCLTK=Y' --warmup 10 -M 10\n    +        Benchmark 1: make -j1 NO_TCLTK=Y' in 'HEAD~1\n    +          Time (mean ± σ):     159.9 ms ±   6.8 ms    [User: 137.2 ms, System: 28.0 ms]\n    +          Range (min … max):   154.6 ms … 175.9 ms    10 runs\n     \n    -        Benchmark 2: make NO_TCLTK=Y' in 'HEAD~0\n    -          Time (mean ± σ):      69.4 ms ±   0.5 ms    [User: 58.8 ms, System: 14.2 ms]\n    -          Range (min … max):    68.9 ms …  70.3 ms    10 runs\n    +        Benchmark 2: make -j1 NO_TCLTK=Y' in 'HEAD~0\n    +          Time (mean ± σ):     100.0 ms ±   1.3 ms    [User: 84.2 ms, System: 20.2 ms]\n    +          Range (min … max):    98.8 ms … 102.8 ms    10 runs\n     \n             Summary\n    -          'make NO_TCLTK=Y' in 'HEAD~0' ran\n    -            1.43 ± 0.01 times faster than 'make NO_TCLTK=Y' in 'HEAD~1'\n    +          'make -j1 NO_TCLTK=Y' in 'HEAD~0' ran\n    +            1.60 ± 0.07 times faster than 'make -j1 NO_TCLTK=Y' in 'HEAD~1'\n     \n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n    @@ Makefile: GENERATED_H += hook-list.h\n      LIB_OBJS += abspath.o\n      LIB_OBJS += add-interactive.o\n     @@ Makefile: perl/build/man/man3/Git.3pm: perl/Git.pm\n    - \t$(call mkdir_p_parent_template)\n    - \t$(QUIET_GEN)pod2man $< $@\n    + \t$(QUIET_GEN)mkdir -p $(dir $@) && \\\n    + \tpod2man $< $@\n      \n     -FIND_SOURCE_FILES = ( \\\n     -\tgit ls-files \\\n23:  48a3927d972 !  4:  ed64cd1bd4a Makefile: move \".SUFFIXES\" rule to shared.mak\n    @@ Commit message\n     \n         This doesn't benefit the main Makefile at all, since it already had\n         the rule, but since we're including shared.mak in other Makefiles\n    -    starts to benefit them. E.g. running the 'man\" target is now ~1.3x\n    -    faster:\n    +    starts to benefit them. E.g. running the 'man\" target is now faster:\n     \n    -        $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make -j8 -C Documentation man' 'make -C Documentation man' --warmup 10 -M 10\n    -        Benchmark 1: make -C Documentation man' in 'HEAD~1\n    -          Time (mean ± σ):      87.2 ms ±   1.0 ms    [User: 79.3 ms, System: 10.8 ms]\n    -          Range (min … max):    86.3 ms …  89.7 ms    10 runs\n    +        $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make -C Documentation man' 'make -C Documentation -j1 man'\n    +        Benchmark 1: make -C Documentation -j1 man' in 'HEAD~1\n    +          Time (mean ± σ):     121.7 ms ±   8.8 ms    [User: 105.8 ms, System: 18.6 ms]\n    +          Range (min … max):   112.8 ms … 148.4 ms    26 runs\n     \n    -        Benchmark 2: make -C Documentation man' in 'HEAD~0\n    -          Time (mean ± σ):      64.5 ms ±   0.6 ms    [User: 54.5 ms, System: 13.0 ms]\n    -          Range (min … max):    63.8 ms …  65.7 ms    10 runs\n    +        Benchmark 2: make -C Documentation -j1 man' in 'HEAD~0\n    +          Time (mean ± σ):      97.5 ms ±   8.0 ms    [User: 80.1 ms, System: 20.1 ms]\n    +          Range (min … max):    89.8 ms … 111.8 ms    32 runs\n     \n             Summary\n    -          'make -C Documentation man' in 'HEAD~0' ran\n    -            1.35 ± 0.02 times faster than 'make -C Documentation man' in 'HEAD~1'\n    +          'make -C Documentation -j1 man' in 'HEAD~0' ran\n    +            1.25 ± 0.14 times faster than 'make -C Documentation -j1 man' in 'HEAD~1'\n     \n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n13:  f378a7dc35e =  5:  1749085b929 Makefile: move $(comma), $(empty) and $(space) to shared.mak\n14:  13cbb851d32 <  -:  ----------- Makefile: re-add and use the \"shellquote\" macros\n15:  337953e4994 <  -:  ----------- Makefile: add a \"TRACK_template\" for GIT-*{FLAGS,DEFINES,...}\n16:  5bb597c1993 !  6:  c25284b24cf Makefile: add \"$(QUIET)\" boilerplate to shared.mak\n    @@ config.mak.uname: vcxproj:\n      \n     \n      ## shared.mak ##\n    -@@ shared.mak: space = $(empty) $(empty)\n    - wspfx = $(space)$(space)$(space)\n    - wspfx_sq = $(call shellquote,$(wspfx))\n    - \n    +@@\n    + comma = ,\n    + empty =\n    + space = $(empty) $(empty)\n    ++\n     +### Quieting\n     +## common\n     +QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir\n    @@ shared.mak: space = $(empty) $(empty)\n     +\texport V\n     +endif\n     +endif\n    -+\n    - ### Templates\n    - \n    - ## Template for making a GIT-SOMETHING, which changes if a\n     \n      ## templates/Makefile ##\n     @@\n17:  3c4d0589667 <  -:  ----------- Makefile: use $(wspfx) for $(QUIET...) in shared.mak\n -:  ----------- >  7:  3daef7672be Makefile: use $(wspfx) for $(QUIET...) in shared.mak\n18:  be5882b2c99 !  8:  aca560ca410 Makefiles: add and use wildcard \"mkdir -p\" template\n    @@ Commit message\n         shows that this is faster, in addition to being less verbose and more\n         reliable (this uses my \"git-hyperfine\" thin wrapper for \"hyperfine\"[3]):\n     \n    -        $ git hyperfine -L rev HEAD~0,HEAD~1 -b 'make -C Documentation lint-docs' -p 'rm -rf Documentation/.build' 'make -C Documentation lint-docs'\n    -        Benchmark 1: make -C Documentation lint-docs' in 'HEAD~0\n    -          Time (mean ± σ):      2.129 s ±  0.011 s    [User: 1.840 s, System: 0.321 s]\n    -          Range (min … max):    2.121 s …  2.158 s    10 runs\n    +        $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make -C Documentation lint-docs' -p 'rm -rf Documentation/.build' 'make -C Documentation -j1 lint-docs'\n    +        Benchmark 1: make -C Documentation -j1 lint-docs' in 'HEAD~1\n    +          Time (mean ± σ):      2.914 s ±  0.062 s    [User: 2.449 s, System: 0.489 s]\n    +          Range (min … max):    2.834 s …  3.020 s    10 runs\n     \n    -        Benchmark 2: make -C Documentation lint-docs' in 'HEAD~1\n    -          Time (mean ± σ):      2.659 s ±  0.002 s    [User: 2.306 s, System: 0.397 s]\n    -          Range (min … max):    2.657 s …  2.662 s    10 runs\n    +        Benchmark 2: make -C Documentation -j1 lint-docs' in 'HEAD~0\n    +          Time (mean ± σ):      2.315 s ±  0.062 s    [User: 1.950 s, System: 0.386 s]\n    +          Range (min … max):    2.229 s …  2.397 s    10 runs\n     \n             Summary\n    -          'make -C Documentation lint-docs' in 'HEAD~0' ran\n    -            1.25 ± 0.01 times faster than 'make -C Documentation lint-docs' in 'HEAD~1'\n    +          'make -C Documentation -j1 lint-docs' in 'HEAD~0' ran\n    +            1.26 ± 0.04 times faster than 'make -C Documentation -j1 lint-docs' in 'HEAD~1'\n     \n         So let's use that pattern both for the \"lint-docs\" target, and a few\n         miscellaneous other targets.\n    @@ Makefile: all:: $(MOFILES)\n     +\t$(call mkdir_p_parent_template)\n     +\t$(QUIET_MSGFMT)$(MSGFMT) -o $@ $<\n      \n    - ifndef NO_PERL\n    - LIB_PERL = $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm)\n    -@@ Makefile: LIB_CPAN = $(wildcard perl/FromCPAN/*.pm perl/FromCPAN/*/*.pm)\n    - LIB_CPAN_GEN = $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_CPAN))\n    + LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm)\n    + LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL))\n    +@@ Makefile: NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\\'',$(NO_PERL_CPAN_FALLBACKS))\n    + endif\n      \n      perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES\n     -\t$(QUIET_GEN)mkdir -p $(dir $@) && \\\n    @@ Makefile: LIB_CPAN = $(wildcard perl/FromCPAN/*.pm perl/FromCPAN/*/*.pm)\n     +\t$(QUIET_GEN) \\\n      \tsed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \\\n      \t    -e 's|@@NO_GETTEXT@@|$(NO_GETTEXT_SQ)|g' \\\n    - \t    -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(call shq,$(NO_PERL_CPAN_FALLBACKS))|g' \\\n    -@@ Makefile: endif\n    + \t    -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \\\n    + \t< $< > $@\n      \n    - # install-man depends on Git.3pm even with NO_PERL=Y\n      perl/build/man/man3/Git.3pm: perl/Git.pm\n     -\t$(QUIET_GEN)mkdir -p $(dir $@) && \\\n     -\tpod2man $< $@\n     +\t$(call mkdir_p_parent_template)\n     +\t$(QUIET_GEN)pod2man $< $@\n      \n    - FIND_SOURCE_FILES = ( \\\n    - \tgit ls-files \\\n    + $(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n    + \t$(QUIET_GEN)$(RM) $@+ && \\\n     @@ Makefile: test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(\n      all:: $(TEST_PROGRAMS) $(test_bindir_programs)\n      \n    @@ Makefile: test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_\n      ## shared.mak ##\n     @@ shared.mak: ifndef V\n      \tQUIET          = @\n    - \tQUIET_GEN      = @echo $(wspfx_sq) GEN $@;\n    + \tQUIET_GEN      = @echo $(wspfx_SQ) GEN $@;\n      \n    -+\tQUIET_MKDIR_P_PARENT  = @echo $(wspfx_sq) MKDIR -p $(@D);\n    ++\tQUIET_MKDIR_P_PARENT  = @echo $(wspfx_SQ) MKDIR -p $(@D);\n     +\n      ## Used in \"Makefile\"\n    - \tQUIET_CC       = @echo $(wspfx_sq) CC $@;\n    - \tQUIET_AR       = @echo $(wspfx_sq) AR $@;\n    + \tQUIET_CC       = @echo $(wspfx_SQ) CC $@;\n    + \tQUIET_AR       = @echo $(wspfx_SQ) AR $@;\n     @@ shared.mak: ifndef V\n    + \texport V\n      endif\n      endif\n    - \n    -+## Helpers\n    ++\n    ++### Templates\n    ++\n    ++## mkdir_p_parent: lazily \"mkdir -p\" the path needed for a $@\n    ++## file. Uses $(wildcard) to avoid the \"mkdir -p\" if it's not\n    ++## needed.\n    ++##\n    ++## Is racy, but in a good way; we might redundantly (and safely)\n    ++## \"mkdir -p\" when running in parallel, but won't need to exhaustively\n    ++## individual rules for \"a\" -> \"prefix\" -> \"dir\" -> \"file\" if given a\n    ++## \"a/prefix/dir/file\". This can instead be inserted at the start of\n    ++## the \"a/prefix/dir/file\" rule.\n     +define mkdir_p_parent_template\n     +$(if $(wildcard $(@D)),,$(QUIET_MKDIR_P_PARENT)$(shell mkdir -p $(@D)))\n     +endef\n    -+\n    - ### Templates\n    - \n    - ## Template for making a GIT-SOMETHING, which changes if a\n19:  2710f8af6cd <  -:  ----------- Makefile: correct the dependency graph of hook-list.h\n20:  59f22a0269a <  -:  ----------- Makefile: use $(file) I/O instead of \"FORCE\" when possible\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444308","messageId":"patch-2.8-b0c63abe091-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","subject":"[PATCH 2/8] Makefile: disable GNU make built-in wildcard rules","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:20Z","receivedAt":"2021-12-17T01:39:36Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Override built-in rules of GNU make that use a wildcard target. This\ncan speeds things up significantly as we don't need to stat() so many\nfiles. GNU make does that by default to see if it can retrieve their\ncontents from RCS or SCCS. See [1] for an old mailing list discussion\nabout how to disable these.\n\nThe speed-up may wary. I've seen 1-10% depending on the speed of the\nlocal disk, caches, -jN etc. Running:\n\n    strace -f -c -S calls make -j1 NO_TCLTK=Y\n\nShows that we reduce the number of syscalls we make, mostly in \"stat\"\ncalls.\n\nWe could also invoke make with \"-r\" by setting \"MAKEFLAGS = -r\"\nearly. Doing so might make us a bit faster still. But doing so is a\nmuch bigger hammer, since it will disable all built-in rules,\nsome (all?) of which can be seen with:\n\n    make -f/dev/null -p | grep -v -e ^# -e ^$\n\nWe may have something that relies on them, so let's go for the more\nisolated optimization here that gives us most or all of the wins.\n\n1. https://lists.gnu.org/archive/html/help-make/2002-11/msg00063.html\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n shared.mak | 11 +++++++++++\n 1 file changed, 11 insertions(+)\n\ndiff --git a/shared.mak b/shared.mak\nindex 0170bb397ae..29f0e69ecb9 100644\n--- a/shared.mak\n+++ b/shared.mak\n@@ -1,3 +1,14 @@\n+### Remove GNU make implicit rules\n+\n+## This speeds things up since we don't need to look for and stat() a\n+## \"foo.c,v\" every time a rule referring to \"foo.c\" is in play. See\n+## \"make -p -f/dev/null | grep ^%::'\".\n+%:: %,v\n+%:: RCS/%,v\n+%:: RCS/%\n+%:: s.%\n+%:: SCCS/s.%\n+\n ### Flags affecting all rules\n \n # A GNU make extension since gmake 3.72 (released in late 1994) to\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444309","messageId":"patch-1.8-f74b47662b7-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","subject":"[PATCH 1/8] Makefiles: add \"shared.mak\", move \".DELETE_ON_ERROR\" to it","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:19Z","receivedAt":"2021-12-17T01:39:36Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"We have various behavior that's shared across our Makefiles, or that\nreally should be (e.g. via defined templates). Let's create a\ntop-level \"shared.mak\" to house those sorts of things, and start by\nadding the \".DELETE_ON_ERROR\" flag to it.\n\nSee my own 7b76d6bf221 (Makefile: add and use the \".DELETE_ON_ERROR\"\nflag, 2021-06-29) and db10fc6c09f (doc: simplify Makefile using\n.DELETE_ON_ERROR, 2021-05-21) for the addition and use of the\n\".DELETE_ON_ERROR\" flag.\n\nThis does have the potential downside that if e.g. templates/Makefile\nwould like to include this \"shared.mak\" in the future the semantics of\nsuch a Makefile will change, but as noted in the above commits (and\nGNU make's own documentation) any such change would be for the better,\nso it's safe to do this.\n\nThis also doesn't introduce a bug by e.g. having this\n\".DELETE_ON_ERROR\" flag only apply to this new shared.mak, Makefiles\nhave no such scoping semantics.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Documentation/Makefile |  6 +++---\n Makefile               | 13 +++----------\n shared.mak             |  9 +++++++++\n t/Makefile             |  3 +++\n t/interop/Makefile     |  3 +++\n templates/Makefile     |  3 +++\n 6 files changed, 24 insertions(+), 13 deletions(-)\n create mode 100644 shared.mak\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex ed656db2ae9..ba27456c86a 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -1,3 +1,6 @@\n+# Import tree-wide shared Makefile behavior and libraries\n+include ../shared.mak\n+\n # Guard against environment variables\n MAN1_TXT =\n MAN5_TXT =\n@@ -524,7 +527,4 @@ doc-l10n install-l10n::\n \t$(MAKE) -C po $@\n endif\n \n-# Delete the target file on error\n-.DELETE_ON_ERROR:\n-\n .PHONY: FORCE\ndiff --git a/Makefile b/Makefile\nindex 9c00a793e47..9842a234790 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1,3 +1,6 @@\n+# Import tree-wide shared Makefile behavior and libraries\n+include shared.mak\n+\n # The default target of this Makefile is...\n all::\n \n@@ -2168,16 +2171,6 @@ shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell\n strip: $(PROGRAMS) git$X\n \t$(STRIP) $(STRIP_OPTS) $^\n \n-### Flags affecting all rules\n-\n-# A GNU make extension since gmake 3.72 (released in late 1994) to\n-# remove the target of rules if commands in those rules fail. The\n-# default is to only do that if make itself receives a signal. Affects\n-# all targets, see:\n-#\n-#    info make --index-search=.DELETE_ON_ERROR\n-.DELETE_ON_ERROR:\n-\n ### Target-specific flags and dependencies\n \n # The generic compilation pattern rule and automatically\ndiff --git a/shared.mak b/shared.mak\nnew file mode 100644\nindex 00000000000..0170bb397ae\n--- /dev/null\n+++ b/shared.mak\n@@ -0,0 +1,9 @@\n+### Flags affecting all rules\n+\n+# A GNU make extension since gmake 3.72 (released in late 1994) to\n+# remove the target of rules if commands in those rules fail. The\n+# default is to only do that if make itself receives a signal. Affects\n+# all targets, see:\n+#\n+#    info make --index-search=.DELETE_ON_ERROR\n+.DELETE_ON_ERROR:\ndiff --git a/t/Makefile b/t/Makefile\nindex 882d26eee30..795b94b50ce 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -1,3 +1,6 @@\n+# Import tree-wide shared Makefile behavior and libraries\n+include ../shared.mak\n+\n # Run tests\n #\n # Copyright (c) 2005 Junio C Hamano\ndiff --git a/t/interop/Makefile b/t/interop/Makefile\nindex 31a4bbc716a..6911c2915a7 100644\n--- a/t/interop/Makefile\n+++ b/t/interop/Makefile\n@@ -1,3 +1,6 @@\n+# Import tree-wide shared Makefile behavior and libraries\n+include ../../shared.mak\n+\n -include ../../config.mak\n export GIT_TEST_OPTIONS\n \ndiff --git a/templates/Makefile b/templates/Makefile\nindex d22a71a3999..636cee52f51 100644\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -1,3 +1,6 @@\n+# Import tree-wide shared Makefile behavior and libraries\n+include ../shared.mak\n+\n # make and install sample templates\n \n ifndef V\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444310","messageId":"patch-3.8-c6c6f7cf8d8-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","subject":"[PATCH 3/8] Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:21Z","receivedAt":"2021-12-17T01:39:39Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Combine the definitions of $(FIND_SOURCE_FILES) and $(LIB_H) to speed\nup the Makefile, as these are the two main expensive $(shell) commands\nthat we execute unconditionally.\n\nWhen see what was in $(FOUND_SOURCE_FILES) that wasn't in $(LIB_H) via\nthe ad-hoc test of:\n\n    $(error $(filter-out $(LIB_H),$(filter %.h,$(ALL_SOURCE_FILES))))\n    $(error $(filter-out $(ALL_SOURCE_FILES),$(filter %.h,$(LIB_H))))\n\nWe'll get, respectively:\n\n    Makefile:850: *** t/helper/test-tool.h.  Stop.\n    Makefile:850: *** .  Stop.\n\nI.e. we only had a discrepancy when it came to\nt/helper/test-tool.h. In terms of correctness this was broken before,\nbut now works:\n\n    $ make t/helper/test-tool.hco\n        HDR t/helper/test-tool.h\n\nThis speeds things up a lot:\n\n    $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make NO_TCLTK=Y' 'make -j1 NO_TCLTK=Y' --warmup 10 -M 10\n    Benchmark 1: make -j1 NO_TCLTK=Y' in 'HEAD~1\n      Time (mean ± σ):     159.9 ms ±   6.8 ms    [User: 137.2 ms, System: 28.0 ms]\n      Range (min … max):   154.6 ms … 175.9 ms    10 runs\n\n    Benchmark 2: make -j1 NO_TCLTK=Y' in 'HEAD~0\n      Time (mean ± σ):     100.0 ms ±   1.3 ms    [User: 84.2 ms, System: 20.2 ms]\n      Range (min … max):    98.8 ms … 102.8 ms    10 runs\n\n    Summary\n      'make -j1 NO_TCLTK=Y' in 'HEAD~0' ran\n        1.60 ± 0.07 times faster than 'make -j1 NO_TCLTK=Y' in 'HEAD~1'\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 54 ++++++++++++++++++++++++++----------------------------\n 1 file changed, 26 insertions(+), 28 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 9842a234790..d290a28671a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -826,12 +826,33 @@ GENERATED_H += hook-list.h\n .PHONY: generated-hdrs\n generated-hdrs: $(GENERATED_H)\n \n-LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \\\n+## Exhaustive lists of our source files, either dynamically generated,\n+## or hardcoded.\n+SOURCES_CMD = ( \\\n+\tgit ls-files \\\n+\t\t'*.[hcS]' \\\n+\t\t'*.sh' \\\n+\t\t':!*[tp][0-9][0-9][0-9][0-9]*' \\\n+\t\t':!contrib' \\\n+\t\t2>/dev/null || \\\n \t$(FIND) . \\\n-\t-name .git -prune -o \\\n-\t-name t -prune -o \\\n-\t-name Documentation -prune -o \\\n-\t-name '*.h' -print)))\n+\t\t\\( -name .git -type d -prune \\) \\\n+\t\t-o \\( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \\) \\\n+\t\t-o \\( -name contrib -type d -prune \\) \\\n+\t\t-o \\( -name build -type d -prune \\) \\\n+\t\t-o \\( -name 'trash*' -type d -prune \\) \\\n+\t\t-o \\( -name '*.[hcS]' -type f -print \\) \\\n+\t\t-o \\( -name '*.sh' -type f -print \\) \\\n+\t\t| sed -e 's|^\\./||' \\\n+\t)\n+FOUND_SOURCE_FILES := $(shell $(SOURCES_CMD))\n+\n+FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))\n+FOUND_H_SOURCES = $(filter %.h,$(FOUND_SOURCE_FILES))\n+\n+COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))\n+\n+LIB_H = $(FOUND_H_SOURCES)\n \n LIB_OBJS += abspath.o\n LIB_OBJS += add-interactive.o\n@@ -2748,26 +2769,6 @@ perl/build/man/man3/Git.3pm: perl/Git.pm\n \t$(QUIET_GEN)mkdir -p $(dir $@) && \\\n \tpod2man $< $@\n \n-FIND_SOURCE_FILES = ( \\\n-\tgit ls-files \\\n-\t\t'*.[hcS]' \\\n-\t\t'*.sh' \\\n-\t\t':!*[tp][0-9][0-9][0-9][0-9]*' \\\n-\t\t':!contrib' \\\n-\t\t2>/dev/null || \\\n-\t$(FIND) . \\\n-\t\t\\( -name .git -type d -prune \\) \\\n-\t\t-o \\( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \\) \\\n-\t\t-o \\( -name contrib -type d -prune \\) \\\n-\t\t-o \\( -name build -type d -prune \\) \\\n-\t\t-o \\( -name 'trash*' -type d -prune \\) \\\n-\t\t-o \\( -name '*.[hcS]' -type f -print \\) \\\n-\t\t-o \\( -name '*.sh' -type f -print \\) \\\n-\t\t| sed -e 's|^\\./||' \\\n-\t)\n-\n-FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))\n-\n $(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) $@+ && \\\n \techo $(FOUND_SOURCE_FILES) | xargs etags -a -o $@+ && \\\n@@ -2977,9 +2978,6 @@ check: $(GENERATED_H)\n \t\texit 1; \\\n \tfi\n \n-FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))\n-COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))\n-\n %.cocci.patch: %.cocci $(COCCI_SOURCES)\n \t$(QUIET_SPATCH) \\\n \tif test $(SPATCH_BATCH_SIZE) = 0; then \\\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444312","messageId":"patch-4.8-ed64cd1bd4a-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","subject":"[PATCH 4/8] Makefile: move \".SUFFIXES\" rule to shared.mak","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:22Z","receivedAt":"2021-12-17T01:39:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This was added in 30248886ce8 (Makefile: disable default implicit\nrules, 2010-01-26), let's move it to the top of \"shared.mak\" so it'll\napply to all our Makefiles.\n\nThis doesn't benefit the main Makefile at all, since it already had\nthe rule, but since we're including shared.mak in other Makefiles\nstarts to benefit them. E.g. running the 'man\" target is now faster:\n\n    $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make -C Documentation man' 'make -C Documentation -j1 man'\n    Benchmark 1: make -C Documentation -j1 man' in 'HEAD~1\n      Time (mean ± σ):     121.7 ms ±   8.8 ms    [User: 105.8 ms, System: 18.6 ms]\n      Range (min … max):   112.8 ms … 148.4 ms    26 runs\n\n    Benchmark 2: make -C Documentation -j1 man' in 'HEAD~0\n      Time (mean ± σ):      97.5 ms ±   8.0 ms    [User: 80.1 ms, System: 20.1 ms]\n      Range (min … max):    89.8 ms … 111.8 ms    32 runs\n\n    Summary\n      'make -C Documentation -j1 man' in 'HEAD~0' ran\n        1.25 ± 0.14 times faster than 'make -C Documentation -j1 man' in 'HEAD~1'\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile   | 2 --\n shared.mak | 5 +++++\n 2 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d290a28671a..50359603dbc 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2543,8 +2543,6 @@ ASM_SRC := $(wildcard $(OBJECTS:o=S))\n ASM_OBJ := $(ASM_SRC:S=o)\n C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))\n \n-.SUFFIXES:\n-\n $(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)\n \t$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<\n $(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)\ndiff --git a/shared.mak b/shared.mak\nindex 29f0e69ecb9..155ac84f867 100644\n--- a/shared.mak\n+++ b/shared.mak\n@@ -9,6 +9,11 @@\n %:: s.%\n %:: SCCS/s.%\n \n+## Likewise delete default $(SUFFIXES). See:\n+##\n+##     info make --index-search=.DELETE_ON_ERROR\n+.SUFFIXES:\n+\n ### Flags affecting all rules\n \n # A GNU make extension since gmake 3.72 (released in late 1994) to\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444311","messageId":"patch-5.8-1749085b929-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","subject":"[PATCH 5/8] Makefile: move $(comma), $(empty) and $(space) to shared.mak","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:23Z","receivedAt":"2021-12-17T01:39:42Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Move these variables over to the shared.max, we'll make use of them in\na subsequent commit. There was no reason for these to be \"simply\nexpanded variables\", so let's use the normal lazy \"=\" assignment here.\n\nSee 425ca6710b2 (Makefile: allow combining UBSan with other\nsanitizers, 2017-07-15) for the commit that introduced these.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile   | 4 ----\n shared.mak | 8 ++++++++\n 2 files changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 50359603dbc..4dfb88ccb3f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1278,10 +1278,6 @@ endif\n ALL_CFLAGS = $(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n \n-comma := ,\n-empty :=\n-space := $(empty) $(empty)\n-\n ifdef SANITIZE\n SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))\n BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)\ndiff --git a/shared.mak b/shared.mak\nindex 155ac84f867..b34fb948c0f 100644\n--- a/shared.mak\n+++ b/shared.mak\n@@ -23,3 +23,11 @@\n #\n #    info make --index-search=.DELETE_ON_ERROR\n .DELETE_ON_ERROR:\n+\n+### Global variables\n+\n+## comma, empty, space: handy variables as these tokens are either\n+## special or can be hard to spot among other Makefile syntax.\n+comma = ,\n+empty =\n+space = $(empty) $(empty)\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444313","messageId":"patch-6.8-c25284b24cf-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","subject":"[PATCH 6/8] Makefile: add \"$(QUIET)\" boilerplate to shared.mak","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:24Z","receivedAt":"2021-12-17T01:39:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The $(QUIET) variables we define are largely duplicated between our\nvarious Makefiles, let's define them in the new \"shared.mak\" instead.\n\nSince we're not using the environment to pass these around we don't\nneed to export the \"QUIET_GEN\" and \"QUIET_BUILT_IN\" variables\nanymore. The \"QUIET_GEN\" variable is used in \"git-gui/Makefile\" and\n\"gitweb/Makefile\", but they've got their own definition for those. The\n\"QUIET_BUILT_IN\" variable is only used in the top-level \"Makefile\". We\nstill need to export the \"V\" variable.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Documentation/Makefile | 32 -------------------------\n Makefile               | 33 --------------------------\n config.mak.uname       |  1 -\n shared.mak             | 53 ++++++++++++++++++++++++++++++++++++++++++\n templates/Makefile     |  5 ----\n 5 files changed, 53 insertions(+), 71 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex ba27456c86a..0f4ebdeda8a 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -218,38 +218,6 @@ DEFAULT_EDITOR_SQ = $(subst ','\\'',$(DEFAULT_EDITOR))\n ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'\n endif\n \n-QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir\n-QUIET_SUBDIR1  =\n-\n-ifneq ($(findstring $(MAKEFLAGS),w),w)\n-PRINT_DIR = --no-print-directory\n-else # \"make -w\"\n-NO_SUBDIR = :\n-endif\n-\n-ifneq ($(findstring $(MAKEFLAGS),s),s)\n-ifndef V\n-\tQUIET\t\t= @\n-\tQUIET_ASCIIDOC\t= @echo '   ' ASCIIDOC $@;\n-\tQUIET_XMLTO\t= @echo '   ' XMLTO $@;\n-\tQUIET_DB2TEXI\t= @echo '   ' DB2TEXI $@;\n-\tQUIET_MAKEINFO\t= @echo '   ' MAKEINFO $@;\n-\tQUIET_DBLATEX\t= @echo '   ' DBLATEX $@;\n-\tQUIET_XSLTPROC\t= @echo '   ' XSLTPROC $@;\n-\tQUIET_GEN\t= @echo '   ' GEN $@;\n-\tQUIET_STDERR\t= 2> /dev/null\n-\tQUIET_SUBDIR0\t= +@subdir=\n-\tQUIET_SUBDIR1\t= ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \\\n-\t\t\t  $(MAKE) $(PRINT_DIR) -C $$subdir\n-\n-\tQUIET_LINT_GITLINK\t= @echo '   ' LINT GITLINK $<;\n-\tQUIET_LINT_MANSEC\t= @echo '   ' LINT MAN SEC $<;\n-\tQUIET_LINT_MANEND\t= @echo '   ' LINT MAN END $<;\n-\n-\texport V\n-endif\n-endif\n-\n all: html man\n \n html: $(DOC_HTML)\ndiff --git a/Makefile b/Makefile\nindex 4dfb88ccb3f..9f27fc77e5a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1970,39 +1970,6 @@ ifndef PAGER_ENV\n PAGER_ENV = LESS=FRX LV=-c\n endif\n \n-QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir\n-QUIET_SUBDIR1  =\n-\n-ifneq ($(findstring w,$(MAKEFLAGS)),w)\n-PRINT_DIR = --no-print-directory\n-else # \"make -w\"\n-NO_SUBDIR = :\n-endif\n-\n-ifneq ($(findstring s,$(MAKEFLAGS)),s)\n-ifndef V\n-\tQUIET_CC       = @echo '   ' CC $@;\n-\tQUIET_AR       = @echo '   ' AR $@;\n-\tQUIET_LINK     = @echo '   ' LINK $@;\n-\tQUIET_BUILT_IN = @echo '   ' BUILTIN $@;\n-\tQUIET_GEN      = @echo '   ' GEN $@;\n-\tQUIET_LNCP     = @echo '   ' LN/CP $@;\n-\tQUIET_XGETTEXT = @echo '   ' XGETTEXT $@;\n-\tQUIET_MSGFMT   = @echo '   ' MSGFMT $@;\n-\tQUIET_GCOV     = @echo '   ' GCOV $@;\n-\tQUIET_SP       = @echo '   ' SP $<;\n-\tQUIET_HDR      = @echo '   ' HDR $(<:hcc=h);\n-\tQUIET_RC       = @echo '   ' RC $@;\n-\tQUIET_SPATCH   = @echo '   ' SPATCH $<;\n-\tQUIET_SUBDIR0  = +@subdir=\n-\tQUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \\\n-\t\t\t $(MAKE) $(PRINT_DIR) -C $$subdir\n-\texport V\n-\texport QUIET_GEN\n-\texport QUIET_BUILT_IN\n-endif\n-endif\n-\n ifdef NO_INSTALL_HARDLINKS\n \texport NO_INSTALL_HARDLINKS\n endif\ndiff --git a/config.mak.uname b/config.mak.uname\nindex a3a779327f8..cfc2416c935 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -720,7 +720,6 @@ vcxproj:\n \tgit diff-index --cached --quiet HEAD --\n \n \t# Make .vcxproj files and add them\n-\tunset QUIET_GEN QUIET_BUILT_IN; \\\n \tperl contrib/buildsystems/generate -g Vcxproj\n \tgit add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj\n \ndiff --git a/shared.mak b/shared.mak\nindex b34fb948c0f..d6f70f3d6c9 100644\n--- a/shared.mak\n+++ b/shared.mak\n@@ -31,3 +31,56 @@\n comma = ,\n empty =\n space = $(empty) $(empty)\n+\n+### Quieting\n+## common\n+QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir\n+QUIET_SUBDIR1  =\n+\n+ifneq ($(findstring w,$(MAKEFLAGS)),w)\n+PRINT_DIR = --no-print-directory\n+else # \"make -w\"\n+NO_SUBDIR = :\n+endif\n+\n+ifneq ($(findstring s,$(MAKEFLAGS)),s)\n+ifndef V\n+## common\n+\tQUIET_SUBDIR0  = +@subdir=\n+\tQUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \\\n+\t\t\t $(MAKE) $(PRINT_DIR) -C $$subdir\n+\n+\tQUIET          = @\n+\tQUIET_GEN      = @echo '   ' GEN $@;\n+\n+## Used in \"Makefile\"\n+\tQUIET_CC       = @echo '   ' CC $@;\n+\tQUIET_AR       = @echo '   ' AR $@;\n+\tQUIET_LINK     = @echo '   ' LINK $@;\n+\tQUIET_BUILT_IN = @echo '   ' BUILTIN $@;\n+\tQUIET_LNCP     = @echo '   ' LN/CP $@;\n+\tQUIET_XGETTEXT = @echo '   ' XGETTEXT $@;\n+\tQUIET_MSGFMT   = @echo '   ' MSGFMT $@;\n+\tQUIET_GCOV     = @echo '   ' GCOV $@;\n+\tQUIET_SP       = @echo '   ' SP $<;\n+\tQUIET_HDR      = @echo '   ' HDR $(<:hcc=h);\n+\tQUIET_RC       = @echo '   ' RC $@;\n+\tQUIET_SPATCH   = @echo '   ' SPATCH $<;\n+\n+## Used in \"Documentation/Makefile\"\n+\tQUIET_ASCIIDOC\t= @echo '   ' ASCIIDOC $@;\n+\tQUIET_XMLTO\t= @echo '   ' XMLTO $@;\n+\tQUIET_DB2TEXI\t= @echo '   ' DB2TEXI $@;\n+\tQUIET_MAKEINFO\t= @echo '   ' MAKEINFO $@;\n+\tQUIET_DBLATEX\t= @echo '   ' DBLATEX $@;\n+\tQUIET_XSLTPROC\t= @echo '   ' XSLTPROC $@;\n+\tQUIET_GEN\t= @echo '   ' GEN $@;\n+\tQUIET_STDERR\t= 2> /dev/null\n+\n+\tQUIET_LINT_GITLINK\t= @echo '   ' LINT GITLINK $<;\n+\tQUIET_LINT_MANSEC\t= @echo '   ' LINT MAN SEC $<;\n+\tQUIET_LINT_MANEND\t= @echo '   ' LINT MAN END $<;\n+\n+\texport V\n+endif\n+endif\ndiff --git a/templates/Makefile b/templates/Makefile\nindex 636cee52f51..367ad00c24c 100644\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -2,11 +2,6 @@\n include ../shared.mak\n \n # make and install sample templates\n-\n-ifndef V\n-\tQUIET = @\n-endif\n-\n INSTALL ?= install\n TAR ?= tar\n RM ?= rm -f\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444315","messageId":"patch-8.8-aca560ca410-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","subject":"[PATCH 8/8] Makefiles: add and use wildcard \"mkdir -p\" template","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:26Z","receivedAt":"2021-12-17T01:39:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a template to do the \"mkdir -p\" of $(@D) (the parent dir of $@)\nfor us, and use it for the \"make lint-docs\" targets I added in\n8650c6298c1 (doc lint: make \"lint-docs\" non-.PHONY, 2021-10-15).\n\nAs seen in 4c64fb5aad9 (Documentation/Makefile: fix lint-docs mkdir\ndependency, 2021-10-26) maintaining these manual lists of parent\ndirectory dependencies is fragile, in addition to being obviously\nverbose.\n\nI used this pattern at the time because I couldn't find another method\nthan \"order-only\" prerequisites to avoid doing a \"mkdir -p $(@D)\" for\nevery file being created, which as noted in [1] would be significantly\nslower.\n\nBut as it turns out we can use this neat trick of only doing a \"mkdir\n-p\" if the $(wildcard) macro tells us the path doesn't exist. A re-run\nof a performance test similar to thatnoted downthread of [1] in [2]\nshows that this is faster, in addition to being less verbose and more\nreliable (this uses my \"git-hyperfine\" thin wrapper for \"hyperfine\"[3]):\n\n    $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make -C Documentation lint-docs' -p 'rm -rf Documentation/.build' 'make -C Documentation -j1 lint-docs'\n    Benchmark 1: make -C Documentation -j1 lint-docs' in 'HEAD~1\n      Time (mean ± σ):      2.914 s ±  0.062 s    [User: 2.449 s, System: 0.489 s]\n      Range (min … max):    2.834 s …  3.020 s    10 runs\n\n    Benchmark 2: make -C Documentation -j1 lint-docs' in 'HEAD~0\n      Time (mean ± σ):      2.315 s ±  0.062 s    [User: 1.950 s, System: 0.386 s]\n      Range (min … max):    2.229 s …  2.397 s    10 runs\n\n    Summary\n      'make -C Documentation -j1 lint-docs' in 'HEAD~0' ran\n        1.26 ± 0.04 times faster than 'make -C Documentation -j1 lint-docs' in 'HEAD~1'\n\nSo let's use that pattern both for the \"lint-docs\" target, and a few\nmiscellaneous other targets.\n\nThis method of creating parent directories is explicitly racy in that\nwe don't know if we're going to say always create a \"foo\" followed by\na \"foo/bar\" under parallelism, or skip the \"foo\" because we created\n\"foo/bar\" first. In this case it doesn't matter for anything except\nthat we aren't guaranteed to get the same number of rules firing when\nrunning make in parallel.\n\n1. https://lore.kernel.org/git/211028.861r45y3pt.gmgdl@evledraar.gmail.com/\n2. https://lore.kernel.org/git/211028.86o879vvtp.gmgdl@evledraar.gmail.com/\n3. https://gitlab.com/avar/git-hyperfine/\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Documentation/Makefile | 25 +++----------------------\n Makefile               | 12 +++++++-----\n shared.mak             | 17 +++++++++++++++++\n 3 files changed, 27 insertions(+), 27 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 0f4ebdeda8a..1eb9192dae8 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -434,25 +434,11 @@ quick-install-html: require-htmlrepo\n print-man1:\n \t@for i in $(MAN1_TXT); do echo $$i; done\n \n-## Lint: Common\n-.build:\n-\t$(QUIET)mkdir $@\n-.build/lint-docs: | .build\n-\t$(QUIET)mkdir $@\n-\n ## Lint: gitlink\n-.build/lint-docs/gitlink: | .build/lint-docs\n-\t$(QUIET)mkdir $@\n-.build/lint-docs/gitlink/howto: | .build/lint-docs/gitlink\n-\t$(QUIET)mkdir $@\n-.build/lint-docs/gitlink/config: | .build/lint-docs/gitlink\n-\t$(QUIET)mkdir $@\n LINT_DOCS_GITLINK = $(patsubst %.txt,.build/lint-docs/gitlink/%.ok,$(HOWTO_TXT) $(DOC_DEP_TXT))\n-$(LINT_DOCS_GITLINK): | .build/lint-docs/gitlink\n-$(LINT_DOCS_GITLINK): | .build/lint-docs/gitlink/howto\n-$(LINT_DOCS_GITLINK): | .build/lint-docs/gitlink/config\n $(LINT_DOCS_GITLINK): lint-gitlink.perl\n $(LINT_DOCS_GITLINK): .build/lint-docs/gitlink/%.ok: %.txt\n+\t$(call mkdir_p_parent_template)\n \t$(QUIET_LINT_GITLINK)$(PERL_PATH) lint-gitlink.perl \\\n \t\t$< \\\n \t\t$(HOWTO_TXT) $(DOC_DEP_TXT) \\\n@@ -463,23 +449,18 @@ $(LINT_DOCS_GITLINK): .build/lint-docs/gitlink/%.ok: %.txt\n lint-docs-gitlink: $(LINT_DOCS_GITLINK)\n \n ## Lint: man-end-blurb\n-.build/lint-docs/man-end-blurb: | .build/lint-docs\n-\t$(QUIET)mkdir $@\n LINT_DOCS_MAN_END_BLURB = $(patsubst %.txt,.build/lint-docs/man-end-blurb/%.ok,$(MAN_TXT))\n-$(LINT_DOCS_MAN_END_BLURB): | .build/lint-docs/man-end-blurb\n $(LINT_DOCS_MAN_END_BLURB): lint-man-end-blurb.perl\n $(LINT_DOCS_MAN_END_BLURB): .build/lint-docs/man-end-blurb/%.ok: %.txt\n+\t$(call mkdir_p_parent_template)\n \t$(QUIET_LINT_MANEND)$(PERL_PATH) lint-man-end-blurb.perl $< >$@\n .PHONY: lint-docs-man-end-blurb\n-lint-docs-man-end-blurb: $(LINT_DOCS_MAN_END_BLURB)\n \n ## Lint: man-section-order\n-.build/lint-docs/man-section-order: | .build/lint-docs\n-\t$(QUIET)mkdir $@\n LINT_DOCS_MAN_SECTION_ORDER = $(patsubst %.txt,.build/lint-docs/man-section-order/%.ok,$(MAN_TXT))\n-$(LINT_DOCS_MAN_SECTION_ORDER): | .build/lint-docs/man-section-order\n $(LINT_DOCS_MAN_SECTION_ORDER): lint-man-section-order.perl\n $(LINT_DOCS_MAN_SECTION_ORDER): .build/lint-docs/man-section-order/%.ok: %.txt\n+\t$(call mkdir_p_parent_template)\n \t$(QUIET_LINT_MANSEC)$(PERL_PATH) lint-man-section-order.perl $< >$@\n .PHONY: lint-docs-man-section-order\n lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER)\ndiff --git a/Makefile b/Makefile\nindex 9f27fc77e5a..ed601534967 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2704,7 +2704,8 @@ all:: $(MOFILES)\n endif\n \n po/build/locale/%/LC_MESSAGES/git.mo: po/%.po\n-\t$(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<\n+\t$(call mkdir_p_parent_template)\n+\t$(QUIET_MSGFMT)$(MSGFMT) -o $@ $<\n \n LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm)\n LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL))\n@@ -2720,15 +2721,16 @@ NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\\'',$(NO_PERL_CPAN_FALLBACKS))\n endif\n \n perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES\n-\t$(QUIET_GEN)mkdir -p $(dir $@) && \\\n+\t$(call mkdir_p_parent_template)\n+\t$(QUIET_GEN) \\\n \tsed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \\\n \t    -e 's|@@NO_GETTEXT@@|$(NO_GETTEXT_SQ)|g' \\\n \t    -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \\\n \t< $< > $@\n \n perl/build/man/man3/Git.3pm: perl/Git.pm\n-\t$(QUIET_GEN)mkdir -p $(dir $@) && \\\n-\tpod2man $< $@\n+\t$(call mkdir_p_parent_template)\n+\t$(QUIET_GEN)pod2man $< $@\n \n $(ETAGS_TARGET): $(FOUND_SOURCE_FILES)\n \t$(QUIET_GEN)$(RM) $@+ && \\\n@@ -2862,7 +2864,7 @@ test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(\n all:: $(TEST_PROGRAMS) $(test_bindir_programs)\n \n bin-wrappers/%: wrap-for-bin.sh\n-\t@mkdir -p bin-wrappers\n+\t$(call mkdir_p_parent_template)\n \t$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n \t     -e 's|@@BUILD_DIR@@|$(shell pwd)|' \\\n \t     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \\\ndiff --git a/shared.mak b/shared.mak\nindex f8ebaf30569..13fb5eb93bb 100644\n--- a/shared.mak\n+++ b/shared.mak\n@@ -59,6 +59,8 @@ ifndef V\n \tQUIET          = @\n \tQUIET_GEN      = @echo $(wspfx_SQ) GEN $@;\n \n+\tQUIET_MKDIR_P_PARENT  = @echo $(wspfx_SQ) MKDIR -p $(@D);\n+\n ## Used in \"Makefile\"\n \tQUIET_CC       = @echo $(wspfx_SQ) CC $@;\n \tQUIET_AR       = @echo $(wspfx_SQ) AR $@;\n@@ -90,3 +92,18 @@ ifndef V\n \texport V\n endif\n endif\n+\n+### Templates\n+\n+## mkdir_p_parent: lazily \"mkdir -p\" the path needed for a $@\n+## file. Uses $(wildcard) to avoid the \"mkdir -p\" if it's not\n+## needed.\n+##\n+## Is racy, but in a good way; we might redundantly (and safely)\n+## \"mkdir -p\" when running in parallel, but won't need to exhaustively\n+## individual rules for \"a\" -> \"prefix\" -> \"dir\" -> \"file\" if given a\n+## \"a/prefix/dir/file\". This can instead be inserted at the start of\n+## the \"a/prefix/dir/file\" rule.\n+define mkdir_p_parent_template\n+$(if $(wildcard $(@D)),,$(QUIET_MKDIR_P_PARENT)$(shell mkdir -p $(@D)))\n+endef\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444314","messageId":"patch-7.8-3daef7672be-20211217T012902Z-avarab@gmail.com","threadId":"57101","inReplyTo":"cover-0.8-00000000000-20211217T012902Z-avarab@gmail.com","subject":"[PATCH 7/8] Makefile: use $(wspfx) for $(QUIET...) in shared.mak","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-17T01:39:25Z","receivedAt":"2021-12-17T01:39:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the mostly move-only change in the preceding commit to use the\n$(wspfx) variable for defining the QUIET padding, to guarantee that\nit's consistent with the \"TRACK_template\" template.\n\n    $ make CFLAGS=-I$RANDOM grep.o wspfx='$(space)->'\n     -> GIT-CFLAGS PARAMETERS (changed)\n     -> CC grep.o\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n shared.mak | 54 ++++++++++++++++++++++++++++++------------------------\n 1 file changed, 30 insertions(+), 24 deletions(-)\n\ndiff --git a/shared.mak b/shared.mak\nindex d6f70f3d6c9..f8ebaf30569 100644\n--- a/shared.mak\n+++ b/shared.mak\n@@ -32,6 +32,12 @@ comma = ,\n empty =\n space = $(empty) $(empty)\n \n+## wspfx: the whitespace prefix padding for $(QUIET...) and similarly\n+## aligned output.\n+wspfx = $(space)$(space)$(space)\n+wspfx_SQ = '$(subst ','\\'',$(wspfx))'\n+# ' closing quote to appease Emacs make-mode.elxo\n+\n ### Quieting\n ## common\n QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir\n@@ -47,39 +53,39 @@ ifneq ($(findstring s,$(MAKEFLAGS)),s)\n ifndef V\n ## common\n \tQUIET_SUBDIR0  = +@subdir=\n-\tQUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \\\n+\tQUIET_SUBDIR1  = ;$(NO_SUBDIR) echo $(wspfx_SQ) SUBDIR $$subdir; \\\n \t\t\t $(MAKE) $(PRINT_DIR) -C $$subdir\n \n \tQUIET          = @\n-\tQUIET_GEN      = @echo '   ' GEN $@;\n+\tQUIET_GEN      = @echo $(wspfx_SQ) GEN $@;\n \n ## Used in \"Makefile\"\n-\tQUIET_CC       = @echo '   ' CC $@;\n-\tQUIET_AR       = @echo '   ' AR $@;\n-\tQUIET_LINK     = @echo '   ' LINK $@;\n-\tQUIET_BUILT_IN = @echo '   ' BUILTIN $@;\n-\tQUIET_LNCP     = @echo '   ' LN/CP $@;\n-\tQUIET_XGETTEXT = @echo '   ' XGETTEXT $@;\n-\tQUIET_MSGFMT   = @echo '   ' MSGFMT $@;\n-\tQUIET_GCOV     = @echo '   ' GCOV $@;\n-\tQUIET_SP       = @echo '   ' SP $<;\n-\tQUIET_HDR      = @echo '   ' HDR $(<:hcc=h);\n-\tQUIET_RC       = @echo '   ' RC $@;\n-\tQUIET_SPATCH   = @echo '   ' SPATCH $<;\n+\tQUIET_CC       = @echo $(wspfx_SQ) CC $@;\n+\tQUIET_AR       = @echo $(wspfx_SQ) AR $@;\n+\tQUIET_LINK     = @echo $(wspfx_SQ) LINK $@;\n+\tQUIET_BUILT_IN = @echo $(wspfx_SQ) BUILTIN $@;\n+\tQUIET_LNCP     = @echo $(wspfx_SQ) LN/CP $@;\n+\tQUIET_XGETTEXT = @echo $(wspfx_SQ) XGETTEXT $@;\n+\tQUIET_MSGFMT   = @echo $(wspfx_SQ) MSGFMT $@;\n+\tQUIET_GCOV     = @echo $(wspfx_SQ) GCOV $@;\n+\tQUIET_SP       = @echo $(wspfx_SQ) SP $<;\n+\tQUIET_HDR      = @echo $(wspfx_SQ) HDR $(<:hcc=h);\n+\tQUIET_RC       = @echo $(wspfx_SQ) RC $@;\n+\tQUIET_SPATCH   = @echo $(wspfx_SQ) SPATCH $<;\n \n ## Used in \"Documentation/Makefile\"\n-\tQUIET_ASCIIDOC\t= @echo '   ' ASCIIDOC $@;\n-\tQUIET_XMLTO\t= @echo '   ' XMLTO $@;\n-\tQUIET_DB2TEXI\t= @echo '   ' DB2TEXI $@;\n-\tQUIET_MAKEINFO\t= @echo '   ' MAKEINFO $@;\n-\tQUIET_DBLATEX\t= @echo '   ' DBLATEX $@;\n-\tQUIET_XSLTPROC\t= @echo '   ' XSLTPROC $@;\n-\tQUIET_GEN\t= @echo '   ' GEN $@;\n+\tQUIET_ASCIIDOC\t= @echo $(wspfx_SQ) ASCIIDOC $@;\n+\tQUIET_XMLTO\t= @echo $(wspfx_SQ) XMLTO $@;\n+\tQUIET_DB2TEXI\t= @echo $(wspfx_SQ) DB2TEXI $@;\n+\tQUIET_MAKEINFO\t= @echo $(wspfx_SQ) MAKEINFO $@;\n+\tQUIET_DBLATEX\t= @echo $(wspfx_SQ) DBLATEX $@;\n+\tQUIET_XSLTPROC\t= @echo $(wspfx_SQ) XSLTPROC $@;\n+\tQUIET_GEN\t= @echo $(wspfx_SQ) GEN $@;\n \tQUIET_STDERR\t= 2> /dev/null\n \n-\tQUIET_LINT_GITLINK\t= @echo '   ' LINT GITLINK $<;\n-\tQUIET_LINT_MANSEC\t= @echo '   ' LINT MAN SEC $<;\n-\tQUIET_LINT_MANEND\t= @echo '   ' LINT MAN END $<;\n+\tQUIET_LINT_GITLINK\t= @echo $(wspfx_SQ) LINT GITLINK $<;\n+\tQUIET_LINT_MANSEC\t= @echo $(wspfx_SQ) LINT MAN SEC $<;\n+\tQUIET_LINT_MANEND\t= @echo $(wspfx_SQ) LINT MAN END $<;\n \n \texport V\n endif\n-- \n2.34.1.1119.g7a3fc8778ee\n\n"},{"id":"444333","messageId":"CAPig+cQt47U9E8kUFiTBecEPcTaLhRCi5X_T=nPqZM-HJR=n0g@mail.gmail.com","threadId":"57101","inReplyTo":"patch-8.8-aca560ca410-20211217T012902Z-avarab@gmail.com","subject":"Re: [PATCH 8/8] Makefiles: add and use wildcard \"mkdir -p\" template","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-12-17T06:09:30Z","receivedAt":"2021-12-17T06:09:42Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Dec 16, 2021 at 11:40 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> [...]\n> But as it turns out we can use this neat trick of only doing a \"mkdir\n> -p\" if the $(wildcard) macro tells us the path doesn't exist. A re-run\n> of a performance test similar to thatnoted downthread of [1] in [2]\n> shows that this is faster, in addition to being less verbose and more\n> reliable (this uses my \"git-hyperfine\" thin wrapper for \"hyperfine\"[3]):\n\ns/thatnoted/that noted/\n\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n> diff --git a/shared.mak b/shared.mak\n> @@ -90,3 +92,18 @@ ifndef V\n> +## Is racy, but in a good way; we might redundantly (and safely)\n> +## \"mkdir -p\" when running in parallel, but won't need to exhaustively\n> +## individual rules for \"a\" -> \"prefix\" -> \"dir\" -> \"file\" if given a\n> +## \"a/prefix/dir/file\". This can instead be inserted at the start of\n> +## the \"a/prefix/dir/file\" rule.\n\nIs there a word missing between \"exhaustively\" and \"individual\"?\n"},{"id":"444920","messageId":"211224.867dbthpcd.gmgdl@evledraar.gmail.com","threadId":"57101","inReplyTo":"CAPig+cQt47U9E8kUFiTBecEPcTaLhRCi5X_T=nPqZM-HJR=n0g@mail.gmail.com","subject":"Re: [PATCH 8/8] Makefiles: add and use wildcard \"mkdir -p\" template","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-12-24T17:41:30Z","receivedAt":"2021-12-24T17:42:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Dec 17 2021, Eric Sunshine wrote:\n\n> On Thu, Dec 16, 2021 at 11:40 PM Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> [...]\n>> But as it turns out we can use this neat trick of only doing a \"mkdir\n>> -p\" if the $(wildcard) macro tells us the path doesn't exist. A re-run\n>> of a performance test similar to thatnoted downthread of [1] in [2]\n>> shows that this is faster, in addition to being less verbose and more\n>> reliable (this uses my \"git-hyperfine\" thin wrapper for \"hyperfine\"[3]):\n>\n> s/thatnoted/that noted/\n>\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> ---\n>> diff --git a/shared.mak b/shared.mak\n>> @@ -90,3 +92,18 @@ ifndef V\n>> +## Is racy, but in a good way; we might redundantly (and safely)\n>> +## \"mkdir -p\" when running in parallel, but won't need to exhaustively\n>> +## individual rules for \"a\" -> \"prefix\" -> \"dir\" -> \"file\" if given a\n>> +## \"a/prefix/dir/file\". This can instead be inserted at the start of\n>> +## the \"a/prefix/dir/file\" rule.\n>\n> Is there a word missing between \"exhaustively\" and \"individual\"?\n\nThanks. I addressed both of these in the v2, for which I accidentally\nbroke the threading by omitting In-Reply-To (sorry!):\nhttps://lore.kernel.org/git/cover-v2-0.8-00000000000-20211224T173558Z-avarab@gmail.com/\n"}]}