Setting up an Amiga Cross-Compiler (Windows) part 1

This is the Windows version, if you are running Linux or MacOS X, please check my other post about them here.

VBCC is an excellent compiler, still actively developed and supports multiple target platforms, including our favorite Amiga (and clones). While the procedure to get it installed on Linux/Mac is rather straightforward (you have to download the sources, then compile them), it can be a bit more tricky if you are on Windows. This post is meant to help with that, guiding through all the steps necessary to get your environment up and running with the minimum hassle.

The quick and easy approach

Since other people have gone through the same pain, it should be expected that someone has thought about simplifying the procedure and providing some shortcuts. Thanks to Erik Faye-Lund, you can find exactly that on Github: a package containing the latest pre-compiled binaries, along with the target platform and even the NDK and PosixLib packages included.

Set the “VBCC” environment variable to “C:\amiga-dev\targets\m68k-amigaos”.

Quite simple and straightforward, don’t you think?

Although the above “just works”, you can have more nerdy fun if you choose to compile everything from source yourself, potentially learning something along the way. If you are such a person, read on to the Advanced section below. Otherwise, you’re already good to go – write some code and experiment!

The advanced nerd approach

Some people like it easy. Some people prefer to go through the steps manually and fine-tune, learn and achieve that extra level of accomplishment once they get it to work. If you’re one of those people, this section is for you. 🙂

Requirements

A Windows compiler: Since we’ll be compiling the sources, we will need a compiler in our system. The recommended one is Visual Studio 2013 (even the free Community Edition is enough) or higher (tested up to VS 2017). It may work with older/newer versions as well of course, or even with other compilers – but you’ll have to experiment a bit on your own with that.

Windows SDK: the compiler will need some common C libraries to do it’s work on the sources, so we’ll need those. You can get the latest one for Windows 10 from here, but other versions should work as well.

An archiving tool that is able to decompress *.tar.gz files. I recommend 7-zip.

Your favorite text editor: Although Notepad will also work, I personally recommend the excellent Notepad++.

Once you’ve got the above installed and/or updated, it’s time to start having fun. Follow these steps:

VBCC

First of all, we need to download the sources package. You can get the current snapshot archive from here. If you want to read more information about it, you can visit the official website: http://www.compilers.de/vbcc.html

Extract the archive somewhere, e.g. to

C:\vbcc

Next comes our first challenge. The included Makefile will not work out-of-the-box on Windows, since it was designed for Linux/Mac platforms originally, using the GCC compiler. There are things in there that need to change before we can use it, such as paths using forward slashes (“/”) which Windows does not understand and instead expects with backslashes (“\”).

For your convenience, here’s a modified Makefile including all the changes below. If you prefer to do it manually regardless, read on. Otherwise, skip to the next section – Compiling VBCC.

Open the Makefile with your Text Editor, save a copy of it with a new name (e.g. “MakefileVS.mak”) and make the following changes in it:

If all goes well, you should see a list of messages scroll by (but no errors) and finally the operation completes successfully, resulting in the executable files in the “bin” directory. Pat yourself in the back, we’ve been through the most difficult part. 🙂

In the next post, we’ll prepare and compile VLINK and VASM as well, after which we’ll have all the pieces together. Then we need to setup our environment and configure some Target platforms, before we can create our fist program.