-
Notifications
You must be signed in to change notification settings - Fork 25
Upgrade makefiles to use MekkoGX and single top level Makefile #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade makefiles to use MekkoGX and single top level Makefile #142
Conversation
9868bb3 to
b350968
Compare
Motivation for this came from recurring pain points I’ve encountered (and seen others encounter), conversations across several Discord channels, and observing newer contributors struggle with some of the existing Makefiles. The goal is simply to make the build process easier to understand and smoother for everyone; experienced developers, newcomers, and anyone in between.
I realize this isn’t an incremental change, which is why I opened it as a draft PR. My goal is to explore how we can adopt these improvements in a way that works for everyone. I’d really like to hear ideas about what an incremental rollout could look like that achieves these goals (per-platform tweaks, FUJINET_LIB swapping, and easier toolchain additions) without disrupting workflows people are already comfortable with. |
Simply not true. https://github.com/FujiNetWIFI/fujinet-lib/blob/main/makefiles/compiler-cmoc.mk and others in that folder. Not every project uses the compiler extensions, but that was the point, they were brought in incrementally and tested in fujinet-lib by many authors (Eric, Thom, Jan, Geoff, and myself)
again, simply not true, and if you are saying it is because everything is put into the makefiles dirs, then so is current build. In fact, it couldn't get much simpler, you only have to change the list of targets and just add your platforms specific code in platform specific folders under the src folder. No need to edit mk files, just as you are claiming.
really? Does this statement align with this:
exactly the design goal I have too. New platforms go in their own make file. There is no need for the user to edit any of the files in the makefiles/ folder unless improving the overall build system, e.g. adding a new platform or compiler
Did that warrant ignoring the other build and writing your own? At the moment, most users simply update the version string of the fujinet-lib they wish to use. Those developing against fujinet-lib already have a mechanism for copying a lib being created locally, you've added some bells and whistles to that same mechanism.
The current build also has all these points in mind. The user simply sets their target list, the lib version they want, and puts their src in the folder structures to support multi-target, within target, or standalone systems. My issue here is you're introducing another fragmentation. as xkcd observed https://xkcd.com/927/ This is a continuation of you creating something new rather than actually extending or improving on things that already exist. |
|
Waiting to hear about about the Makefiles- either it's one single makefile or it's a collection of them. If this is more than one, it's no better (just different) than the existing one- of which I personally enjoy using and have adpated at least 3 apps to use it (while pulling them out of the dreaded fujinet-apps repo/graveyard). So unless this really does move the ball forward and can be shown to make life easier for more than just one person, it should be rejected, and positive aspects of this PR (like the more flexible fn-lib targeting) should just be moved into the existing system as new features we all can use. |
Until someone is actually going to look at it and stop dismissing it out of hand with "well, we had a
As another experiment I converted the news app to use this and all of the different platforms are using these makefiles, including Atari Pascal: https://github.com/FozzTexx/fujinet-news/tree/feature/MekkoGX/clients Maybe someone would like to try converting weather?
I would love to do that, but I’ll need some assistance on how to incrementally upgrade fujinet-build-tools. As has been noted before, sometimes starting on a “green field” is the only way to experiment and validate a new approach, which naturally makes integration more challenging. Let's also keep in mind that this project doesn't use the fujinet-build-tools at all, which is why it seemed like a good place to make this change. |
|
Ok, I think you set a fair challenge converting the news app for clients, which I spent the last couple of hours doing to challenge myself to see how much effort it would be. I did all the same things as you, moving src into its own src/ folders in some projects. Whereas you've gone for clients/src/, I defaulted to clients/common + clients/platform, as to me clients/ is the exception in projects I've been trying to build, where they mostly share common source, using fujinet-lib. I copied in the makefiles, and created the top level Makefile, and set the target list in it. I was able to build apple2 pretty much immediately. Where the build-tools based project fell short was compiling atari. So I thought, how would I integrate it into build-tools? Then I realised, why should I even try? I also realised how many differences there still are inherent in the different versions of the build-tools versions; one supports multiple compilers, some of them have slightly different folder structures. It was a lot messier than I remember. So, I'm retracting my objection. I didn't look into how you handle shared folders so that you can have something like a single commodore folder and only differences held separately into c16/c64 folders, but I doubt you haven't thought of it. mostly ifdefs are good enough anyway. |
That's the
Which I put as one of the examples in
That could be done too. In fact, I could have largely left the source where it was as
I ... was not happy about this, but I could see no other way. I was shocked to discover Mad-Pascal doesn't work with .o files or a linker. The script is a fairly simple wrapper for Mad-Pascal. I figured it was best to get it working with a Python wrapper first before tackling making it a shell script, or possibly an inline shell script in the .mk file itself. The way I made it work was to treat Mad-Pascal as the linker rather than a compiler, and once I did that, it fit into the toolchain abstraction (other than needing a wrapper).
FYI, as I add extra platforms (and fix bugs), I simply copy the entire |
abcf08e to
5fcd5e0
Compare
5fcd5e0 to
08337bc
Compare

Draft PR to review concept, do not merge!Why I'm doing this now: I’m working on the MSX bring-up, and the old system means dropping yet another huge platform Makefile into the root. Mostly boilerplate, not fun to maintain, feels like clutter.
The biggest win here is having everything in a single, easy-to-read Makefile. Instead of a dozen (or more) platform-specific Makefiles scattered around, there’s just one main Makefile to look at. All per-platform tweaks (C64, CoCo, Apple II, Atari, and even the MSX stuff I’m working on) are visible right there, clear and explicit.
The
makefiles/directory handles all the messy boilerplate behind the scenes. Less-experienced developers don’t need to touch those files at all. Everything they need is explicit in the top-levelMakefile. (One Makefile to rule them all!)A concrete example: when Rich tried to get CoCo working with FUJINET_LIB, the old Makefile had no concept of it. He had to find the right spot in Makefile.coco, figure out what boilerplate to copy from which other Makefile, and troubleshoot download and linking issues. With this new structure, it’s trivial: if FUJINET_LIB points to a version built for the platform, the Makefile automatically sets up all the compiler and linker flags needed to use it.
Other nice touches: everything that is created/downloaded during build ends up in one of three directories:
build,_cache, orr2r. Binaries and disk images end up in r2r (Ready 2 Run), you can swap FUJINET_LIB on the fly, and you can tweak a single build run by passing variables on the command line. This structure also includes the platform mapping feature in other FujiNet projects, exposed as aPLATFORM_COMBOSvariable in the main Makefile, letting platforms share source without duplication (such as Dragon using CoCo). Overall it just makes contributing much easier and less error-prone, especially for people who haven’t memorized all the quirks of each platform.Some highlights of what this change does:
makefiles/. That folder is just the engine running behind the scenes.makefiles/, so you don’t have to look there unless you really want to tweak the underlying system.This isn’t about reinventing the wheel. It’s about making the build process easier for everyone, whether you’ve been working on these platforms for years or are just getting started. You can run builds, swap libraries, or try out a new workflow without having to fight through a maze of copy-pasted Makefiles. And if you do need to tweak something, the structure is consistent, clear, and easy to reason about.
Do not merge!