Better handling of the -c -o problem. Thanks to Tim Rice <tim@trr.metro.NET> for the patch

This commit is contained in:
cls%seawood.org 1998-11-15 09:55:01 +00:00
Родитель c825d3d506
Коммит 1b81b77f64
1 изменённых файлов: 35 добавлений и 6 удалений

Просмотреть файл

@ -23,16 +23,45 @@ DASH_C=0
DASH_O=0 DASH_O=0
for i in $* for i in $*
do do
[ "${CHECK_O}" = yes ] && {
case $i in case $i in
-c) DASH_C=1;; ./*.o) i="" ;;
-o) DASH_O=1;; *.o) if [ $i = `basename $i` ]
*.c) C_SRC=$i;; then
*.s) S_SRC=$i;; i=""
*.o) OBJECT=$i;; else
OPTS="${OPTS} -o"
DASH_O=1
fi
;;
*) OPTS="${OPTS} -o $i"
DASH_O=1
i=""
;;
esac
CHECK_O=no
}
case $i in
-c) DASH_C=1
OPTS="${OPTS} -c"
;;
-o) CHECK_O=yes
;;
*.c) C_SRC=$i
OPTS="${OPTS} $i"
;;
*.s) S_SRC=$i
OPTS="${OPTS} $i"
;;
*.o) OBJECT=$i
OPTS="${OPTS} $i"
;;
*) OPTS="${OPTS} $i"
;;
esac esac
done done
cc $* || exit $? cc ${OPTS} || exit $?
# if there was no -c and -o we're done # if there was no -c and -o we're done
[ $DASH_C = 1 -a $DASH_O = 1 ] || exit 0 [ $DASH_C = 1 -a $DASH_O = 1 ] || exit 0