diff --git a/examples/simple/build.zig b/examples/simple/build.zig index dae93759..b447a519 100644 --- a/examples/simple/build.zig +++ b/examples/simple/build.zig @@ -137,10 +137,10 @@ pub fn build(b: *std.Build) void { // For actually compiling the DTS into a DTB const dts_path = fmtPrint("board/{s}/linux.dts", .{ microkit_board }); + const dtb_image_path = "linux.dtb"; const dtc_command = b.addSystemCommand(&[_][]const u8{ - "dtc", "-I", "dts", "-O", "dtb", dts_path, "-o" + "dtc", "-I", "dts", "-O", "dtb", dts_path, "-o", dtb_image_path }); - const dtb_image_path = dtc_command.addOutputFileArg("linux.dtb"); // Add microkit.h to be used by the API wrapper. exe.addIncludePath(.{ .path = sdk_board_include_dir }); @@ -167,14 +167,15 @@ pub fn build(b: *std.Build) void { .target = target, .optimize = optimize, }); - dtb_image_path.addStepDependencies(&guest_images.step); + // We need to produce the DTB from the DTS before doing anything to produce guest_images + guest_images.step.dependOn(&dtc_command.step); const linux_image_path = fmtPrint("board/{s}/linux", .{ microkit_board }); const kernel_image_arg = fmtPrint("-DGUEST_KERNEL_IMAGE_PATH=\"{s}\"", .{ linux_image_path }); const initrd_image_path = fmtPrint("board/{s}/rootfs.cpio.gz", .{ microkit_board }); const initrd_image_arg = fmtPrint("-DGUEST_INITRD_IMAGE_PATH=\"{s}\"", .{ initrd_image_path }); - const dtb_image_arg = fmtPrint("-DGUEST_DTB_IMAGE_PATH=\"{s}\"", .{ dtb_image_path.getPath(b) }); + const dtb_image_arg = fmtPrint("-DGUEST_DTB_IMAGE_PATH=\"{s}\"", .{ dtb_image_path }); guest_images.addCSourceFiles(&.{ libvmm_tools ++ "package_guest_images.S" }, &.{ kernel_image_arg, dtb_image_arg,