[Toybox] [RFC] Compiling Linux without GNU Make via samurai (thornk)
Rob Landley
rob at landley.net
Wed Oct 7 19:57:18 UTC 2026
On 10/7/26 00:05, abit_foggy wrote:
> Hi all,
>
> Made a small C99 tool called thornk to lower the Linux kernel Kbuild
> tree into flat Ninja files for samurai (samu).
Last I checked ninja was a more heavyweight dependency than gmake. (Also
less well documented, less widely adopted, and not part of posix. Once
upon a time "make" gave you full coverage of Linux From Scratch, ninja
still didn't when the LFS project concluded last year.)
I have a gmake compatible make for toybox in the roadmap. I have zero
plans to implement ninja or meson or any of the others.
Toybox itself can build on a system without make:
scripts/genconfig.sh -d
scripts/make.sh
And even compile its own prerequisites using canned headers on a system
with just a posix-ish shell. On mac without homebrew, the invocation is:
scripts/prereq/use.sh scripts/macos_miniconfig
> To bypass make defconfig and prepare, it parses $CC -S assembly directly
> to generate bounds.h, asm-offsets.h, and autoconf.h natively without
> host Make or sed scripts.
Linux used to do that 20 years ago (back when I was maintaineg my own
https://landley.net/code/tinycc fork and needed to implement nm and
objdump support to generate headers, probably somewhere around
https://landley.net/notes-2007.html#28-12-2007 ).
They changed it because it was really brittle, I forget the details. But
doing it that was wasn't something that didn't occur to them.
> Tested on Linux 6.12 x86_64 with Clang, LLD, and samu, and boots in QEMU:
> https://github.com/abit-foggy/thornk
I'm current looking at alpinebsd.org.
They seem unlikely to adopt ninja.
> Curious if this is useful for minimal bootstrapping or if anyone has
> thoughts on the approach.
I'm not interested, but somebody else might be.
If you want to convert the kernel build into a shell script, that would
be interesting. But ninja? No thanks.
Rob
More information about the Toybox
mailing list