diff --git a/Makefile b/Makefile index 6b1ed80..6fadc8c 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,12 @@ # Set the TARGETS and PROGRAM values as required. # See makefiles/build.mk for details on directory structure for src files and how to add custom extensions to the build. -TARGETS = adam apple2 apple2enh atari c64 coco msdos +# Require GNU Make 4.0 or later for $(file ...) function +ifeq ($(filter 4.%,$(MAKE_VERSION)),) + $(error This Makefile requires GNU Make 4.0 or later. You are using $(MAKE_VERSION). Please use 'gmake' instead of 'make' on macOS.) +endif + +TARGETS = apple2 apple2enh atari c64 coco PROGRAM := fujinet.lib SUB_TASKS := clean disk test release unit-test diff --git a/apple2/apple2-6502/bus/sp_init.s b/apple2/apple2-6502/bus/sp_init.s index 2de95db..3393e9b 100644 --- a/apple2/apple2-6502/bus/sp_init.s +++ b/apple2/apple2-6502/bus/sp_init.s @@ -10,7 +10,7 @@ .include "macros.inc" .include "zp.inc" - .macpack cpu + .include "cpu.inc" ; Find the SmartPort device that has a FujiNet NETWORK adapter on it. ; Really we should search for the FUJI device on it, but historically that was diff --git a/common/inc/cpu.inc b/common/inc/cpu.inc new file mode 100644 index 0000000..264b73b --- /dev/null +++ b/common/inc/cpu.inc @@ -0,0 +1,7 @@ +; Guard to prevent multiple inclusion of cpu macros +; Check if CPU_ISET_NONE is already defined (from cpu.mac) +.ifndef CPU_ISET_NONE + +.macpack cpu + +.endif diff --git a/fujinet-fuji.h b/fujinet-fuji.h index bbff5c7..bad2014 100644 --- a/fujinet-fuji.h +++ b/fujinet-fuji.h @@ -6,20 +6,25 @@ // In general, bools return the "success" status, so true is good, false is bad. #ifdef _CMOC_VERSION_ - #include - #include - - #ifndef bool - #define bool _FNBool - typedef unsigned char _FNBool; - #endif /* bool */ - - #define true 1 - #define false 0 +// CMOC-specific types and definitions +#ifndef bool +#define bool unsigned char +#endif /* bool */ + +#define true 1 +#define false 0 + +// Define standard integer types for CMOC +#define uint8_t unsigned char +#define int8_t signed char +#define uint16_t unsigned short +#define int16_t signed short +#define uint32_t unsigned long +#define int32_t signed long #else - #include - #include - #include +#include +#include +#include #endif /* _CMOC_VERSION_ */ #ifdef __CBM__ diff --git a/makefiles/compiler-cmoc.mk b/makefiles/compiler-cmoc.mk index 21a6544..135cbb0 100644 --- a/makefiles/compiler-cmoc.mk +++ b/makefiles/compiler-cmoc.mk @@ -1,6 +1,6 @@ CC := cmoc AR := lwar -CFLAGS := -O2 +CFLAGS := -O2 -D_CMOC_VERSION_=1 INCC_ARG := -I INCS_ARG := -I