# # 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/${TARGET}/release/vesper ${KERNEL_ELF} exec --fail-on-error ${OBJCOPY} %{OBJCOPY_PARAMS} ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${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.openocd] dependencies = ["build", "kernel-binary"] script = [ "${OPENOCD} -f interface/jlink.cfg -f ../doc/rpi2rpi_jtag/rpi3_target.cfg" ] [tasks.gdb-config] script_runner = "@duckscript" script = [ ''' writefile ${GDB_CONNECT_FILE} "target remote :5555\n" ''' ] [tasks.gdb] dependencies = ["build", "kernel-binary", "gdb-config"] env = { "RUST_GDB" = "${GDB}" } script = [ "rust-gdb -x ${GDB_CONNECT_FILE} ${KERNEL_ELF}" ] [tasks.nm] dependencies = ["build", "kernel-binary"] script = [ "${NM} -- ${KERNEL_ELF} | sort" ] #install_crate = "cargo-binutils" [tasks.sdcard] dependencies = ["build", "kernel-binary"] script_runner = "@duckscript" script = [ ''' kernelImage = basename ${KERNEL_BIN} cp ${KERNEL_BIN} ${VOLUME}/${kernelImage} ''' ] [tasks.sdeject] dependencies = ["sdcard"] script = [ "diskutil unmount ${VOLUME}" ] [tasks.clippy] env = { "TARGET_FEATURES" = { value = "--features=${CLIPPY_FEATURES}", condition = { env_set = ["CLIPPY_FEATURES"] } } } command = "cargo" args = ["clippy", "${BUILD_STD}", "--target=${TARGET_JSON}", "@@remove-empty(TARGET_FEATURES)", "--", "-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}" ]