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
# 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
CC=gcc
CXX=gcc
CFLAGS="@PIC@ -O"
# These are used for linking...
@ -28,7 +29,8 @@ LD=gcc
LDFLAGS="@SHARED@"
LDLIBS=-lvpi
SRC=
CCSRC=
CXSRC=
OBJ=
LIB=
OUT=
@ -42,12 +44,18 @@ do
case $parm
in
*.c) SRC="$SRC $parm"
*.c) CCSRC="$SRC $parm"
if [ x$OUT = x ]; then
OUT=`basename $parm .c`
fi
;;
*.cc) CXSRC="$SRC $parm"
if [ x$OUT = x ]; then
OUT=`basename $parm .cc`
fi
;;
*.o) OBJ="$OBJ $parm"
if [ x$OUT = x ]; then
OUT=`basename $parm .o`
@ -71,7 +79,7 @@ OUT=$OUT".vpi"
# Compile all the source files into object files
for src
in $SRC
in $CCSRC
do
base=`basename $src .c`
obj=$base".o"
@ -81,5 +89,16 @@ do
OBJ="$OBJ $obj"
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..."
$LD -o $OUT $LDFLAGS $OBJ $LDLIBS