# # SPDX-License-Identifier: BlueOak-1.0.0 # # Copyright (c) Berkus Decker # [tasks.build] env = { "TARGET_FEATURES" = "" } args = ["build", "${BUILD_STD}", "--target=${TARGET_JSON}", "--release", "--features=${TARGET_FEATURES}"] [tasks.test] env = { "TARGET_FEATURES" = "${QEMU_FEATURES}" } args = ["test", "${BUILD_STD}", "--target=${TARGET_JSON}", "--features=${TARGET_FEATURES}"] # These tasks are written in cargo-make's own script to make it portable across platforms (no `basename` on Windows) [tasks.kernel-binary] script_runner = "@duckscript" script = [ ''' cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${DEFAULT_TARGET}/release/vesper ${KERNEL_ELF} exec --fail-on-error ${OBJCOPY} %{OBJCOPY_PARAMS} ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${DEFAULT_TARGET}/release/vesper ${KERNEL_BIN} ''' ] [tasks.custom-binary] script_runner = "@duckscript" script = [ ''' binaryFile = basename ${CARGO_MAKE_TASK_ARGS} cp ${CARGO_MAKE_TASK_ARGS} ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${binaryFile}.elf exec --fail-on-error ${OBJCOPY} %{OBJCOPY_PARAMS} ${CARGO_MAKE_TASK_ARGS} ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${binaryFile}.bin ''' ] [tasks.test-runner] dependencies = ["custom-binary"] script_runner = "@duckscript" script = [ ''' binaryFile = basename ${CARGO_MAKE_TASK_ARGS} exec --fail-on-error ${QEMU} %{QEMU_OPTS} %{QEMU_TESTS_OPTS} -dtb ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/targets/bcm2710-rpi-3-b-plus.dtb -kernel ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${binaryFile}.bin ''' ] [tasks.build-qemu] env = { "TARGET_FEATURES" = "${QEMU_FEATURES}" } command = "cargo" args = ["build", "${BUILD_STD}", "--target=${TARGET_JSON}", "--release", "--features=${TARGET_FEATURES}"] [tasks.qemu] dependencies = ["build-qemu", "kernel-binary"] env = { "TARGET_FEATURES" = "${QEMU_FEATURES}" } script_runner = "@duckscript" script = [ ''' binaryFile = basename ${CARGO_MAKE_TASK_ARGS} exec --fail-on-error ${QEMU} %{QEMU_OPTS} %{QEMU_SERIAL} -dtb ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/targets/bcm2710-rpi-3-b-plus.dtb -kernel ${KERNEL_BIN} ''' ] [tasks.sdcard] dependencies = ["build", "kernel-binary"] command = "cp" args = ["${KERNEL_BIN}", "/Volumes/BOOT/"] [tasks.sdeject] dependencies = ["sdcard"] command = "diskutil" args = ["unmount", "/Volumes/BOOT/"] [tasks.clippy] command = "cargo" args = ["clippy", "${BUILD_STD}", "--target=${TARGET_JSON}", "--", "-D", "warnings"] [tasks.hopper] dependencies = ["build", "kernel-binary"] # The cmd line below causes a bug in hopper, see https://www.dropbox.com/s/zyw5mfx0bepcjb1/hopperv4-RAW-bug.mov?dl=0 #"hopperv4 --loader RAW --base-address 0x80000 --entrypoint 0x80000 --file-offset 0 --plugin arm --cpu aarch64 --variant generic --contains-code true --executable ${KERNEL_BIN}" script = [ "hopperv4 --loader ELF --executable ${KERNEL_ELF}" ]