diff --git a/Makefile b/Makefile index 4ac38401..bab14091 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,9 @@ # # make sbom SPDX SBOM of the source tree (sbom.spdx, sbom.spdx.json) # make kernel ARCH= [GOAL=g] kernel/Makefile goal (default: all) +# make ARCH= clean qemu the kernel for (amd64 aarch64 riscv64), +# cleaned, built and booted in QEMU: the +# acceptance boot (.claude/CLAUDE.md) # make boards list boards and whether they can be built # make goes to v3/Makefile (make help-hosted) # ============================================================================== @@ -56,7 +59,12 @@ BOARD_DIR := $(if $(TARGET),$(BOARD_DIR_$(TARGET))) SUBMAKE := $(MAKE) --no-print-directory .DEFAULT_GOAL := all -.PHONY: all boot_image boot_images docs clean clean-docs kernel boards help help-hosted sbom sbom-board +.PHONY: all boot_image boot_images docs clean clean-docs kernel boards help help-hosted sbom sbom-board \ + qemu qemu-esp qemu-gdb + +# ARCH given on the command line and no TARGET: `clean` is the kernel's for that +# ISA, as `qemu` always is (make ARCH= clean qemu). +KERNEL_CLEAN := $(if $(TARGET),,$(filter command line,$(origin ARCH))) # ------------------------------------------------------------------------------ # all @@ -182,7 +190,10 @@ clean-docs: # ------------------------------------------------------------------------------ # clean # ------------------------------------------------------------------------------ -ifeq ($(TARGET),) +ifneq ($(KERNEL_CLEAN),) +clean: + @$(SUBMAKE) -f kernel/Makefile ARCH=$(ARCH) clean +else ifeq ($(TARGET),) clean: @if [ -d build ]; then find build -mindepth 1 -maxdepth 1 ! -name cache -exec rm -rf {} +; fi rm -f v3/include/version.h @@ -204,6 +215,9 @@ GOAL ?= all kernel: @$(SUBMAKE) -f kernel/Makefile TARGET=kernel $(GOAL) +qemu qemu-esp qemu-gdb: + @$(SUBMAKE) -f kernel/Makefile $(if $(ARCH),ARCH=$(ARCH)) $@ + boards: @$(foreach b,$(BOARDS),printf ' %-9s %-8s %s\n' "$(b)" \ "$(if $(call board_ready,$(b)),ready,no port)" "$(call board_field,$(b),BOARD_DESC)";)