#!/bin/tcsh -ef
# RoBIOS batch file for gnu-68000-asm
# apapt the following path if necessary
# especially for HDT compilation
# ------------------------------

setenv gccdir   /user/res/uwarobot/g++-m68k/
setenv PATH     $gccdir/bin

setenv gccparts $gccdir/lib/gcc-lib/m68k-coff/2.95.2/
setenv libc     /user/res/uwarobot/libc/include/
setenv mc       /user/res/uwarobot/mc

# run gcc for a list of .c source files

foreach file ($*)
echo FILE $file
echo c-compiler
m68k-coff-gcc $file -B$gccparts -S -c -m68332 -O -I$mc/include -I$libc -W -Wall -ansi -pedantic -msoft-float

echo 68332-assembler
m68k-coff-as -o $file:r.o $file:r.s

echo linker
m68k-coff-ld -T$mc/ldfiles/robi-hdt.ld -o $file:r.l $file:r.o

echo obj-copy
m68k-coff-objcopy -O srec $file:r.l $file:r.hex
/bin/rm $file:r.o $file:r.l $file:r.s

echo " "
end
# end foreach

