# Part of JoeyLib, Copyright (c) 2026 Scott Duensing, under the MIT License. # See LICENSE.md for license information. # SPDX-License-Identifier: MIT # # JoeyLib top-level Makefile. # # Usage: # make builds every target whose toolchain is installed # make iigs builds Apple IIgs only # make amiga builds Commodore Amiga only # make atarist builds Atari ST only (runs on every ST) # make ste builds the Atari STe variant (STe and Mega STe only) # make dos builds MS-DOS only # make x68000 builds Sharp X68000 only # make dvx builds DVX (JoeyLib programs as DVX desktop programs) # make sdl3 builds SDL3 (JoeyLib programs as native windowed programs) # make web builds the web port (JoeyLib programs as web pages) # make win32 builds Win32 (Windows 95 through today, as .EXE programs) # make win16 builds Win16 (Windows 3.1 on a 386, as .EXE programs) # make psp builds the PSP port (JoeyLib programs as PSP homebrew EBOOT.PBPs) # make haiku builds Haiku x86_64 (the Be API backend, gcc 13) # make haiku32 builds Haiku 32-bit x86 (the Be API backend, gcc 2.95, BeOS ABI) # make beos builds BeOS R5 x86 (the same backend and compiler, R5's own headers and libraries) # make docs renders the manual to build/docs (HTML + PDF) # make verify builds every port, then runs every gate (needs emulators) # make verify-audio runs every port's audio gate (needs emulators) # make verify-serial runs every port's serial loopback gate # make clean removes all build outputs # # Cross tools come from ./install.sh, which records their paths in # toolchains/config.mk; every makefile reads that file itself, so no # environment setup is needed first. # The toolchain paths and which ports are installed (HAVE_, # JOEY_PORTS_INSTALLED) come from make/common.mk, shared with every port's # makefile and with make/project.mk. include $(dir $(firstword $(MAKEFILE_LIST)))make/common.mk ALL_TARGETS := $(JOEY_PORTS_INSTALLED) .PHONY: all iigs iigs-disk iigs-verify amiga atarist ste dos x68000 dvx sdl3 web win32 win16 psp haiku haiku32 beos blank-check tools clean help status verify verify-audio verify-serial docs all: $(ALL_TARGETS) tools ifeq ($(ALL_TARGETS),) @echo "No toolchains detected. Run: ./install.sh install toolchains" @exit 1 endif tools: @$(MAKE) -f $(REPO_DIR)/make/tools.mk iigs: @$(MAKE) -f $(REPO_DIR)/make/iigs.mk iigs-disk: @$(MAKE) -f $(REPO_DIR)/make/iigs.mk iigs-disk iigs-verify: @$(MAKE) -f $(REPO_DIR)/make/iigs.mk iigs-verify amiga: @$(MAKE) -f $(REPO_DIR)/make/amiga.mk atarist: @$(MAKE) -f $(REPO_DIR)/make/atarist.mk ste: @$(MAKE) -f $(REPO_DIR)/make/ste.mk dos: @$(MAKE) -f $(REPO_DIR)/make/dos.mk x68000: @$(MAKE) -f $(REPO_DIR)/make/x68000.mk dvx: @$(MAKE) -f $(REPO_DIR)/make/dvx.mk sdl3: @$(MAKE) -f $(REPO_DIR)/make/sdl3.mk web: @$(MAKE) -f $(REPO_DIR)/make/web.mk win32: @$(MAKE) -f $(REPO_DIR)/make/win32.mk win16: @$(MAKE) -f $(REPO_DIR)/make/win16.mk psp: @$(MAKE) -f $(REPO_DIR)/make/psp.mk haiku: @$(MAKE) -f $(REPO_DIR)/make/haiku.mk haiku32: @$(MAKE) -f $(REPO_DIR)/make/haiku32.mk beos: @$(MAKE) -f $(REPO_DIR)/make/beos.mk # Compile + link-check the new-port template (src/blank/blank.c) with the host # cc. No toolchain needed; keeps the template from bit-rotting as the lib grows. blank-check: @$(REPO_DIR)/scripts/check-blank.sh # The manual: docs/Manual.adoc plus its chapter includes -> build/docs. # Needs asciidoctor and asciidoctor-pdf, no cross toolchain. # make docs FORMAT=html renders only the web version (much faster). docs: @$(REPO_DIR)/scripts/build-docs.sh $(FORMAT) # EVERYTHING: build every port, then run every gate -- host checks, UBER # golden hashes, the IIgs example boots, input, audio, serial, the X68000 # mouse, IIgs save / serial loss / game disks -- sequentially, with a # per-gate summary. Same exit codes as below. Takes a subset of ports: # make verify PORTS="host dos" verify: @$(REPO_DIR)/scripts/verify-all.sh all $(PORTS) # Every port's audio gate, run sequentially (the recording gates grade # fixed time windows, so a competing emulator can slide a phase boundary). # Exits 1 on a real failure and 3 if a gate SKIPPED for an unbuilt port -- # non-zero on purpose, so a run that tested nothing cannot look green. # Takes a subset: make verify-audio PORTS="atarist amiga" verify-audio: @$(REPO_DIR)/scripts/verify-all.sh audio $(PORTS) # The host check of the shared serial layer, then every port's loopback gate # (banner out, probe echoed back), sequentially, with the same exit codes. # Takes a subset: make verify-serial PORTS="host dos" verify-serial: @$(REPO_DIR)/scripts/verify-all.sh serial $(PORTS) clean: rm -rf $(REPO_DIR)/build status: @echo "Toolchain availability:" @echo " iigs: $(if $(HAVE_IIGS),yes,NO)" @echo " amiga: $(if $(HAVE_AMIGA),yes,NO)" @echo " atarist: $(if $(HAVE_ATARIST),yes,NO)" @echo " ste: $(if $(HAVE_STE),yes,NO)" @echo " dos: $(if $(HAVE_DOS),yes,NO)" @echo " x68000: $(if $(HAVE_X68000),yes,NO)" @echo " dvx: $(if $(HAVE_DVX),yes,NO)" @echo " sdl3: $(if $(HAVE_SDL3),yes,NO)" @echo " web: $(if $(HAVE_WEB),yes,NO)" @echo " win32: $(if $(HAVE_WIN32),yes,NO)" @echo " win16: $(if $(HAVE_WIN16),yes,NO)" @echo " psp: $(if $(HAVE_PSP),yes,NO)" @echo " haiku: $(if $(HAVE_HAIKU),yes,NO)" @echo " haiku32: $(if $(HAVE_HAIKU32),yes,NO)" @echo " beos: $(if $(HAVE_BEOS),yes,NO)" help: @echo "Targets: iigs amiga atarist ste dos x68000 dvx sdl3 web win32 win16 psp haiku haiku32 beos all clean status help" @echo " iigs-disk iigs-verify (IIgs MAME visual check)" @echo " blank-check (host-cc smoke test of the new-port template + gnu89 lint)" @echo " verify (build every port, then run every gate; PORTS= subset)" @echo " verify-audio (all 5 audio gates; PORTS=\"atarist amiga\" for a subset)" @echo " verify-serial (host check + all 5 serial loopback gates; PORTS= subset)" @echo " docs (manual to build/docs; FORMAT=html for HTML only)" @echo "Install toolchains first: ./install.sh install toolchains"