Files
wash 1ec33767ab meta: replace cmake mono-build system with a custom build co-ordinator
every system component now has its own self-contained build system, and a
seed file describing the component and its build system and dependencies.

a new tool, meadow, collects and uses these seed files to build the
components into a full system. meadow also manages the target system root
and a host prefix where toolchain tools are installed to.

the build system has also been updated to use a new $ARCH-rosetta-gcc
compiler, and the patches files necessary to build it have been
added to toolchain/cross-compiler.
2026-07-19 13:34:32 +01:00

47 lines
1.1 KiB
Python

import sys
import os
import tomli
from colorama import init as colorama_init
from colorama import Fore, Style
from args import Args
from preset import Preset
from bsp import BSP
def main():
colorama_init()
args = Args(sys.argv)
preset_path = args.get_named('preset', 0, 1)
if preset_path is None:
print(f'{Fore.RED}Err:{Style.RESET_ALL} no preset specified')
return -1
out_path = args.get_named('out', 0, 1)
if out_path is None:
print(f'{Fore.RED}Err:{Style.RESET_ALL} no output path specified')
return -1
sysroot_path = args.get_named('sysroot', 0, 1)
if sysroot_path is None:
sysroot_path = '/'
preset = Preset(preset_path)
bsp = BSP(out_path, sysroot=sysroot_path)
for dst, src in preset.contents().items():
for src_filepath in src:
src_filename = os.path.basename(src_filepath)
dst_filepath = os.path.join(dst, src_filename)
bsp.add_file(src_filepath, dst_filepath)
bsp.set_bootstrap_program(preset.bootstrap_program())
bsp.close()
return 0
if __name__ == '__main__':
exit(main())