2002-04-09 22:55:38 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2002-04-16 11:24:41 +08:00
|
|
|
TOPDIR=$1
|
|
|
|
INST_LIBS=$2
|
|
|
|
INST_INCLUDE=$3
|
|
|
|
INST_SRC=$4
|
|
|
|
INST_DEMO_SRC=$5
|
|
|
|
INSTALLCMD=$6
|
|
|
|
COMPILER=$7
|
|
|
|
OPTF=$8
|
2002-04-09 22:55:38 +08:00
|
|
|
shift; shift; shift; shift; shift; shift; shift; shift;
|
2002-04-16 11:24:41 +08:00
|
|
|
DEPARG=$1
|
|
|
|
LINKARGS=$2
|
|
|
|
OSG_LIBS=$3
|
|
|
|
FREETYPE_LIB=$4
|
|
|
|
GLUT_LIB=$5
|
|
|
|
GL_LIBS=$6
|
|
|
|
X_LIBS=$7
|
|
|
|
SOCKET_LIBS=$8
|
|
|
|
shift; shift; shift; shift; shift; shift; shift; shift;
|
|
|
|
OTHER_LIBS=$1
|
|
|
|
TIFF_LIB=$2
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
copy_demo_source()
|
|
|
|
{
|
2002-04-16 11:24:41 +08:00
|
|
|
for d in `ls $TOPDIR/src/Demos/ | grep -v CVS`
|
|
|
|
do
|
|
|
|
if [ -d $TOPDIR/src/Demos/$d ]
|
|
|
|
then
|
|
|
|
THISDIR=`pwd`
|
|
|
|
cd $TOPDIR/src/Demos/$d
|
|
|
|
[ -d $INST_DEMO_SRC/$d ] || mkdir -m 0755 -p $INST_DEMO_SRC/$d
|
|
|
|
for f in `gmake __instfiles | grep -v make `
|
|
|
|
do
|
|
|
|
src=`echo $f | cut -f1 -d"="`
|
|
|
|
dst=`echo $f | cut -f2 -d"="`
|
|
|
|
if [ -z "$dst" ] ; then dst=$src; fi
|
|
|
|
echo $INSTALLCMD `pwd`/$src $INST_DEMO_SRC/$d/$dst
|
|
|
|
$INSTALLCMD `pwd`/$src $INST_DEMO_SRC/$d/$dst
|
|
|
|
done
|
|
|
|
cd $THISDIR
|
|
|
|
fi
|
2002-04-09 22:55:38 +08:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
generate_makedefs()
|
|
|
|
{
|
2002-04-09 23:51:20 +08:00
|
|
|
cat <<-EOF
|
2002-04-16 11:24:41 +08:00
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
TOPDIR ?= ../
|
|
|
|
THISDIR = .
|
|
|
|
INC = -I$INST_INCLUDE -I./
|
|
|
|
DEF = $DEF
|
2002-04-16 11:24:41 +08:00
|
|
|
CXXFLAGS = \$(ARCHARGS) $OPTF \$(DEF) \$(INC)
|
|
|
|
LDFLAGS = \$(ARCHARGS) $OPTF -L$INST_LIBS $LINKARGS
|
|
|
|
OBJS = \$(C++FILES:.cpp=.o) \$(CXXFILES:.cpp=.o) \$(CFILES:.c=.o)
|
|
|
|
C++ = $COMPILER
|
|
|
|
OSG_LIBS = $OSG_LIBS
|
|
|
|
FREETYPE_LIB = $FREETYPE_LIB
|
|
|
|
GLUT_LIB = $GLUT_LIB
|
|
|
|
GL_LIBS = $GL_LIBS
|
|
|
|
X_LIBS = $X_LIBS
|
|
|
|
SOCKET_LIBS = $SOCKET_LIBS
|
|
|
|
OTHER_LIBS = $OTHER_LIBS
|
|
|
|
TIFF_LIB = $TIFF_LIB
|
2002-04-09 22:55:38 +08:00
|
|
|
VPATH = ..
|
2002-04-16 11:24:41 +08:00
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-04-16 11:24:41 +08:00
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
generate_makerules()
|
|
|
|
{
|
2002-04-09 23:51:20 +08:00
|
|
|
cat <<-EOF1 | sed 's/TAB/ /'
|
2002-04-09 22:55:38 +08:00
|
|
|
|
2002-04-16 11:24:41 +08:00
|
|
|
all : \$(EXEC) \$(LIB) \$(PLUGIN)
|
2002-04-09 22:55:38 +08:00
|
|
|
|
2002-04-16 11:24:41 +08:00
|
|
|
\$(EXEC) : Makedepend \$(OBJS)
|
|
|
|
TAB\$(C++) \$(LDFLAGS) \$(OBJS) \$(LIBS) -o \$@
|
2002-04-09 22:55:38 +08:00
|
|
|
|
2002-04-16 11:24:41 +08:00
|
|
|
\$(LIB) \$(PLUGIN) : \$(OBJS)
|
|
|
|
TAB\$(C++) \$(LDFLAGS) \$(SHARED) \$(OBJS) \$(LIBS) -o \$@
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
clean :
|
2002-04-16 11:24:41 +08:00
|
|
|
TABrm -f \$(OBJS) \$(MAKEDEPEND)
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
clobber : clean
|
2002-04-16 11:24:41 +08:00
|
|
|
TABrm -f \$(EXEC) \$(LIB) \$(PLUGIN)
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
|
2002-04-16 11:24:41 +08:00
|
|
|
Makedepend : \$(CXXFILES) \$(CFILES)
|
|
|
|
TAB\$(C++) \$(INC) $DEPARG \$? > \$@
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
.SUFFIXES: .cpp .o
|
|
|
|
.cpp.o:
|
2002-04-16 11:24:41 +08:00
|
|
|
TAB\$(C++) \$(CXXFLAGS) -c $<
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
sinclude Makedepend
|
|
|
|
|
|
|
|
EOF1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[ -d $INST_SRC/Make ] || mkdir -m 0755 -p $INST_SRC/Make
|
|
|
|
|
|
|
|
echo =========== Installing Demo Source Code =================
|
|
|
|
|
2002-04-16 11:24:41 +08:00
|
|
|
echo " generating make files ..."
|
2002-04-09 23:51:20 +08:00
|
|
|
generate_makedefs > $INST_SRC/Make/makedefs
|
|
|
|
generate_makerules > $INST_SRC/Make/makerules
|
2002-04-09 22:55:38 +08:00
|
|
|
|
|
|
|
echo " copying demo files ..."
|
|
|
|
copy_demo_source
|
|
|
|
|
|
|
|
exit 0
|