-
Notifications
You must be signed in to change notification settings - Fork 6
Mac OS Makefile support #34
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
Conversation
@@ -14,6 +14,8 @@ pkgdir = $(libdir)/pkgconfig | |||
|
|||
export prefix includedir libdir | |||
|
|||
BUILD_SYSTEM := $(shell uname -s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... HOST_SYSTEM
would probably be somewhat more appropriate, considering its main use. Or maybe we should have both BUILD_SYSTEM
and HOST_SYSTEM
. The difference between the two is relevant when cross compiling, but maybe Mac users generally won’t care about such things anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmhmm... Mac users may still want to build the TOS binaries right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm... There are two TOS programs:
lib/tos/tos
which is compiled to m68k machine code fromlib/tos/reset.S
andlib/tos/sndh.c
. This is the SNDH player running inside the PSG play emulator, primarily to configure timer interrupts and invokinginit
andplay
trampolines in the SNDH. However, I’ve commited a precompiledtos
file in the Git repo, so unless any of the two source files are updated, it doesn’t need to be cross-compiled.PSGPLAY.TOS
is the Atari ST variant of PSG play. Running the exact same interactive text mode as on Linux and Mac OS. Someday I’d like to make a GEM version too, for both Atari ST and X Windows in Linux. :-)
Well, the adventurous Mac user will have to compile an m68k-elf-gcc
cross-compiler first, and then try:
Lines 53 to 55 in 7677952
Build for the Atari ST: | |
$ make TARGET_COMPILE=m68k-elf- PSGPLAY.TOS |
I’ve made a Docker with an m68k cross-compiler in the gentoo-m68k
repo, mostly for its use in the Github workflow that compiles PSGPLAY.TOS
:
psgplay/.github/workflows/compilation.yml
Lines 9 to 11 in 7677952
build-atari-st: | |
runs-on: ubuntu-latest | |
container: ghcr.io/frno7/gentoo-m68k:main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see if I can scrounge up the adventurism for it one of these days, but meanwhile back in the real world there is Linux :) I did a docker setup once too, based on Vincent's excellent work and vasm/vbcc/vlink but in the end I enjoy m68k the most so the C-compilers have not been getting much use for quite a few years. Rethinking that right now - C turns out to be fun again :)
Anyway, patches can always be added later right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see if I can scrounge up the adventurism for it one of these days, but meanwhile back in the real world there is Linux :) I did a docker setup once too, based on Vincent's excellent work and vasm/vbcc/vlink
Oh, based on MINT, with a patched C compiler having 16 bits int
? I suppose the main difference is that I’m using a standard (unpatched) m68k/GCC compiler as it comes directly from GNU. That’s a 32-bit compiler, so I made my own TOS/libc that works with 32 bits int
despite TOS being 16 bits. :-)
but in the end I enjoy m68k the most so the C-compilers have not been getting much use for quite a few years. Rethinking that right now - C turns out to be fun again :)
Yeah, C is fairly close to assembly code, and much less tedious, to my mind. :-)
Anyway, patches can always be added later right?
Patches for cross-compilation on Mac OS? Sure, if we can make it work cleanly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Sequoia/Apple Clang and it works like a charm - very nice touch with the libtool! Will figure out the Homebrew bits in the build scripts, which makes a lot of sense, as some people still prefer MacPorts or other solutions - and some are perhaps even content with XCode...
Great, thanks! script/compile (currently) has a single |
|
Admittedly, I haven’t put much thought into it. :-) But yeah, the most important thing, I think, is to keep the Makefiles as tidy as we can, and lift hardcoded and convenience stuff outside in scripts. I don’t known if |
Yup. I'll hack something up later in another branch/PR and then you can dissect it in any way you see fit. Hopefully you are enjoying this too :) |
Does Mac OS has something similar to package scripts? Examples:
|
Homebrew has formulae and is afaik the most common way of having a real Unix-like experience on macOS. It can be installed on Linux too. I will make such a Formula, it can be hosted decentralized (on github for example). MacPorts has something similar to the BSD port trees. I used that a long time ago, but I now prefer the more GNU/Linux like experience of Homebrew. Other people may disagree, macOS userland is originally based on BSD (and Next), but I really see no reason to go back...
I rock Arch on my x86_64 machines - so I will pull that AUR :) Gentoo brings back fond memories but it's been a while!
No doubt. Both solutions can provide both binary and source builds, and the source builds are especially useful considering Apple's shift to signed software and the notarization system (which has a $99 yearly price tag on the certificate) |
Great!
I just added a link in
Cross-compilation with Gentoo is awesome, I think. With its I’ve merged to the |
Thanks alot! Moving on to the next one. |
No description provided.