Let's start the new forum with some basic tools. Here's a good toolchain that is still being maintained. You can compile it from source for linux with little trouble, but I suggest getting the binaries for Windows - it's a chore to compile for Windows.
Okay, let's start with the toolchain's project page:http://code.google.com/p/snes-sdk/
For Windows, download the binaries here (from UnDisbeliever):http://undisbeliever.snesdev.net/snes-sdk.zip
For linux, start by getting a copy of the repository code:
svn checkout http://snes-sdk.googlecode.com/svn/trunk/ snes-sdk
After that, you need to edit some files. First is the file is "snes-sdk/libs/Makefile" - change the line
../tcc-65816/816-tcc $(CFLAGS) -I. -o $@ -c $<
../tcc-65816/816-tcc $(CFLAGS) -I. -I../tcc-65816/include -o $@ -c $<
Otherwise, the compile fails while trying to compile malloc.c for libc. If you don't wish to compile the SNES9X emulation bundled with the toolchain, change the line
If you're like me, you don't care for toolchains that install to /usr/local/. Why? Mainly because anytime you update your distro, you have to reinstall all your toolchains. Instead, I install my toolchains to a Tools directory in my home directory. If you wish to do the same, change two more files: "snes-sdk/Makefile" and ""snes-sdk/snesc/Makefile". In both, just change the "PREFIX" variable to
PREFIX = $(HOME)/Tools/snes-sdk
or wherever you want to put the toolchain where you have full permissions. Now you should edit the makefile for the snesc example. After the LIBDIR variable, add this line:
and then change
$(CC) $(CFLAGS) -I. -o $@ -c $<
$(CC) $(CFLAGS) -I. -I$(INCDIR) -o $@ -c $<
You might also change the emulator used to run the example, or comment out the line that runs the emulator altogether.
You are now ready to make and install the emulator.
Remember that if you left the prefix set to /usr/local, you need to do "sudo make install" or you won't have permission to install.
Then make the example program as a test.
If you left its makefile set to run the rom in an emulator, it should now be playing. This example also works fine on real hardware with the Neo Myth.
Now you have a pretty nice C toolchain for the SNES!