Skip to content

Conversation

@dillera
Copy link
Contributor

@dillera dillera commented Oct 31, 2025

This cleans up the build so that it works with Mac's that have Xcode installed and need some guards around using those tools instead of the 8bit compilers.

Problem: cmoc was using macOS Xcode SDK headers instead of cmoc-compatible headers
Modified fujinet-fuji.h to define types using #define macros for CMOC builds instead of including system headers
Added -D_CMOC_VERSION_=1 flag to makefiles/compiler-cmoc.mk

Problem: cpu.mac was being included multiple times causing "Symbol already defined" errors
Created common/inc/cpu.inc with proper include guard checking for CPU_ISET_NONE
Updated apple2/apple2-6502/bus/sp_init.s to use guarded include

- Remove direct includes of cmoc.h and coco.h from fujinet-fuji.h
- Define bool and integer types using macros for CMOC builds
- Avoid including system headers that conflict with cmoc target
- Add -D_CMOC_VERSION_=1 flag to compiler-cmoc.mk

This fixes the issue where cmoc was picking up macOS Xcode headers
instead of cmoc-compatible headers, causing preprocessor errors.
- Create common/inc/cpu.inc with include guard for cpu macros
- Update apple2/apple2-6502/bus/sp_init.s to use guarded include
- Prevents 'Symbol already defined' errors when cpu.mac is included multiple times

This fixes the issue where ca65 was redefining CPU_ISET_* symbols
during compilation of assembly files.
- Change guard from checking __CPU_INC_INCLUDED__ to CPU_ISET_NONE
- This properly detects if cpu.mac has already been included
- Fixes the 'Symbol already defined' errors for all apple2 targets

The issue was that .ifndef __CPU_INC_INCLUDED__ didn't prevent the
.macpack cpu from being executed multiple times, since the CPU symbols
are defined with = (assignment) not .define. Checking for CPU_ISET_NONE
(which is defined by cpu.mac) properly guards against multiple inclusion.
- Require GNU Make 4.0 or later for $(file ...) function support
- Display helpful error message on macOS directing users to use 'gmake'
- Fixes issue where VERSION_STRING was empty with old make 3.81
- Ensures version numbers appear in dist filenames (e.g., fujinet-lib-apple2-4.8.0.zip)

Users on macOS should use 'gmake' instead of 'make' for proper version handling.
Copy link
Contributor

@tschak909 tschak909 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tschak909 tschak909 merged commit 66c17b6 into FujiNetWIFI:main Nov 1, 2025
14 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.

2 participants