Allow for C++ source files.

This commit is contained in:
steve 2002-05-10 03:54:46 +00:00
parent 88ae1b7b3c
commit c6a6f4bc79
1 changed files with 23 additions and 4 deletions

View File

@ -17,10 +17,11 @@
# 59 Temple Place - Suite 330 # 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA # Boston, MA 02111-1307, USA
# #
#ident "$Id: iverilog-vpi.sh,v 1.1 2002/04/07 00:47:10 steve Exp $" #ident "$Id: iverilog-vpi.sh,v 1.2 2002/05/10 03:54:46 steve Exp $"
# These are the variables used for compiling files # These are the variables used for compiling files
CC=gcc CC=gcc
CXX=gcc
CFLAGS="@PIC@ -O" CFLAGS="@PIC@ -O"
# These are used for linking... # These are used for linking...
@ -28,7 +29,8 @@ LD=gcc
LDFLAGS="@SHARED@" LDFLAGS="@SHARED@"
LDLIBS=-lvpi LDLIBS=-lvpi
SRC= CCSRC=
CXSRC=
OBJ= OBJ=
LIB= LIB=
OUT= OUT=
@ -42,12 +44,18 @@ do
case $parm case $parm
in in
*.c) SRC="$SRC $parm" *.c) CCSRC="$SRC $parm"
if [ x$OUT = x ]; then if [ x$OUT = x ]; then
OUT=`basename $parm .c` OUT=`basename $parm .c`
fi fi
;; ;;
*.cc) CXSRC="$SRC $parm"
if [ x$OUT = x ]; then
OUT=`basename $parm .cc`
fi
;;
*.o) OBJ="$OBJ $parm" *.o) OBJ="$OBJ $parm"
if [ x$OUT = x ]; then if [ x$OUT = x ]; then
OUT=`basename $parm .o` OUT=`basename $parm .o`
@ -71,7 +79,7 @@ OUT=$OUT".vpi"
# Compile all the source files into object files # Compile all the source files into object files
for src for src
in $SRC in $CCSRC
do do
base=`basename $src .c` base=`basename $src .c`
obj=$base".o" obj=$base".o"
@ -81,5 +89,16 @@ do
OBJ="$OBJ $obj" OBJ="$OBJ $obj"
done done
for src
in $CXSRC
do
base=`basename $src .cc`
obj=$base".o"
echo "Compiling $src..."
$CXX -c -o $obj $src
OBJ="$OBJ $obj"
done
echo "Making $OUT from $OBJ..." echo "Making $OUT from $OBJ..."
$LD -o $OUT $LDFLAGS $OBJ $LDLIBS $LD -o $OUT $LDFLAGS $OBJ $LDLIBS