From 4567e3c0e41376cff8eed8600a4c82aefd2c1868 Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Sun, 15 Nov 1998 09:55:01 +0000 Subject: [PATCH] Better handling of the -c -o problem. Thanks to Tim Rice for the patch --- build/hcc | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/build/hcc b/build/hcc index a08885e1428..1b6297c58ac 100755 --- a/build/hcc +++ b/build/hcc @@ -23,16 +23,45 @@ DASH_C=0 DASH_O=0 for i in $* do + [ "${CHECK_O}" = yes ] && { + case $i in + ./*.o) i="" ;; + *.o) if [ $i = `basename $i` ] + then + 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;; - -o) DASH_O=1;; - *.c) C_SRC=$i;; - *.s) S_SRC=$i;; - *.o) OBJECT=$i;; + -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 done -cc $* || exit $? +cc ${OPTS} || exit $? # if there was no -c and -o we're done [ $DASH_C = 1 -a $DASH_O = 1 ] || exit 0