As noted in v2[1] this series fixes various dependency issues in the Makfile. New in v3 is a fix for the dependency issue Mike Hommey reported[2] with hook-list.h, and 3x new and big optimizations that I'd planned to submit later on-top, but I figured would be better to consider as part of these general dependency improvements. With those new changes on top we run ~1.4x faster on no-op runs (under NO_TCLTK=Y, since that would otherwise eat most of our runtime either way): $ git hyperfine -L rev origin/next,HEAD~0 -s 'make -j8 all NO_TCLTK=Y' 'make NO_TCLTK=Y' --warmup 10 -r 10 Benchmark 1: make NO_TCLTK=Y' in 'origin/next Time (mean ± σ): 187.4 ms ± 2.4 ms [User: 146.5 ms, System: 57.1 ms] Range (min … max): 184.7 ms … 192.8 ms 10 runs Benchmark 2: make NO_TCLTK=Y' in 'HEAD~0 Time (mean ± σ): 136.1 ms ± 0.9 ms [User: 103.0 ms, System: 47.6 ms] Range (min … max): 135.4 ms … 138.2 ms 10 runs Summary 'make NO_TCLTK=Y' in 'HEAD~0' ran 1.38 ± 0.02 times faster than 'make NO_TCLTK=Y' in 'origin/next' Which, as noted before is working nicely towards making executing "make" in a loop faster, such as under "git rebase --exec". Those optimizations are a mixture of clever and "dumb but works". E.g. around 10% of the runtime was spent by the Makefile looking for git's sources in the RCS and SCCS source control management systems, before giving up and considering the relevant file on disk. 1. https://lore.kernel.org/git/cover-v2-00.18-00000000000-20211112T214150Z-avarab@xxxxxxxxx 2. https://lore.kernel.org/git/20211115230032.3or3qqlsdnxjtrol@xxxxxxxxxxxx/ Ævar Arnfjörð Bjarmason (23): Makefile: don't invoke msgfmt with --statistics Makefile: don't set up "perl/build" rules under NO_PERL=Y Makefile: use "=" not ":=" for po/* and perl/* Makefile: clean perl/build/ even with NO_PERL=Y Makefile: remove "mv $@ $@+" dance redundant to .DELETE_ON_ERROR Makefile: guard Perl-only variable assignments Makefile: change "ifndef NO_PERL" to "ifdef NO_PERL" Makefile: adjust Perl-related comments & whitespace Makefile: correct "GIT-PERL-{DEFINES,HEADER}" dependency graph Makefile: create a GIT-PYTHON-DEFINES, like "PERL" Makefile: stop needing @@GIT_VERSION@@ in *.perl scripts Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it Makefile: move $(comma), $(empty) and $(space) to shared.mak Makefile: re-add and use the "shellquote" macros Makefile: add a "TRACK_template" for GIT-*{FLAGS,DEFINES,...} Makefile: add "$(QUIET)" boilerplate to shared.mak Makefile: use $(wspfx) for $(QUIET...) in shared.mak Makefiles: add and use wildcard "mkdir -p" template Makefile: correct the dependency graph of hook-list.h Makefile: use $(file) I/O instead of "FORCE" when possible Makefile: disable GNU make built-in wildcard rules Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES) Makefile: move ".SUFFIXES" rule to shared.mak .gitignore | 2 +- Documentation/Makefile | 71 +--------- Makefile | 313 +++++++++++++++-------------------------- config.mak.uname | 1 - git-cvsserver.perl | 6 +- git-send-email.perl | 7 +- git-svn.perl | 2 +- shared.mak | 187 ++++++++++++++++++++++++ t/Makefile | 34 ++--- templates/Makefile | 19 +-- 10 files changed, 337 insertions(+), 305 deletions(-) create mode 100644 shared.mak Range-diff against v2: 1: 75ebf7b04e5 = 1: 1621ca72c1d Makefile: don't invoke msgfmt with --statistics 2: 138f60ba37b = 2: b7c36c9fea0 Makefile: don't set up "perl/build" rules under NO_PERL=Y 3: 472e1eb74bd = 3: 510499d18ba Makefile: use "=" not ":=" for po/* and perl/* 4: a5ce2dce164 = 4: 37f3591bcca Makefile: clean perl/build/ even with NO_PERL=Y 5: 04dbc1d2809 = 5: e38c90ad0b6 Makefile: remove "mv $@ $@+" dance redundant to .DELETE_ON_ERROR 6: eea89794493 = 6: 98e14c7eba9 Makefile: guard Perl-only variable assignments 7: e06732d4639 = 7: 047a42b01cf Makefile: change "ifndef NO_PERL" to "ifdef NO_PERL" 8: a9502a23989 = 8: 0c0a3de390e Makefile: adjust Perl-related comments & whitespace 9: c1336fc0a56 = 9: 1ece3160915 Makefile: correct "GIT-PERL-{DEFINES,HEADER}" dependency graph 10: 41f65a12205 = 10: e9b61cd0ba5 Makefile: create a GIT-PYTHON-DEFINES, like "PERL" 11: bfa15059d60 = 11: b020f8e3257 Makefile: stop needing @@GIT_VERSION@@ in *.perl scripts 12: 656d02ab641 = 12: 19539ce7d2d Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it 13: 6e25ac71cbc = 13: 6c9291c2c9f Makefile: move $(comma), $(empty) and $(space) to shared.mak 14: 64296e6e8e5 = 14: e811a907b08 Makefile: re-add and use the "shellquote" macros 15: 5654d7f7f29 = 15: fac30fe8b56 Makefile: add a "TRACK_template" for GIT-*{FLAGS,DEFINES,...} 16: 0a348b54491 = 16: a3e3acea82d Makefile: add "$(QUIET)" boilerplate to shared.mak 17: 34f692144d1 = 17: 22264f431c8 Makefile: use $(wspfx) for $(QUIET...) in shared.mak 18: 5b3986bc4a8 = 18: d61e2b44f68 Makefiles: add and use wildcard "mkdir -p" template -: ----------- > 19: 234b4eb613c Makefile: correct the dependency graph of hook-list.h -: ----------- > 20: 567ad5c3ebc Makefile: use $(file) I/O instead of "FORCE" when possible -: ----------- > 21: cb3ae5ce00b Makefile: disable GNU make built-in wildcard rules -: ----------- > 22: 88cfc946b37 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES) -: ----------- > 23: 276e226f0a8 Makefile: move ".SUFFIXES" rule to shared.mak -- 2.34.0.795.g1e9501ab396