Friday, July 15, 2005

So a while back I found this really cool compiler called SDCC. It is an open-source C compiler for several different microcontrollers (including the Microchip PIC, one of my personal favorites).

Anyway they just made a new release a little while ago, which is good. But it is difficult to get it up and running for PIC processors on Windows. So I put together the steps I had to go through to get it up and running on a Windows machine using Cygwin. This needs to be fleshed out and made a bit clearer, but at least I've got something...

-install gputils and Cygwin. Make sure to install "make" with your Cygwin install.

-download win32 version of sdcc and main (uncompiled) version of sdcc

-unzip main version of sdcc to a temp location and copy all files and folders to SDCC install directory

-must make these makefile changes to prevent gputils from segfault'ing
gplib -c $(LIB) gstack\\*.o

LOBJS = $(patsubst %,%\\*.o,$(DIRS))

LOBJS = $(patsubst %,%\\*.o,$(DIRS))

-also must change "" to "Makefile" in

-Script to create headers from inc files: 1) must have gptuils folder in C:\ 2) must have this script and installed in sdcc root directory

for file in $(ls /cygdrive/c/gputils/header/p*.inc)
export picstring=$(echo $file | sed "s/\/cygdrive\/c\/gputils\/header\/p//; s/.inc//")
../../ $picstring /cygdrive/c/gputils "pic$picstring.h"

No comments: