AMBIENT_IMAGE = /scratch/ambient-images/ambient-boot.qcow2
TESTS =

all: check build ambient.html test

check:
	cargo clippy --all-targets -- -Dwarnings
	cargo deny check -Dwarnings

build:
	cargo build --all-targets
	subplot codegen ambient.subplot -o test.py

ambient.html: ambient.subplot ambient.md ambient.yaml Makefile
	subplot docgen ambient.subplot -o ambient.html

test: build
	rm -f test.log
	if ! python3 test.py --log test.log --env "IMAGE=$(AMBIENT_IMAGE)" $(TESTS); then cat test.log; exit 1; fi

semver:
	cargo semver-checks
