以下のFILEを揃えてmake&installしました。 http://ring.ip-kyoto.ad.jp/archives/GNU/gcc/gcc-2.95.2.tar.gz http://ring.ip-kyoto.ad.jp/archives/GNU/binutils/binutils-2.10.tar.gz ftp://sources.redhat.com/pub/newlib/newlib-1.8.2.tar.gz http://ring.ip-kyoto.ad.jp/archives/GNU/gdb/gdb-5.3.tar.gz http://mes.sourceforge.jp/h8/h8write.c # cd /usr/local/src/ # tar zxvf binutils-2.10.tar.gz # mkdir binutils-2.10/work # cd binutils-2.10/work # ../configure --target=sh-hms --prefix=/usr/cross/sh # make # make install # PATH=$PATH:/usr/cross/sh/bin # cd /usr/local/src/ # tar zxvf newlib-1.8.2.tar.gz # tar zxvf gcc-2.95.2.tar.gz # mkdir gcc-2.95.2/work # cd gcc-2.95.2/work # ../configure --target=sh-hms --prefix=/usr/cross/sh --with-newlib --with-headers=/usr/local/src/newlib-1.8.2/newlib/libc/include # make LANGUAGES="c" # make install LANGUAGES="c" # cd /usr/local/src/newlib-1.8.2 # mkdir work # cd work # ../configure --target=sh-hms --prefix=/usr/cross/sh # make # make install # cd /usr/local/src/ # tar zxvf gdb-5.3.tar.gz # mkdir gdb-5.3/work # cd gdb-5.3/work # ../configure --target=sh-hms --prefix=/usr/cross/sh # make # make install # cd /usr/local/src/ # mkdir h8write # cd h8write # cp /tmp/h8write.c . # gcc -O2 -o h8write h8write.c # cp h8write /usr/local/bin/後でシリアルポートを使用しますので、使用するデバイスのパーミッション設定を便宜設定して使用出来る様にしておきます。
$ PATH=$PATH:/usr/cross/sh/bin
hos-v4のdirに居るとする。
$ cd sample/akish2/stub/akish2/ $ makestubファイルが生成される。 以下のコマンドでCPUのFlashに書き込みをする。 (RS-232C経由での書き込みです。DIP-SW設定等は基板の取扱説明書を見てください)
$ make writeこれでstubがCPUのFlashに書き込まれました。
$ cd lib/sh/sh2gcc/ $ make -f h4sh2.mak $ cd ../../../config/ $ make -f gcc.mak $ cd ../sample/akish2/ $ make -f gcc.makakish2.outかakish2.motが生成出来る。
最初だけ、コンフィギュレーターとライブラリの整備の為にコンパイル処理をしますが、以降は、
$ cd ../sample/akish2/ $ make -f gcc.makの部分の範囲で開発をしていく事になります。
akish2.outかakish2.motのどちらが生成されるかはMakefile内の
RAM = trueの行が有効だとgdbでのDEBUGを対象にしたakish2.out迄が生成されますが、
RAM = trueの行が有効だとgdbでのDEBUGを対象にしたFILEとして生成されます。
$ sh-hms-gdbで開始出来ます。
# mkdir build-gdb-5.3/work # cd build-gdb-5.3/work ↓ # mkdir gdb-5.3/work # cd gdb-5.3/work