GitXplorerGitXplorer
p

m68k-atari-mint-cross-tools

public
7 stars
4 forks
3 issues

Commits

List of commits on branch master.
Verified
172d14a6920cf08a31aa7dbe4f395b17de385827

Merge pull request #8 from pd95/add-github-actions

ppd95 committed a year ago
Unverified
3b13ad35e39038c0e6ed2bd4366d6b3061bfc987

Updated labels

ppd95 committed a year ago
Unverified
e309f9b1662854ac8d081668b9a7484a9c5276ab

Add step to install pre-requisites

ppd95 committed a year ago
Unverified
1f5c0e36dbc35b89adb6c027e61e91caee2dca2a

Make "all" again

ppd95 committed a year ago
Unverified
5dab35f73dfa38a239a0a689e468f2e80d555a8a

Remove asterisk from name

ppd95 committed a year ago
Unverified
a2f1e7493be08affb8c705aa054f511c65992896

Temporarily make test runs quicker

ppd95 committed a year ago

README

The README file for this repository.

m68k-atari-mint cross compiler scripts for macOS

This is a collection of Makefiles I'm using to build the m68k-atari-mint cross-compiler tools for macOS based on Vincent Rivières cross-tools description. The cross-compiler can be used to develop applications for the Atari ST and compatible systems. It is based on the works of the FreeMiNT project

The collection consists of the following:

Host tools:

  • GNU Binutils: assembler and linker
  • MiNTbin: supplemental MiNT specific tools for the GNU Binutils
  • GNU Compiler Collection (GCC): the C and C++ compiler, which depends on the following libraries:
    • GMP is the GNU Multiple Precision Arithmetic Library
    • MPFR is the GNU Multiple-precision floating-point rounding library, which depends on GMP.
    • MPC is the GNU Multiple-precision C library, which depends on GMP and MPFR.

Target libraries and applications:

  • MiNTLib which is the standard C library for FreeMiNT
  • PML, portable math library for C programs for FreeMiNT
  • GEMlib GEM bindings for writing GEM apps (=library to access AES and VDI layers)
  • CFLib GEM utility library (used by QED)
  • QED GEM text editor, a good test application to check the cross-compiler

Prerequisites

To use the Makefiles, you will have to install:

The scripts/Makefiles are automatically going to download the required sources and MiNT specific patches from Vincents page. For a few parts, I had to adjust the patches respectively write macOS specific patches. Those are stored in the archive folder.

GCC depends on three additional libraries (GMP, MPFR and MPC). As we want to statically link them to the compiler, they are also automatically built and stored in the gcclibs subfolder.

Goal

The goal of this package/bundle of scripts is to have a single command to build and install the whole cross-compiler tools.

The tools are installed in the /opt/cross-mint folder. You need administration rights to create this directory on your system.

Build

First, ensure that the /opt/cross-mint directory exists and is writable by your user.

To create the directory and take full ownership of it, you can use the following commands:

sudo mkdir -p /opt/cross-mint
sudo chown $USER /opt/cross-mint

To build and install the cross-compiler toolset, you should simply checkout this repository to a local folder and type make:

git clone https://github.com/pd95/m68k-atari-mint-cross-tools.git m68k-atari-mint
cd m68k-atari-mint
make

This will build and install the tool in /opt/cross-mint and will produce a "distribution package" in the packages directory.

Known problems

On older macOS versions (e.g. macOS Sierra 10.13) where the tar command is unable to extract bz2 or lz compressed files, you will encounter the error message tar: Unrecognized archive format while gcclibs is being executed.

To fix this you have to install gnu-tar and lzip using brew:

brew install gnu-tar lzip

Usage

To use the cross-compiler, you will have to add the compiler binary/manual pages location to your search path:

export PATH=$PATH:/opt/cross-mint/bin
export MANPATH=$MANPATH:/opt/cross-mint/share/man

Here is a primitive TOS program

hello.c:

#include <stdio.h>

int main(int argc, char* argv[])
{
    puts("Hello, world !");
    return 0;
}

It can be compiled with the command:

m68k-atari-mint-gcc hello.c -o hello.tos

Here is a simple AES test application:

alert.c:

#include <gem.h>

int main()
{
    appl_init();
    form_alert( 1, "[1][Hi there!][[Hi!|B[ye!]" );
    appl_exit();
    return 0;
}

which can be compiled with

m68k-atari-mint-gcc alert.c -lgem -o alert.prg