minix/lib/float/FP.compile

21 lines
533 B
Text
Raw Normal View History

2005-04-21 16:53:53 +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.)
case $#:$1 in
1:*.c) ;;
*) echo "$0: $1: not a C file" >&2; exit 1
esac
base="`basename "$1" .c`"
trap 'rm -f tmp.s "$base.s"; exit 1' 2
cc -O -I. -D_MINIX -D_POSIX_SOURCE -S "$1" &&
mv "$base.s" tmp.s &&
sed -f FP.script tmp.s > "$base.s" &&
cc -c "$base.s" &&
rm tmp.s "$base.s"