diff --git a/Makefile b/Makefile index 1f8cb26..3efc944 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ PRODUCT = config -PLATFORMS = coco apple2 atari c64 adam pmd85 +PLATFORMS = coco apple2 atari c64 adam # Not currently in buildable state #PLATFORMS += dragon #PLATFORMS += msdos #PLATFORMS += pc6001 #PLATFORMS += pc8801 +#PLATFORMS += pmd85 #PLATFORMS += rc2014 # Require special toolchains @@ -29,7 +30,7 @@ SRC_DIRS = src src/%PLATFORM% # - a URL to a git repo # - empty which will use whatever is the latest # - undefined, no fujinet-lib will be used -FUJINET_LIB = +FUJINET_LIB = 4.7.9 $(info FUJUNET_LIB=$(FUJINET_LIB)) # Some platforms don’t use FUJINET_LIB; set this to allow builds to continue @@ -93,6 +94,9 @@ apple2/disk-post:: ######################################## # Atari customization +ATARI_LINKER_CFG = src/atari/atari.cfg +EXECUTABLE_EXTRA_DEPS_ATARI = $(ATARI_LINKER_CFG) +LDFLAGS_EXTRA_ATARI = -C $(ATARI_LINKER_CFG) EXTRA_INCLUDE_ATARI = src/atari/asminc ######################################## diff --git a/makefiles/README.md b/makefiles/README.md index db55c30..e53e044 100644 --- a/makefiles/README.md +++ b/makefiles/README.md @@ -1,14 +1,20 @@ -# Makefile Framework +# MekkoGX Modular Makefile Framework -This directory provides a modular framework of Makefiles. +[MekkoGX](https://github.com/fozzTexx/MekkoGX) is a cross-platform +build template for retro and classic computers. It provides a +collection of modular Makefiles and a top-level template project to +simplify compiling, linking, and building disk images across multiple +platforms. The main goal is to make it easy to: -* Add new computer platforms by dropping in a new - platforms/.mk file. -* Avoid per-project hacks inside platform makefiles. -* Keep all project-specific customization in the top-level Makefile, - where it’s visible and easy to maintain. +* Easily switch between different FUJINET_LIB versions by setting a + single variable (supports directories, releases, or Git URLs). +* Keep platforms and toolchains fully modular: each uses a small .mk + file with shared logic in common.mk and tc-common.mk, making it + simple to add new platforms or toolchains. +* **Keep all project-specific customization in the top-level Makefile, + where it’s visible and easy to maintain.** Think of this as a library of Makefiles. @@ -117,7 +123,7 @@ With `SRC_DIRS = src src/%PLATFORM%`, building for `c64` would expand `%PLATFORM - `src/commodore` - `src/eightbit` -### The `r2r` Target +### The `r2r` "Ready 2 Run" Target The `r2r` target is the **default build output** for a platform. It will always build the platform’s executable. For some platforms, it diff --git a/makefiles/common.mk b/makefiles/common.mk index c1fb09b..f387a2e 100644 --- a/makefiles/common.mk +++ b/makefiles/common.mk @@ -10,9 +10,10 @@ $(info Building for PLATFORM=$(PLATFORM)) include $(MWD)/../Makefile -# Add GIT_VERSION macro define to CFLAGS, includes tag if available, -# short commit hash, appends '*' if changes haven't been commited -CFLAGS += -DGIT_VERSION='"$(shell git rev-parse --short HEAD)$(shell git status --porcelain | grep -q '^[ MADRCU]' && echo '*')"' +# Define GIT_VERSION to be used in macro define to CFLAGS, includes +# tag if available, short commit hash, appends '*' if changes haven't +# been commited +GIT_VERSION := $(shell git rev-parse --short HEAD)$(shell git status --porcelain | grep -q '^[ MADRCU]' && echo '*') IS_LIBRARY := $(if $(filter %.lib,$(PRODUCT)),1,0) ifeq ($(IS_LIBRARY),1) diff --git a/makefiles/fnlib.py b/makefiles/fnlib.py index 05e89db..950a228 100755 --- a/makefiles/fnlib.py +++ b/makefiles/fnlib.py @@ -16,7 +16,9 @@ VERSION_NUM_RE = r"([0-9]+[.][0-9]+[.][0-9]+)" VERSION_NAME_RE = fr"v?{VERSION_NUM_RE}" LDLIB_REGEX = r"lib(.*)[.]a$" -LDLIB_PLATFORMS = ["coco", "dragon", "msdos"] + +# FIXME - this is really toolchains, not platforms +LDLIB_PLATFORMS = ["coco", "dragon"] def build_argparser(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) @@ -265,7 +267,7 @@ def downloadZip(self): return - error_exit("Unable to download FujiNet library from", release_url) + #error_exit("Unable to download FujiNet library from", release_url) return def gitClone(self, url): diff --git a/makefiles/toolchains/cc65.mk b/makefiles/toolchains/cc65.mk index fc819e1..c26a309 100644 --- a/makefiles/toolchains/cc65.mk +++ b/makefiles/toolchains/cc65.mk @@ -5,10 +5,12 @@ AR_DEFAULT ?= ar65 include $(MWD)/tc-common.mk -CFLAGS += -O --cpu 6502 -ASFLAGS += --cpu 6502 +CFLAGS += +ASFLAGS += LDFLAGS += +CFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"' + define include-dir-flag --include-dir $1 endef diff --git a/makefiles/toolchains/cmoc.mk b/makefiles/toolchains/cmoc.mk index d072f93..ec67605 100644 --- a/makefiles/toolchains/cmoc.mk +++ b/makefiles/toolchains/cmoc.mk @@ -9,6 +9,8 @@ CFLAGS += --intdir=$(OBJ_DIR) ASFLAGS += LDFLAGS += +CFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"' + # Needed because of using sed on error messages SHELL = /bin/bash -o pipefail diff --git a/makefiles/toolchains/ow2.mk b/makefiles/toolchains/ow2.mk index 436dd8c..dd2c1ac 100644 --- a/makefiles/toolchains/ow2.mk +++ b/makefiles/toolchains/ow2.mk @@ -3,10 +3,13 @@ AS_DEFAULT ?= wasm LD_DEFAULT ?= wlink OPTION quiet include $(MWD)/tc-common.mk -CFLAGS += -0 -bt=dos -ms -s -osh -zu + +CFLAGS += -0 -bt=dos -ms -s -osh -zu -fr=$(basename $@).err ASFLAGS += LDFLAGS += SYSTEM dos LIBPATH $(FUJINET_LIB_DIR) +CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" + define include-dir-flag -I$1 endef diff --git a/makefiles/toolchains/z88dk.mk b/makefiles/toolchains/z88dk.mk index 003e822..1ceee5d 100644 --- a/makefiles/toolchains/z88dk.mk +++ b/makefiles/toolchains/z88dk.mk @@ -9,6 +9,8 @@ CFLAGS += ASFLAGS += LDFLAGS += +CFLAGS += -DGIT_VERSION='\"$(GIT_VERSION)\"' + define include-dir-flag -I$1 endef