PYTHON ?= python3 MODE ?= debug .PHONY: setup build test test-real-core host-test check clean release setup-geargrafx integration integration-test setup: $(PYTHON) tools/setup.py all setup-geargrafx: bash scripts/setup-geargrafx.sh build: $(PYTHON) tools/build.py --mode "$(MODE)" # Required host gate (no Geargrafx needed): OSS_PCE_REQUIRE_CC65=1 turns any missing cc65 into a FAILURE, never a SKIP. # Real-core checks are NOT run here; they are the required separate gate `test-real-core` (CI runs both). test: build OSS_PCE_REQUIRE_CC65=1 $(PYTHON) -m unittest discover -s tests/host -v @echo 'INFO: real Geargrafx checks are not part of make test; run make test-real-core (informational only)' # Required real-core gate (Issue #398): needs the pinned Geargrafx core. Fail-closed: a missing core is FAIL, never PASS. test-real-core: build $(MAKE) integration MODE="$(MODE)" $(MAKE) integration-test # Real-Geargrafx tests (fetch/build, real-core runs) live only in tests/integration (Issue #333). integration-test: OSS_PCE_REQUIRE_CC65=1 $(PYTHON) -m unittest discover -s tests/integration -p 'test_*.py' -v # Local host-only run: no build, no integration. cc65-dependent tests SKIP with a reason when cc65 is absent; # the required gate is `make test`. host-test: $(PYTHON) -m unittest discover -s tests/host -v integration: build $(PYTHON) tests/integration/geargrafx_smoke.py --rom "build/$(MODE)/smoke-test-not-bios.pce" --output "build/$(MODE)/geargrafx-evidence.json" $(PYTHON) tests/integration/geargrafx_reference_guard.py $(PYTHON) tests/integration/geargrafx_reference_guard_issue173.py $(PYTHON) tests/integration/geargrafx_mmio1804_trap.py $(PYTHON) tests/integration/geargrafx_mmio1804_preblock.py $(PYTHON) tests/integration/geargrafx_irq_register.py $(PYTHON) tests/integration/geargrafx_st_bypass.py $(PYTHON) tests/integration/geargrafx_bcdbin.py $(MAKE) block-write-guard # Issue #367: free-running pre-write refusal via a verification-only core patch (synthetic media). Runs in `integration`. .PHONY: block-write-guard block-write-guard: $(PYTHON) tests/integration/geargrafx_block_write_guard.py check: $(PYTHON) tools/contracts.py $(PYTHON) tools/check.py # Issue #335: same-input rebuild must be byte-identical and its manifest must describe the ROM (fail-closed). rom-provenance: $(PYTHON) tools/rom_provenance.py --reproduce smoke --mode "$(MODE)" clean: $(PYTHON) -c 'from pathlib import Path; import shutil; p = Path("build"); shutil.rmtree(p) if p.exists() else None' release: @echo 'BLOCKED: BIOS APIs and System Card boot are unimplemented; no BIOS release is available.' >&2 @exit 1 .PHONY: dev-rom dev-test dev-integration dev-sweep dev-bcdbin-sweep dev-mul16s-sweep dev-release-gate dev-release-gate-blocked dev-rom: $(PYTHON) tools/build_rom.py --mode "$(MODE)" dev-test: dev-rom OSS_PCE_REQUIRE_CC65=1 $(PYTHON) -m unittest discover -s tests/host -p 'test_api*.py' -v $(MAKE) dev-integration MODE="$(MODE)" dev-integration: dev-rom $(PYTHON) tests/integration/geargrafx_api.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(PYTHON) tests/integration/dev_getver_multi_input.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(PYTHON) tests/integration/geargrafx_dev_bcd.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(MAKE) dev-bcdbin-sweep MODE="$(MODE)" $(PYTHON) tests/integration/geargrafx_dev_mul8u.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(PYTHON) tests/integration/geargrafx_dev_mul16u.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(PYTHON) tests/integration/geargrafx_dev_div16s.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(PYTHON) tests/integration/geargrafx_dev_mul8s.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(PYTHON) tests/integration/geargrafx_dev_div16u.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(PYTHON) tests/integration/geargrafx_dev_mul16s.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" $(MAKE) dev-sweep MODE="$(MODE)" # Issue #494: manual large real-core sweep of the DEV ROM MA_MUL16S entry (slot 0x4F): every 65,536 multiplier x 6 multiplicands and every 65,536 multiplicand x 6 multipliers, at two caller SPs. Not run by CI. dev-mul16s-sweep: dev-rom $(PYTHON) tests/integration/geargrafx_dev_mul16s.py --full --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" # Issue #442: full 0..255 x 18-condition real-core sweep of the DEV ROM EX_BCDBIN entry (slot $3D). dev-bcdbin-sweep: dev-rom $(PYTHON) tests/integration/dev_bcdbin_full_sweep.py "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" # Issue #434: full 0..255 real-core sweep of the DEV ROM EX_BINBCD entry (slot $3C). dev-sweep: dev-rom $(PYTHON) tests/integration/dev_bcd_full_sweep.py "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" dev-release-gate: $(PYTHON) tools/build_rom.py --release-gate .PHONY: dev-startup dev-startup-integration # Opt-in Issue #4 startup checkpoint; deliberately separate from the default DEV ROM. dev-startup: dev-rom $(PYTHON) tools/build_startup.py --mode "$(MODE)" dev-startup-integration: dev-startup $(PYTHON) tests/integration/geargrafx_startup.py --mode "$(MODE)" # make masks the gate's exit code 3 as 2, so this wraps it: PASS only on exit 3 + 'BLOCKED:'. dev-release-gate-blocked: $(PYTHON) tools/expect_exit.py 3 '^BLOCKED:' -- $(PYTHON) tools/build_rom.py --release-gate .PHONY: dev-cdread dev-cdread-integration # Opt-in Issue #5 CD sector-read hardware diagnostic; separate from the default DEV ROM and startup ROM. dev-cdread: dev-rom $(PYTHON) tools/build_cdread.py --mode "$(MODE)" dev-cdread-integration: dev-cdread $(PYTHON) tests/integration/geargrafx_cdread.py --mode "$(MODE)" .PHONY: dev-cdload-exec dev-cdload-exec-integration # Opt-in Issues #14/#5 load-and-execute experiment; separate from the default DEV ROM and the other diagnostics. dev-cdload-exec: dev-rom $(PYTHON) tools/build_cdload_exec.py --mode "$(MODE)" dev-cdload-exec-integration: dev-cdload-exec $(PYTHON) tests/integration/geargrafx_cdload_exec.py --mode "$(MODE)" .PHONY: dev-boot-internal dev-boot-internal-integration # Issue #501: DEV-ONLY internal boot path (reset -> synthetic CD media check -> READ(6) -> RAM -> jump). NOT compatible, # NOT a BIOS, NOT DEV_CALLABLE. Separate from the default DEV ROM and from the Issue #14/#5 cdload-exec experiment. dev-boot-internal: dev-rom $(PYTHON) tools/build_dev_boot_internal.py --mode "$(MODE)" dev-boot-internal-integration: dev-boot-internal $(PYTHON) tests/integration/geargrafx_dev_boot_internal.py --mode "$(MODE)" .PHONY: dev-cdreset dev-cdreset-integration # Opt-in Issue #10 CD_RESET bus-reset diagnostic (original ROM, not the System Card API); separate from the #5 read ROM. dev-cdreset: dev-rom $(PYTHON) tools/build_cdreset.py --mode "$(MODE)" dev-cdreset-integration: dev-cdreset $(PYTHON) tests/integration/geargrafx_cdreset.py --mode "$(MODE)" .PHONY: dev-cd-base-integration # Opt-in Issue #11: does the DEV ROM have an executable CD_BASE ($E006) callee? (INDEX01=150 fixture) dev-cd-base-integration: dev-rom $(PYTHON) tests/integration/geargrafx_cd_base.py --rom "build/$(MODE)/bios-dev/dev-only-not-compatible-syscard3.pce" .PHONY: dev-trace-integration # Opt-in Issue #6 isolated trace harness: real-core positive + classified negatives on the CD read ROM. dev-trace-integration: dev-cdread $(PYTHON) tests/integration/geargrafx_trace.py --mode "$(MODE)" .PHONY: dev-cdda dev-cdda-integration dev-cdda-scenarios-integration # Opt-in Issue #15 CD-DA observation diagnostic (raw SCSI $D8/$DA/$D9/$DD, not the System Card CD_PLAY API). dev-cdda: dev-rom $(PYTHON) tools/build_cdda.py --mode "$(MODE)" dev-cdda-integration: dev-cdda $(PYTHON) tests/integration/geargrafx_cdda.py --mode "$(MODE)" # Opt-in Issue #215 additional CD-DA scenarios on the same probe (separate evidence file, cdda-scenarios-evidence.json). dev-cdda-scenarios-integration: dev-cdda $(PYTHON) tests/integration/geargrafx_cdda_scenarios.py --mode "$(MODE)" .PHONY: dev-cdsubq-integration # Opt-in Issue #261 $DD Q-subchannel device observation on the #15 CD-DA probe (not the System Card CD_SUBQ ABI). dev-cdsubq-integration: dev-cdda $(PYTHON) tests/integration/geargrafx_cdsubq.py --mode "$(MODE)" .PHONY: dev-reset-entry dev-reset-entry-integration # Opt-in Issue #143 minimal reset entry; separate from the default DEV ROM and other diagnostics. dev-reset-entry: dev-rom $(PYTHON) tools/build_reset_entry.py --mode "$(MODE)" dev-reset-entry-integration: dev-reset-entry $(PYTHON) tests/integration/geargrafx_reset_entry.py --mode "$(MODE)" .PHONY: dev-cd-media-state dev-cd-media-state-integration # Opt-in Issue #144 media-state observation point called from the #143 reset entry. dev-cd-media-state: dev-rom $(PYTHON) tools/build_cd_media_state.py --mode "$(MODE)" dev-cd-media-state-integration: dev-cd-media-state $(PYTHON) tests/integration/geargrafx_cd_media_state.py --mode "$(MODE)" .PHONY: dev-cd-stat-observation-integration # Opt-in Issue #231 device-layer observation (real Geargrafx, synthetic discs); reuses the #144 media-state ROM. dev-cd-stat-observation-integration: dev-cd-media-state $(PYTHON) tests/integration/geargrafx_cd_stat_observation.py --mode "$(MODE)" .PHONY: routine-real-core # Opt-in (#330): Linux-pinned real-core routine tests; not a dependency of test/integration/check. routine-real-core: @[ "$$(uname -s)" = Linux ] || { echo 'BLOCKED: real-core target requires Linux' >&2; exit 1; } @[ -n "$(TOOLS_DIR)" ] || { echo 'ERROR: TOOLS_DIR is required (e.g. TOOLS_DIR=$$HOME/oss-pce-cd-bios-tools)' >&2; exit 1; } $(PYTHON) tests/integration/geargrafx_ex_binbcd.py --mode debug $(PYTHON) tests/integration/geargrafx_ma_mul8s.py $(PYTHON) tests/integration/geargrafx_ma_mul8u.py $(PYTHON) tests/integration/geargrafx_ma_mul16u.py $(PYTHON) tests/integration/geargrafx_ma_div16u.py $(PYTHON) tests/integration/geargrafx_ma_div16s.py $(PYTHON) tests/integration/geargrafx_bcdbin.py