Saturday, March 28, 2009

hbloader

I got the following error while attempting to compile hbloader (a boot loader for the mc68hc11 Handy Board)
~/Desktop/hbloader-1.23 $ make m6811-elf-as -o hbtalker.elf hbtalker.s make: m6811-elf-as: Command not found make: *** [hbtalker.s19] Error 127
I am on Ubuntu 8.10, and have installed the m68hc11 gcc compiler packages available in the Universe repository; which was done using the following command.
sudo aptitude install gcc-m68hc1x gdb-m68hc1x newlib-m68hc1x
I noticed that the Ubuntu packages had slightly different names for the compiler. m68hc11-as versus m6811-elf-as which was used in the Makefile. New makefile is as follows.
all: SRecord.o S19Parser.o hbloader hbtalker.s19

SRecord.o: SRecord.hpp SRecord.cpp
g++ -c SRecord.cpp

S19Parser.o: S19Parser.hpp S19Parser.cpp
g++ -c S19Parser.cpp

hbloader: hbloader.cpp S19Parser.o SRecord.o
g++ -o hbloader hbloader.cpp S19Parser.o SRecord.o \
&& echo "Succesful build."


hbtalker.s19: hbtalker.s
m68hc11-as -o hbtalker.elf hbtalker.s
m68hc11-objcopy --only-section=.text --only-section=.rodata \
--only-section=.vectors --only-section=.data \
--output-target=srec hbtalker.elf hbtalker.s19 \

m68hc11-objcopy --only-section=.text --only-section=.rodata \
--only-section=.vectors --only-section=.data \
--output-target=binary hbtalker.elf hbtalker.b


clean:
rm -f *.o a.out *.core *.s19 *.elf *.o *.b *.rel *.lst hbloader

Man I haven't played with my 68HC11 Handy Board in so long; never did I try it on Linux before.