From 016d745b94b31d0ef4fd54d2a04dc9e09b3f0d20 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 22 Oct 2026 14:17:56 +0900 Subject: internal/rosa: bootstrap make in two steps This enables the test suite in the second make stage. This change also fixes a typo in the second stage make build script. Signed-off-by: Ophestra --- internal/rosa/make.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'internal/rosa/make.go') diff --git a/internal/rosa/make.go b/internal/rosa/make.go index f46780f5..bf0f3cea 100644 --- a/internal/rosa/make.go +++ b/internal/rosa/make.go @@ -5,7 +5,10 @@ import ( "strings" ) -var _make = H("make") +var ( + _make = H("make") + _makeEarly = H("make-early") +) // MakeHelper wraps the make program and its surrounding build system. type MakeHelper struct { @@ -37,6 +40,8 @@ type MakeHelper struct { // Target triple, zero value is equivalent to the Rosa OS triple. Build string + // Use the dependency-free [GenericHelper] make. + Early bool // Extra make targets. Make []string // Whether to skip the check target. @@ -53,15 +58,20 @@ var _ Helper = new(MakeHelper) // tools returns make and other optional dependencies. func (attr *MakeHelper) tools() P { + h := _make + if attr != nil && attr.Early { + h = _makeEarly + } + if attr == nil || !attr.OmitDefaults { return P{ - _make, + h, _awk, _coreutils, } } - return P{_make} + return P{h} } // inputs is a noop. @@ -107,8 +117,8 @@ func (attr *MakeHelper) script(t Toolchain, name string) string { target := t.triple() if cross { configure += ` -export CC='clang --target=` + target + ` --sysroot=/system/` + t.arch + `' -export CXX='clang++ --target=` + target + ` --sysroot=/system/` + t.arch + `' +export CC='clang --target=` + target + ` -isysroot=/system/` + t.arch + `' +export CXX='clang++ --target=` + target + ` -isysroot=/system/` + t.arch + `' ` } -- cgit v1.3.1