Skip to content

Tidy up build: Makefile cleanup, GitHub Actions CI, make test - #19

Merged
MikeDX merged 5 commits into
masterfrom
tidy-2026
Oct 9, 2026
Merged

MikeDX merged 5 commits into
masterfrom
tidy-2026

Conversation

@MikeDX

@MikeDX MikeDX commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Supersedes #18 (thanks @cospplredman, credited in the first commit). Fixes #3. Fixes #5.

What changed

  • Makefile (from Issue#3 Tidy up Makefile #18, conflict with Fixed test build #17 resolved): per-CPU wildcards instead of hand-listed objects, overridable CPU/SDL/PLAT/DEBUG, z80emu helpers (maketables, zextest) moved to src/cpu/z80emu/util/.
  • Makefile rework on top: objects go in obj/ (not the source tree), .c is compiled as C and .cpp as C++11, Emscripten flags/preloads restored, make tests/zxtest works again. -Wextra from Issue#3 Tidy up Makefile #18 left out since it adds ~940 unused-parameter warnings in the vendored cores.
  • Small warning fixes: const char * opcode format strings in z80core, prototype for Z80CORE_Create(void).
  • Warnings on a clean macOS build: 1433 -> 16 (the remaining 16 are -Wnested-anon-types in Z80Core.h).
  • make SDL=2 fixed (#include <SDL.h>; sdl2-config already adds the SDL2 dir).
  • make test: cputest now exits non-zero on failure; the target fails if fewer than 286 tests pass. The z80emu core currently stops at cb46 (BIT 0,(HL) undocumented flags 3/5, from MEMPTR, which z80emu doesn't model), so that's the baseline used to catch regressions.
  • CI: .travis.yml replaced with .github/workflows/build.yml (Ubuntu + macOS, SDL 1.2 + SDL2, builds the z80core and z80emu cores, runs make test). README badge and build instructions updated.

Tested locally (macOS arm64)

  • make, make SDL=2, make SDL=0, make DEBUG=1, make CPU=z80emu all build clean
  • ./zxem boots the 48K ROM with SDL 1.2 and SDL2
  • make test: 286 passed, known stop at cb46

Not covered

  • util/zextest.c doesn't build against this repo's callback-based z80emu (FLAG_STOP_EMULATION etc. are gone), so it isn't in CI.
  • PLAT=HTML not tested (no Emscripten here).

Use wildcards per CPU core instead of listing every object, make
CC/PLAT/SDL overridable, and move the z80emu helper programs
(maketables, zextest) into src/cpu/z80emu/util so they are not built
into the emulator.

Based on PR #18 by cospplredman
Rework of the tidied Makefile:
- objects go to obj/ (objhtml/ for PLAT=HTML) instead of the source tree
- .c files are compiled with CC and .cpp files with CXX -std=c++11,
  which removes the 'treating c input as c++' and C++11 extension warnings
- restore the scr/ preload and SDL flags for the Emscripten build
- add a test_z80emu object so 'make tests/zxtest' works again
- keep -Wall -pedantic (no -Wextra, which adds ~940 unused-parameter
  warnings in the vendored CPU cores)
- make the z80core opcode format strings const char * and give
  Z80CORE_Create a prototype

Warnings on a clean macOS build drop from 1433 to 16.
'make test' runs the suite and fails if fewer than the known 286 tests
pass (the z80emu core currently stops at cb46, an undocumented flags
case that depends on MEMPTR).
sdl2-config adds .../include/SDL2 to the include path, so <SDL2/SDL.h>
was not found.
Build on Ubuntu and macOS against SDL 1.2 and SDL2, build the z80emu
core as well as z80core, and run 'make test'. Update the README badge
and add build instructions.
@MikeDX
MikeDX merged commit 568cf5f into master Oct 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TODO: Add Travis CI to perform automated cross platform build testing TODO: Tidy up Makefile

1 participant