mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[build] Improve copying of dubug files and assets
Bonnibel used to copy any asset into the root - now a path can be specified for assets, and debug output goes into .debug so GDB will pick it up automatically.
This commit is contained in:
@@ -44,6 +44,9 @@ class Project:
|
|||||||
build.subninja(output / target.name / "target.ninja")
|
build.subninja(output / target.name / "target.ninja")
|
||||||
build.newline()
|
build.newline()
|
||||||
|
|
||||||
|
debugroot = output / ".debug"
|
||||||
|
debugroot.mkdir(exist_ok=True)
|
||||||
|
|
||||||
fatroot = output / "fatroot"
|
fatroot = output / "fatroot"
|
||||||
fatroot.mkdir(exist_ok=True)
|
fatroot.mkdir(exist_ok=True)
|
||||||
|
|
||||||
@@ -53,15 +56,25 @@ class Project:
|
|||||||
raise BonnibelError(f"Manifest item '{name}' is not a known module")
|
raise BonnibelError(f"Manifest item '{name}' is not a known module")
|
||||||
|
|
||||||
mod = modules[name]
|
mod = modules[name]
|
||||||
|
intermediary = f"${{build_root}}/{mod.output}"
|
||||||
fatroot_output = f"${{build_root}}/fatroot/{mod.output}"
|
fatroot_output = f"${{build_root}}/fatroot/{mod.output}"
|
||||||
|
|
||||||
build.build(
|
build.build(
|
||||||
rule = "strip",
|
rule = "strip",
|
||||||
outputs = [fatroot_output],
|
outputs = [intermediary],
|
||||||
inputs = [f"${{build_root}}/{target}/{mod.output}"],
|
inputs = [f"${{build_root}}/{target}/{mod.output}"],
|
||||||
|
implicit = [f"${{build_root}}/{target}/{mod.output}.dump"],
|
||||||
|
variables = {
|
||||||
|
"name": f"Stripping {name}",
|
||||||
|
"debug": f"${{build_root}}/.debug/{mod.output}.debug",
|
||||||
|
})
|
||||||
|
|
||||||
|
build.build(
|
||||||
|
rule = "cp",
|
||||||
|
outputs = [fatroot_output],
|
||||||
|
inputs = [intermediary],
|
||||||
variables = {
|
variables = {
|
||||||
"name": f"Installing {name}",
|
"name": f"Installing {name}",
|
||||||
"debug": f"${{build_root}}/{mod.output}.debug",
|
|
||||||
})
|
})
|
||||||
|
|
||||||
fatroot_content.append(fatroot_output)
|
fatroot_content.append(fatroot_output)
|
||||||
@@ -110,13 +123,13 @@ class Project:
|
|||||||
build.newline()
|
build.newline()
|
||||||
|
|
||||||
default_assets = {
|
default_assets = {
|
||||||
"ovmf/x64/ovmf_vars.fd": "UEFI Variables",
|
"UEFI Variables": ("ovmf/x64/ovmf_vars.fd", "ovmf_vars.fd"),
|
||||||
"debugging/jsix.elf-gdb.py": "GDB Debug Helpers",
|
"GDB Debug Helpers": ("debugging/jsix.elf-gdb.py", "jsix.elf-gdb.py"),
|
||||||
}
|
}
|
||||||
|
|
||||||
for asset, name in default_assets.items():
|
for name, assets in default_assets.items():
|
||||||
p = root / "assets" / asset
|
p = root / "assets" / assets[0]
|
||||||
out = f"${{build_root}}/{p.name}"
|
out = f"${{build_root}}/{assets[1]}"
|
||||||
build.build(
|
build.build(
|
||||||
rule = "cp",
|
rule = "cp",
|
||||||
outputs = [out],
|
outputs = [out],
|
||||||
|
|||||||
Reference in New Issue
Block a user