#!/bin/sh # SPDX-License-Identifier: MIT # Build milestone 4's audio referees from the pinned die-derived sources in # reference/src/ (fetched by scripts/fetch_references.py, never committed here). # # sh validation/build_referees.sh # # The binaries land in reference/build-referees/ (git-ignored). Nothing of the # referees' source is copied into megadrive-python: validation/*.c only drive them. # # Licences: Nuked-OPN2 LGPL-2.1, Nuked-PSG GPL-2.0+. The binaries are built # locally and run as referees; they are not distributed. # # The third referee, lle2612_ref (YM2608-LLE, GPL-2.0-only by the family's rule of # 2026-11-24), and its build step moved on 2026-11-24 to emu-tools-gpl2: # tools/ym2608-lle/lle2612_ref.c, built by tools/ym2608-lle/build_lle2612_ref.sh. # # Built and used with gcc 15.2.0 (Ubuntu 15.2.0-16ubuntu1) on 2026-09-22. set -e root=$(cd "$(dirname "$0")/.." && pwd) src="$root/reference/src" out="$root/reference/build-referees" mkdir -p "$out" CC=${CC:-gcc} CFLAGS=${CFLAGS:--O2 -w} echo "opn2_ref (Nuked-OPN2 @ 335747d)" $CC $CFLAGS -I "$src/Nuked-OPN2" -o "$out/opn2_ref" \ "$root/validation/opn2_ref.c" "$src/Nuked-OPN2/ym3438.c" echo "psg_ref (Nuked-PSG @ d15a168)" $CC $CFLAGS -I "$src/Nuked-PSG" -o "$out/psg_ref" \ "$root/validation/psg_ref.c" "$src/Nuked-PSG/ympsg.c" echo "built in $out"