pike.git/
NT/
tools/
rntcc
Branch:
Tag:
Non-build tags
All tags
No tags
1998-01-16
1998-01-16 21:44:50 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
09ca25edfacc66bdd4d4f2840e361f977163045b (
57
lines) (+
39
/-
18
)
[
Show
|
Annotate
]
Branch:
7.9
all new and improved
Rev: NT/tools/ar:1.4
Rev: NT/tools/lib:1.5
Rev: NT/tools/rntcc:1.7
8:
CFLAGS="" SOURCES="" OBJECTS=""
-
OUTPUT=
a.out
+
OUTPUT=
OPERATION=linking INCLUDE_PATH= LDOPTS="OPTION STACK=8m"
53:
CFLAGS="$CFLAGS -otexan" OPTIMIZE=yes ;;
-
*.c) SOURCES="$SOURCES $1" ;;
+
*.c
| *.s | *.S
) SOURCES="$SOURCES $1" ;;
*.o | *.a) OBJECTS="$OBJECTS $1" ;; -o) OUTPUT="$2" ; shift ;;
88:
LIBRARIES="$LIBRARIES LIBRARY $tmp" ;;
-
*)
+
-
*)
echo "Unrecognized option $1" exit 1 ;;
-
+
+
*)
+
SOURCES="$SOURCES $1"
+
;;
esac shift done
-
if [ x$DEBUG$OPTIMIZE = xyesyes ]; then
-
echo Debug and optimization not supported at the same time
-
exit 1
-
else
-
:
-
fi
+
#
if [ x$DEBUG$OPTIMIZE = xyesyes ]; then
+
#
echo Debug and optimization not supported at the same time
+
#
exit 1
+
#
else
+
#
:
+
#
fi
rm $OUTPUT 2>/dev/null 1>/dev/null || :
131:
CFLAGS="$CFLAGS -bm -zq -hw -fr$ERRORFILE"
-
if [ "
x$OUTPUT
" != x ]; then
-
OFLAGS="$OFLAGS -
fo$OUTPUT
"
+
+
compile() {
+
if [ "
x$2
" != x ]; then
+
OFLAGS="$OFLAGS -
fo$2
"
else
-
OFLAGS=
+
OFLAGS=
"$OFLAGS -fo`echo $1 | sed -e 's/\.[^.]$//'`.o"
fi
-
+
case $1 in
+
*.s | *.S)
+
do_cmd wasm -fe$ERRORFILE $OFLAGS `fixpath $1`
+
;;
+
+
*)
+
do_cmd $NTCC $CFLAGS $OFLAGS `fixpath $1`
+
;;
+
esac
+
}
+
case $OPERATION in compiling)
-
do_cmd
$NTCC $CFLAGS $OFLAGS `fixpath
$SOURCES
$OBJECTS`
+
compile
$SOURCES
$OUTPUT
TARGET=$OUTPUT ;; preprocessing)
-
do_cmd $NTCC -p $CFLAGS `fixpath $SOURCES`
+
silent_
do_cmd $NTCC -p $CFLAGS `fixpath $SOURCES`
;; linking) for a in `fixpath $SOURCES` do
-
BASE=`echo $a | sed -e 's/\.
c
//'`
-
do_cmd
$NTCC
-i$IPATH $CFLAGS -fo=
$BASE.obj
$a
+
BASE=`echo $a | sed -e 's/\.
[^.]$
//'`
+
compile
$a
$BASE.obj
OBJECTS="$OBJECTS $BASE.obj" done LDFILE=TMP$$.lk
-
+
if [ "x$OUTPUT" = "x" ]; then
+
OUTPUT=a.out
+
fi
echo "name $OUTPUT.exe $LDOPTS FIL `fixpath $OBJECTS | sed -e 's/ /,/g'` $LIBRARIES" >$LDFILE OK=`do_cmd wlink @$LDFILE | check_linker_error` if [ x$OK != xok ]; then