Skip to content

Commit 0712a0d

Browse files
committed
Fix Atari linking
1 parent d69451f commit 0712a0d

File tree

8 files changed

+37
-16
lines changed

8 files changed

+37
-16
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ apple2/disk-post::
9393
########################################
9494
# Atari customization
9595

96+
ATARI_LINKER_CFG = src/atari/atari.cfg
97+
EXECUTABLE_EXTRA_DEPS_ATARI = $(ATARI_LINKER_CFG)
98+
LDFLAGS_EXTRA_ATARI = -C $(ATARI_LINKER_CFG)
9699
EXTRA_INCLUDE_ATARI = src/atari/asminc
97100

98101
########################################

makefiles/README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
# Makefile Framework
1+
# MekkoGX Modular Makefile Framework
22

3-
This directory provides a modular framework of Makefiles.
3+
[MekkoGX](https://github.com/fozzTexx/MekkoGX) is a cross-platform
4+
build template for retro and classic computers. It provides a
5+
collection of modular Makefiles and a top-level template project to
6+
simplify compiling, linking, and building disk images across multiple
7+
platforms.
48

59
The main goal is to make it easy to:
610

7-
* Add new computer platforms by dropping in a new
8-
platforms/<platform>.mk file.
9-
* Avoid per-project hacks inside platform makefiles.
10-
* Keep all project-specific customization in the top-level Makefile,
11-
where it’s visible and easy to maintain.
11+
* Easily switch between different FUJINET_LIB versions by setting a
12+
single variable (supports directories, releases, or Git URLs).
13+
* Keep platforms and toolchains fully modular: each uses a small .mk
14+
file with shared logic in common.mk and tc-common.mk, making it
15+
simple to add new platforms or toolchains.
16+
* **Keep all project-specific customization in the top-level Makefile,
17+
where it’s visible and easy to maintain.**
1218

1319
Think of this as a library of Makefiles.
1420

@@ -117,7 +123,7 @@ With `SRC_DIRS = src src/%PLATFORM%`, building for `c64` would expand `%PLATFORM
117123
- `src/commodore`
118124
- `src/eightbit`
119125

120-
### The `r2r` Target
126+
### The `r2r` "Ready 2 Run" Target
121127

122128
The `r2r` target is the **default build output** for a platform. It
123129
will always build the platform’s executable. For some platforms, it

makefiles/common.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ $(info Building for PLATFORM=$(PLATFORM))
1010

1111
include $(MWD)/../Makefile
1212

13-
# Add GIT_VERSION macro define to CFLAGS, includes tag if available,
14-
# short commit hash, appends '*' if changes haven't been commited
15-
CFLAGS += -DGIT_VERSION='"$(shell git rev-parse --short HEAD)$(shell git status --porcelain | grep -q '^[ MADRCU]' && echo '*')"'
13+
# Define GIT_VERSION to be used in macro define to CFLAGS, includes
14+
# tag if available, short commit hash, appends '*' if changes haven't
15+
# been commited
16+
GIT_VERSION := $(shell git rev-parse --short HEAD)$(shell git status --porcelain | grep -q '^[ MADRCU]' && echo '*')
1617

1718
IS_LIBRARY := $(if $(filter %.lib,$(PRODUCT)),1,0)
1819
ifeq ($(IS_LIBRARY),1)

makefiles/fnlib.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
VERSION_NUM_RE = r"([0-9]+[.][0-9]+[.][0-9]+)"
1717
VERSION_NAME_RE = fr"v?{VERSION_NUM_RE}"
1818
LDLIB_REGEX = r"lib(.*)[.]a$"
19-
LDLIB_PLATFORMS = ["coco", "dragon", "msdos"]
19+
20+
# FIXME - this is really toolchains, not platforms
21+
LDLIB_PLATFORMS = ["coco", "dragon"]
2022

2123
def build_argparser():
2224
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
@@ -265,7 +267,7 @@ def downloadZip(self):
265267

266268
return
267269

268-
error_exit("Unable to download FujiNet library from", release_url)
270+
#error_exit("Unable to download FujiNet library from", release_url)
269271
return
270272

271273
def gitClone(self, url):

makefiles/toolchains/cc65.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ AR_DEFAULT ?= ar65
55

66
include $(MWD)/tc-common.mk
77

8-
CFLAGS += -O --cpu 6502
9-
ASFLAGS += --cpu 6502
8+
CFLAGS +=
9+
ASFLAGS +=
1010
LDFLAGS +=
1111

12+
CFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"'
13+
1214
define include-dir-flag
1315
--include-dir $1
1416
endef

makefiles/toolchains/cmoc.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ CFLAGS += --intdir=$(OBJ_DIR)
99
ASFLAGS +=
1010
LDFLAGS +=
1111

12+
CFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"'
13+
1214
# Needed because of using sed on error messages
1315
SHELL = /bin/bash -o pipefail
1416

makefiles/toolchains/ow2.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ AS_DEFAULT ?= wasm
33
LD_DEFAULT ?= wlink OPTION quiet
44

55
include $(MWD)/tc-common.mk
6-
CFLAGS += -0 -bt=dos -ms -s -osh -zu
6+
7+
CFLAGS += -0 -bt=dos -ms -s -osh -zu -fr=$(basename $@).err
78
ASFLAGS +=
89
LDFLAGS += SYSTEM dos LIBPATH $(FUJINET_LIB_DIR)
910

11+
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
12+
1013
define include-dir-flag
1114
-I$1
1215
endef

makefiles/toolchains/z88dk.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ CFLAGS +=
99
ASFLAGS +=
1010
LDFLAGS +=
1111

12+
CFLAGS += -DGIT_VERSION='\"$(GIT_VERSION)\"'
13+
1214
define include-dir-flag
1315
-I$1
1416
endef

0 commit comments

Comments
 (0)