My choice was getting the SDCC toolchain working with Eclipse or dealing with makefiles. And I decided to go with makefiles. I sort of know how to use them–at least I know enough to know how they work and what they look like when they are correct. I just don’t know the details on the repurposed punctuation. There is nothing in software development quite as unelegant as make. Shell scripts and Perl are bad, but make… Ugh!

So, I’m starting to build up a makefile system. I have a top level one where I can do all my CFLAGS settings and pass them down.

My first problem was that sdcc.exe wasn’t finding my include files. I was getting the address with:

SW_DIR= $(shell pwd) INCLUDES=-I${SW_DIR}/drivers -I${SW_DIR}/app

I’m running this in cygwin, so the directory looks like /cygdrive/c/users/Mark/Documents/Projects/Z80/SW/

Well, it turns out, I need to pass a Windows style directory, so I updated SW_DIR to:

SW_DIR= $(shell pwd sed ‘s/\/cygdrive\/c\//C:\\/’ sed ‘s/\//\\/g’)

So that fixed that.

I’m on my way to having an actual compiled ihx.

I’ve decided to start dirt simple. Just direct access to the drivers without the C runtime. I’ll know it’s working because gets out of the box in the toolchain echoes the incoming characters. So if I turn off local echo on puTTY and see the characters I type, I’ll know. I’ll also output a string at the beginning.

….

And it compiles and links. Nothing is in the right place yet.  But getting closer…..

…..

Now that I’m trying to pass possibly correct values to the linker, it just sits there and does nothing… I have to ctrl-C out.

Grrrr…..