Move run task to Rsconscript

This commit is contained in:
Josh Holtrop 2022-03-09 16:43:23 -05:00
parent fdc5584110
commit bb24fb937a
2 changed files with 5 additions and 8 deletions

View File

@ -1,7 +0,0 @@
.PHONY: all
all:
@./rscons
.PHONY: run
run: all
qemu-system-x86_64 -bios OVMF.fd -hdb build/e.1/efi-loader.img

View File

@ -18,7 +18,7 @@ class Image < Builder
end
end
env do |env|
uefi_env = env "uefi" do |env|
env.add_builder(Image)
env["CC"] = "x86_64-w64-mingw32-gcc"
env["CPPPATH"] += %w[/usr/include/efi /usr/include/efi/x86_64]
@ -29,3 +29,7 @@ env do |env|
env.Program("^/BOOTX64.EFI", "${sources}")
env.Image("^/efi-loader.img", "^/BOOTX64.EFI")
end
task "run" do
sh %W[qemu-system-x86_64 -bios OVMF.fd -hda #{uefi_env.expand("^/efi-loader.img")}]
end