diff --git a/Rsconscript b/Rsconscript index 053e118..010ae00 100644 --- a/Rsconscript +++ b/Rsconscript @@ -17,6 +17,26 @@ end # Kernel default font size. KFONT_SIZE = 15 +class HulkBinObj < Builder + def run(options) + File.write(@target, <#{@target}", nil) + @cache.register_build(@target, nil, @sources, @env) + end + true + end +end + class Image < Builder def run(options) unless @cache.up_to_date?(@target, nil, @sources, @env) @@ -68,8 +88,11 @@ end hello_env = env "hello", use: %w[ldc2 x86_64-w64-mingw32-gcc] do |env| env.add_builder(Image) + env.add_builder(HulkBinObj) env["sources"] = glob("src/hello/**/*.d") env["sources"] += glob("uefi-d/source/**/*.d") + env.HulkBinObj("^/hulk_bin.S", hulk_env.expand("^/hulk.bin")) + env["sources"] << "^/hulk_bin.S" env["DFLAGS"] += %w[-mtriple=x86_64-unknown-windows-coff --betterC -release -O3 --wi --enable-cross-module-inlining] env["D_IMPORT_PATH"] += %w[src/hello src/hulk uefi-d/source src/common] env["LD"] = "x86_64-w64-mingw32-gcc"