# Das OS build entry points. Everything except QEMU runs in the Void builder container.

.PHONY: help packages iso qemu qemu-bios qemu-disk test clean

help:
	@echo "make packages   build srcpkgs/* into the local repository (out/hostdir/binpkgs)"
	@echo "make iso        build packages, then the live ISO (out/iso)"
	@echo "make qemu       boot the newest ISO in QEMU with UEFI"
	@echo "make qemu-bios  boot the newest ISO in QEMU with legacy BIOS"
	@echo "make qemu-disk  boot with a 20 GB virtual disk attached (for installer tests)"
	@echo "make test       run Go tests"
	@echo "make clean      remove build output (keeps download caches)"

packages:
	scripts/builder.sh /work/scripts/container/build-packages.sh

iso: packages
	scripts/builder.sh /work/scripts/container/build-iso.sh

qemu:
	scripts/run-qemu.sh

qemu-bios:
	scripts/run-qemu.sh --bios

qemu-disk:
	scripts/run-qemu.sh --disk

test:
	cd srcpkgs/das-theme/files/xfwm4gen && go test ./...

# Build output may be owned by root when a build was interrupted, so remove it from the container
clean:
	scripts/builder.sh rm -rf /work/out/hostdir/binpkgs /work/out/iso
	rm -rf out/qemu
