Home

Awesome

Marsdev

Cross-platform Sega Mega Drive / Super 32X / Sharp X68000 toolchain.

English | 日本語

Compile & Install

1. Dependencies

Install the following packages, depending on your operating system:

2. GCC Toolchain

Clone the repo:


NOTE

There are two variables that control which directory Marsdev is built and installed:

If you wish to change the location of either, use an export command like this:


You have 2 options for building GCC:

For 32X, the sh toolchain must also be built. The options are the same, swapping out m68k in the commands above with sh.

3. (Optional) SGDK

SGDK requires Java, so Install it.


Note for macOS

OpenJDK needs to be added to the PATH.


Build SGDK:

A specific version of SGDK can be specified with SGDK_VER=<git tag>, but I cannot guarantee versions other than the default to work. Adventurous people who want to test the latest changes can specify SGDK_VER=master too.

4. (Optional) Other Tools

The following targets are also available:

5. Install

Just run sudo make install. Remember the path to the environment setup script, and consider adding it to your ~/.bashrc (or ~/.zshrc).

Examples

The examples directory contains various skeleton/example projects to base others on. For more information on each read examples/README.md.

Should be as easy as a make for any of them.

Occasionally Asked Questions

Can I build a Gendev project with Marsdev or vice-versa?

Not easily. You'll need to mess with the Makefile to get it working. Start by comparing your current Makefile to one of the example projects. The Migration document may be helpful here.

How can I tell if an issue I'm having with SGDK is caused by Marsdev?

It should be possible to compile your project as-is with an official SGDK release. The included Makefile is just a wrapper for make -f $GDK/makefile.gen.

If the issue persists, it's SGDK's fault. If the issue is fixed, it's Marsdev's fault.

How do I use this with my favorite IDE?

There are so many of these, and they all have different places you have to go to configure paths. In general the only thing you should NEED to do, is point it to the headers.

If your IDE lets you configure what the build/run buttons do, just have it run something like this.

What about Windows?

I highly recommend using WSL and follow the instructions for Debian. You could also try using the Dockerfile, although that is contributed by others and I don't test it myself. I used to use MSYS2, but how slow and clunky it is can not be overstated.

An addendum, if you are just here to use SGDK and don't use Linux or macOS then I think Marsdev will be of little benefit to you anyway.

I don't like installing to /opt. I want the old ~/mars way back

That's easy.

  1. export MARS_BUILD_DIR=${HOME}/mars
  2. Do steps 1 - 4 normally
  3. Skip the installation step, instead add to your ~/.bashrc:
export MARSDEV=${HOME}/mars
export GDK=${MARSDEV}/m68k-elf

This takes so long to compile!

GCC is a big boy, so we just have to be patient.

Things to do