Personal tools

CrossCompiler

From Wij vertrouwen stemcomputers niet

The cross compiler

In order to build our own software for the nedap, we need to create a 68000 cross compiler.

[this] page was helpful solving a compiler problem with gcc.

Below is my build script:

#!/bin/sh

#   check for presence of 'perl', 'make', 'm4', 'patch', 'gcc', 'flex', 'bison'
if which find perl m4 make patch gcc bash flex bison tar sed 2>&1| grep not; then
    echo please install the missing packages in cygwin
    exit 1
fi
target=m68k-nedap-coff
#binutils=binutils-2.17.tar.bz2
#gcccore=gcc-core-4.1.1.tar.bz2
binutils=binutils-2.16.1.tar.bz2
gcccore=gcc-core-3.4.6.tar.bz2

# check for presence of the needed archives
if  ls $binutils $gcccore  >/dev/null; then
    echo all files found
else
    echo please copy the missing file to the current directory
    exit 1
fi

echo `date` untarring binutils
tar jxf $binutils || { echo `date` error ; exit 1 ; }
echo `date` configuring binutils
pushd `basename $binutils .tar.bz2`
export CFLAGS="-O2" 
bash configure --disable-nls --target=$target || { echo `date` error ; popd ; exit 1 ; }
echo `date` building binutils
make || { echo `date` error ; popd ; exit 1 ; }
echo `date` installing binutils
make install || { echo `date` error ; popd ; exit 1 ; }
popd

echo `date` untarring gcc
tar jxf $gcccore || { echo `date` error ; exit 1 ; }
echo `date` configuring gcc
pushd `basename $gcccore .tar.bz2|sed -e s/-core//`
sed -i.bak -e 's/\/m68040//' gcc/config/m68k/t-m68kbare gcc/config/m68k/t-m68kelf gcc/config/m68k/t-rtems
export CFLAGS="-O2" 
bash configure --disable-nls --target=$target || { echo `date` error ; popd ; exit 1 ; }
echo `date` building gcc
make || { echo `date` error ; popd ; exit 1 ; }
echo `date` installing gcc
make install || { echo `date` error ; popd ; exit 1 ; }
popd

Building newlib:

$ ./configure --target=m68k-nedap-coff --disable-multilib
$ make
$ make clean
$ find . -name Makefile|xargs perl -pi -e 's/-O2/-O2 -m68000/g;'
$ make install

I created a tar with all the nescesary files from cygwin.

and a test project, ... which i have not actually tried on the machine yet.

Here's a tar of the "newlib" embedded C library:

68000 simulators

I think mame contains the most extensive emulator framework, where it should not be difficult to add Nedap hardware emulation.

opennedap source code

Wij