From b26d61cb67359497e4fe13338f0655492291a684 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Tue, 21 Dec 2021 02:17:08 +0200 Subject: [PATCH] =?UTF-8?q?build:=20=F0=9F=9B=A0=20Improve=20Justfile=20he?= =?UTF-8?q?lp=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enter `just` to see a list of available commands with explanations. Added `just ci` step. Added `just fmt-check`. Removed unnecessary kernel file removals. Moved sdeject task and added `just device-eject`. --- Justfile | 48 +++++++++++++++++++++++++++++-------------- Makefile.toml | 6 ++++++ README.md | 8 ++++++++ nucleus/Makefile.toml | 6 ------ 4 files changed, 47 insertions(+), 21 deletions(-) diff --git a/Justfile b/Justfile index ebe0823..a96ea0e 100644 --- a/Justfile +++ b/Justfile @@ -1,62 +1,80 @@ +_default: + @just --list + +# Build and run kernel in QEMU with serial port emulation zellij: - # Build and run kernel in QEMU with serial port emulation cargo make zellij-config zellij --layout-path emulation/layout.zellij +# Build and run kernel in QEMU qemu: - # Build and run kernel in QEMU cargo make qemu +# Build and run kernel in QEMU with GDB port enabled qemu-gdb: - # Build and run kernel in QEMU with GDB port enabled cargo make qemu-gdb +# Build and write kernel to an SD Card device: - # Build and write kernel to an SD Card cargo make sdcard +# Build and write kernel to an SD Card, then eject the SD Card volume +device-eject: + cargo make sdeject + +# Build default hw kernel build: - # Build default hw kernel cargo make build +# Clean project clean: - # Clean project cargo make clean - rm -f kernel8 kernel8.img +# Run clippy checks clippy: - # Run clippy checks + # TODO: use cargo-hack cargo make clippy + env CLIPPY_FEATURES=noserial cargo make clippy + env CLIPPY_FEATURES=qemu cargo make clippy + env CLIPPY_FEATURES=noserial,qemu cargo make clippy + env CLIPPY_FEATURES=jtag cargo make clippy + env CLIPPY_FEATURES=noserial,jtag cargo make clippy +# Run tests in QEMU test: - # Run tests in QEMU cargo make test alias disasm := hopper +# Build and disassemble kernel hopper: - # Build and disassemble kernel cargo make hopper alias ocd := openocd +# Start openocd (by default connected via JTAG to a target device) openocd: - # Start openocd (by default connected via JTAG to a target device) cargo make openocd +# Build and run kernel in GDB using openocd or QEMU as target (gdb port 5555) gdb: - # Build and run kernel in GDB using openocd or QEMU as target (gdb port 5555) cargo make gdb +# Build and print all symbols in the kernel nm: - # Build and print all symbols in the kernel cargo make nm +# Check formatting +fmt-check: + cargo fmt -- --check + +# Run `cargo expand` on nucleus expand: - # Run `cargo expand` on modules cargo make expand -- nucleus +# Generate and open documentation doc: - # Generate and open documentation cargo make docs-flow +# Run CI tasks +ci: clean build test clippy fmt-check diff --git a/Makefile.toml b/Makefile.toml index 510bad8..520b8b0 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -77,3 +77,9 @@ dependencies = ["kernel-binary"] [tasks.modules] command = "cargo" args = ["modules", "tree"] + +[tasks.sdeject] +dependencies = ["sdcard"] +script = [ + "diskutil unmount ${VOLUME}" +] diff --git a/README.md b/README.md index 1086262..e1ceef0 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,14 @@ You need to have [Hopper](https://hopperapp.com) and hopperv4 cli helper install just disasm ``` +### To see other available commands + +``` +just +``` + +It will list all just commands with their short descriptions. + ## Development flow `mainline`, `develop` and `released` branches: diff --git a/nucleus/Makefile.toml b/nucleus/Makefile.toml index 8bf10e2..9b7a90b 100644 --- a/nucleus/Makefile.toml +++ b/nucleus/Makefile.toml @@ -122,12 +122,6 @@ script = [ ''' ] -[tasks.sdeject] -dependencies = ["sdcard"] -script = [ - "diskutil unmount ${VOLUME}" -] - [tasks.clippy] env = { "TARGET_FEATURES" = { value = "--features=${CLIPPY_FEATURES}", condition = { env_set = ["CLIPPY_FEATURES"] } } } command = "cargo"