MAGIC_VERSION/REVISION/COMMIT/BUILDDATE used `?=` with `$(shell ...)`, which makes them recursively-expanded. Because they are exported, make re-evaluated (re-spawned git/date/cat) every time it built a child's environment -- so a no-op recursive `make` spawned git and date ~624 times each. Guard each with `ifndef` and assign with `:=` (simply-expanded) so the value is computed once at the top and exported as a plain string; sub-makes inherit it and the ifndef skips recomputation. This was the last "fold in" item from the buildinfo/ccache plan. Verified: a no-op `make` now spawns git and date once each (was 624); a full clean build spawns 1 git / 2 date / 10 cat; the commit is still embedded correctly and builds are reproducible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| config.guess | ||
| config.sub | ||
| configure | ||
| configure.in | ||
| configure_mac | ||
| defs.mak.in | ||
| install-sh | ||
| magic.spec.in | ||
| makedbh.in | ||
| missing | ||
| mkdirs | ||
| mkinstalldirs | ||
| preproc.py | ||
| printmans | ||