2005-10-10 17:27:47 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Author: Kees J. Bot
|
|
|
|
# Compile one soft FP source file.
|
|
|
|
# (These files shouldn't be optimized normally, but the 16-bit C compiler
|
|
|
|
# only optimizes scratch register allocation a bit with -O. To the 32-bit
|
|
|
|
# compiler -O is a no-op.)
|
|
|
|
|
2006-01-16 16:44:55 +01:00
|
|
|
case $#:$2 in
|
|
|
|
2:*.fc) ;;
|
2005-10-10 17:27:47 +02:00
|
|
|
*) echo "$0: $1: not a FC file" >&2; exit 1
|
|
|
|
esac
|
|
|
|
|
2006-01-16 16:44:55 +01:00
|
|
|
dst=$1
|
|
|
|
src=$2
|
|
|
|
base="`basename "$src" .fc`"
|
2005-10-10 17:27:47 +02:00
|
|
|
trap 'rm -f tmp.c tmp.s"; exit 1' 2
|
|
|
|
|
2006-01-16 16:44:55 +01:00
|
|
|
cp "$src" tmp.c &&
|
2005-10-10 17:27:47 +02:00
|
|
|
cc -O -I. -D_MINIX -D_POSIX_SOURCE -S tmp.c &&
|
|
|
|
sed -f FP.script tmp.s > "$base.s" &&
|
2006-01-16 16:44:55 +01:00
|
|
|
cc -c -o $dst "$base.s" &&
|
2005-10-10 17:27:47 +02:00
|
|
|
rm tmp.c tmp.s
|