GNUmakefile: split into topic files in make/

The GNUmakefile had 1295 lines and mixed build configuration, LLVM
bootstrapping, device generation, four test suites, the smoke tests,
release packaging, and lint tools. The smoke tests alone were 500 lines.

Move each part into its own file in make/ and include them from
GNUmakefile. config.mk must be included first because the other files
use its variables in immediate assignments and conditionals.

There is no change in behavior. The parsed make database is identical
for the default build and for ASSERT=1, STATIC=1, XTENSA=0, STM32=0,
WASM=0, and CROSS=aarch64-linux-gnu, except for MAKEFILE_LIST and the
.PHONY list, which now also includes targets that were phony but not
declared.

The Dockerfile copies GNUmakefile alone before it builds LLVM, to keep
that layer independent of the source tree. It must copy make/ too.
This commit is contained in:
deadprogram
2026-08-27 21:29:27 +02:00
parent ac98a3df85
commit 4d2dc1e3f7
11 changed files with 1326 additions and 1294 deletions
+5 -2
View File
@@ -30,7 +30,10 @@ on a different system like Mac.
## Using GNU Make
The static build of TinyGo is driven by GNUmakefile, which provides a help target for quick reference:
The static build of TinyGo is driven by GNUmakefile, which includes the topic
files in the `make/` directory (`config.mk`, `llvm.mk`, `gen-device.mk`,
`build.mk`, `test.mk`, `smoketest.mk`, `release.mk`, and `tools.mk`).
It provides a help target for quick reference:
% make help
clean Remove build directory
@@ -64,7 +67,7 @@ while producing binaries that are about as fast.
export CC=clang
export CXX=clang++
The Makefile includes a default configuration that is good for most users. It
`make/config.mk` holds a default configuration that is good for most users. It
builds a release version of LLVM (optimized, no asserts) and includes all
targets supported by TinyGo: