#!/bin/sh -
. RELEASE
BUILDDIR=../build_win32
SRCFILES=srcfiles.in
create_dsp()
{
projname="$1" match="$2" sources="$3" dsptemplate="$4" srctemplate="$5"
dspoutput=$BUILDDIR/$projname.dsp
rm -f $dspoutput.insert
for srcpath in `egrep "$match" $sources | sed -e 's/[ ].*//'`
do
set - `echo $srcpath | sed -e 's;\(.*\)/;../\\1 ;' \
-e 's;../build_win32;.;' \
-e 's;/;\\\\\\\\;g'`
srcdir="$1"
srcfile="$2"
sed -e "s/@srcdir@/$srcdir/g" \
-e "s/@srcfile@/$srcfile/g" \
< $srctemplate >> $dspoutput.insert
done
sed -e "/@SOURCE_FILES@/r$dspoutput.insert" \
-e "/@SOURCE_FILES@/d" \
-e "s/@project_name@/$projname/g" \
-e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
-e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \
< $dsptemplate > $dspoutput.new
cmp $dspoutput.new $dspoutput > /dev/null 2>&1 ||
(echo "Building $dspoutput" && rm -f $dspoutput &&
cp $dspoutput.new $dspoutput && chmod 664 $dspoutput)
rm -f $dspoutput.insert $dspoutput.new
}
TMPA=/tmp/swin32dsp$$a
trap "rm -f $TMPA; exit 1" 1 2 3 15
sed -e "s/#.*$//" \
-e "/^[ ]*$/d" \
-e "s/[ ][ ]*/ /" \
-e "s/[ ]*$//" \
-e "/[ ]/!d" \
-e "s/$/ /" < $SRCFILES > $TMPA
MODULES="`sed -e 's/^[^ ]* //' < $TMPA \
| tr ' ' '\012' | sort | uniq`"
for module in $MODULES
do
case "$module" in
dynamic )
create_dsp db_dll " $module " $TMPA \
$BUILDDIR/dynamic_dsp.src $BUILDDIR/srcfile_dsp.src
;;
small )
create_dsp db_small " $module " $TMPA \
$BUILDDIR/small_dsp.src $BUILDDIR/srcfile_dsp.src
;;
static )
create_dsp db_static " $module " $TMPA \
$BUILDDIR/static_dsp.src $BUILDDIR/srcfile_dsp.src
;;
java )
create_dsp db_java " $module " $TMPA \
$BUILDDIR/java_dsp.src $BUILDDIR/srcfile_dsp.src
;;
tcl )
create_dsp db_tcl " $module " $TMPA \
$BUILDDIR/tcl_dsp.src $BUILDDIR/srcfile_dsp.src
;;
testutil )
create_dsp db_test " $module " $TMPA \
$BUILDDIR/db_test.src $BUILDDIR/srcfile_dsp.src
;;
app=* )
appname=`echo $module | sed -e 's/^app=//'`
if [ -f $BUILDDIR/$appname.src ] ; then
srcname=$BUILDDIR/$appname.src
else
srcname=$BUILDDIR/app_dsp.src
fi
create_dsp $appname " $module " $TMPA \
$srcname $BUILDDIR/srcfile_dsp.src
;;
vx )
;;
* )
echo "s_win32_dsp: module name $module in $SRCFILES is unknown type"
;;
esac
done
rm -f $TMPA