df887d5665
ci / Check formatting (push) Has been cancelled
ci / Check Documentation Build (push) Has been cancelled
ci / Clippy (push) Has been cancelled
ci / Check formatting (pull_request) Has been cancelled
ci / Check Documentation Build (pull_request) Has been cancelled
ci / Clippy (pull_request) Has been cancelled
ci / Check build (push) Has been cancelled
ci / Check build (pull_request) Has been cancelled
75 lines
2.7 KiB
Makefile
75 lines
2.7 KiB
Makefile
# Common paths (single source of truth)
|
|
INIT_SCRIPT := justfile_directory() / "scripts/zynq7000-init.py"
|
|
GDB_CMD := justfile_directory() / "firmware/gdb.gdb"
|
|
|
|
all: check build check-fmt clippy docs-zynq
|
|
check: (check-dir "firmware") (check-dir "host")
|
|
clean: (clean-dir "firmware") (clean-dir "host")
|
|
build: build-zynq (build-dir "host")
|
|
fmt: (fmt-dir "firmware") (fmt-dir "host")
|
|
check-fmt: (check-fmt-dir "firmware") (check-fmt-dir "host")
|
|
clippy: (clippy-dir "firmware") (clippy-dir "host")
|
|
|
|
check-dir target:
|
|
cd {{target}} && cargo check
|
|
|
|
build-dir target:
|
|
cd {{target}} && cargo build
|
|
|
|
[working-directory: 'firmware']
|
|
build-zynq: (build-dir "firmware")
|
|
cd "zynq7000" && cargo build --all-features
|
|
cd "zedboard-fsbl" && cargo build --release
|
|
|
|
clean-dir target:
|
|
cd {{target}} && cargo clean
|
|
|
|
check-fmt-dir target:
|
|
cd {{target}} && cargo +stable fmt --all -- --check
|
|
|
|
fmt-dir target:
|
|
cd {{target}} && cargo +stable fmt
|
|
|
|
clippy-dir target:
|
|
cd {{target}} && cargo clippy -- -D warnings
|
|
|
|
[working-directory: 'firmware']
|
|
docs-zynq: docs-pac docs-hal
|
|
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p zynq7000-mmu
|
|
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p zynq7000-rt
|
|
[working-directory: 'firmware']
|
|
docs-pac:
|
|
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p zynq7000
|
|
[working-directory: 'firmware']
|
|
docs-pac-html:
|
|
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p zynq7000 --open
|
|
[working-directory: 'firmware']
|
|
docs-hal:
|
|
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p zynq7000-hal --features alloc --no-deps
|
|
[working-directory: 'firmware']
|
|
docs-hal-html:
|
|
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p zynq7000-hal --features alloc --open
|
|
|
|
[working-directory: 'firmware/zynq-boot-image/staging']
|
|
bootgen:
|
|
bootgen -arch zynq -image boot.bif -o boot.bin -w on
|
|
echo "Generated boot.bin at zynq-boot-image/staging"
|
|
|
|
# Internal helper to start GDB after running init.
|
|
# Pass init flags (if any) via `init_args`.
|
|
[no-cd]
|
|
run_generic binary init_args="":
|
|
python3 {{INIT_SCRIPT}} {{init_args}}
|
|
gdb-multiarch -q -x {{GDB_CMD}} {{binary}} -tui
|
|
|
|
# Public targets
|
|
[no-cd]
|
|
run binary: (run_generic binary)
|
|
|
|
[no-cd]
|
|
run-no-reset binary: (run_generic binary "-s")
|
|
|
|
flash-nor-zedboard boot_binary:
|
|
cd {{justfile_directory()}}/firmware/zedboard-qspi-flasher && cargo build --release
|
|
xsct firmware/zedboard-qspi-flasher/qspi-flasher.tcl scripts/ps7_init.tcl -b {{invocation_directory()}}/{{boot_binary}}
|