mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-29 01:24:51 +02:00
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) <[email protected]>