#1732·colibri

make: `.build-config` is never written under GNU Make 3.81, so every colibri build relinks

Author: bokikoCreated Sep 24, 2026Updated Sep 24, 2026

c/Makefile records its configuration in .build-config with make's own file primitive:

make
BUILD_CONFIG     := $(CC)|$(CFLAGS)|$(LDFLAGS)|CUDA=$(CUDA)|...|CUDA_ARCH=$(CUDA_ARCH)|...
BUILD_CONFIG_OLD := $(shell cat .build-config 2>/dev/null)
ifneq "$(BUILD_CONFIG)" "$(BUILD_CONFIG_OLD)"
$(file >.build-config,$(BUILD_CONFIG))
endif
.build-config: ;

$(file ...) needs GNU Make 4.0. On arm64 macOS /usr/bin/make reports GNU Make 3.81, and there the function does not write: I checked with a two-line makefile and the file never appears.

The consequence is visible on a normal build. Four consecutive make colibri runs at 30c70ad, same tree, same flags, on macOS 26.6.2 / arm64:

run output
1 clang -O3 … colibri.c -o colibri -lm -L/opt/homebrew/opt/libomp/lib -lomp
2 same
3 same
4 same

and c/.build-config does not exist afterwards (ls: .build-config: No such file or directory).

So the binary is relinked on every invocation and the config stamp never carries information. Because a missing stamp errs the safe way — the objects are rebuilt whenever it is absent — this is not a wrong build, only a permanently wasted one, which is why it is easy to miss.

Two ways out, whichever you prefer:

  • write the stamp from a shell recipe guarded on the content actually changing (the scheme the #1707/#1702 work uses for deepseek_v4.cflags), which needs no make version. Note this file is not the standalone one: c/Makefile also builds on Windows from cmd.exe (VS Native Tools, scoop MinGW), where there is no POSIX shell — that is precisely why #478 moved this stamp to $(file ...) in the first place. A recipe route therefore needs an OS guard, or Windows kept on the current path; or
  • fail loudly at parse time on make < 4.0 rather than silently doing nothing, if 4.0 is the intent.

Verified only on arm64 macOS with Apple's /usr/bin/make 3.81; I have not checked other platforms whose make predates 4.0. Happy to test a fix on this host if useful.