[build] Refactor build options definitions

Split out build definition YAML files to allow different options based
on config, target, kind of module, and target/kind combination.
This commit is contained in:
Justin C. Miller
2023-07-30 23:44:04 -06:00
parent 778e766f6b
commit 21916ab869
14 changed files with 261 additions and 234 deletions

View File

@@ -88,6 +88,8 @@ class Module:
if self.kind == "lib":
return f"lib{self.name}.a"
elif self.kind == "driver":
return f"{self.name}.drv"
else:
return f"{self.name}.elf"
@@ -157,6 +159,11 @@ class Module:
build.newline()
build.variable("module_dir", target_rel(self.name + ".dir"))
build.variable("module_kind", self.kind)
build.newline()
build.include(f"${{target_dir}}/config.{self.kind}.ninja")
build.newline()
modopts = BuildOptions(
local = [self.root, "${module_dir}"],