Compiling sdcc-m08 on Linux

There is a SDCC version for HC08 and HCS08 which generate better executable than mainline sdcc project, this is the sdcc-m08:

To compile it on Linux (since it was developed initally for Windows) execute:

$ find . -type f | xargs dos2unix
$ find . -type f | xargs sed -i 's/getline/get_line/'

Edit the files and ports.all renaming M08 to m08

Disable almost all ports, except m08-port:

$ ./configure --disable-mcs51-port --disable-gbz80-port --disable-z80-port --disable-avr-port --disable-ds390-port --disable-ds400-port --disable-pic-port --disable-pic16-port --disable-xa51-port --disable-ucsim

Then make it:

$ make

If everything goes fine you will get the file bin/sdcc.

That’s all folks!