2
# $Id: s_win32_dsp,v 1.5 2001/05/27 14:03:33 bostic Exp $
4
# Build Windows/32 .dsp files.
8
BUILDDIR=../build_win32
13
projname="$1" # name of the .dsp file
14
match="$2" # the string used to egrep the $sources file
15
sources="$3" # a modified version of $SRCFILES to facilitate matches
16
dsptemplate="$4" # overall template file for the .dsp
17
srctemplate="$5" # template file for the src file fragments
19
dspoutput=$BUILDDIR/$projname.dsp
21
rm -f $dspoutput.insert
22
for srcpath in `egrep "$match" $sources | sed -e 's/[ ].*//'`
24
# take the path name and break it up, converting / to \\.
25
# so many backslashes needed because of shell quoting and
26
# sed quoting -- we'll end up with two backslashes for every
27
# forward slash, but we need that when feeding that to the
29
set - `echo $srcpath | sed -e 's;\(.*\)/;../\\1 ;' \
30
-e 's;../build_win32;.;' \
34
sed -e "s/@srcdir@/$srcdir/g" \
35
-e "s/@srcfile@/$srcfile/g" \
36
< $srctemplate >> $dspoutput.insert
38
sed -e "/@SOURCE_FILES@/r$dspoutput.insert" \
39
-e "/@SOURCE_FILES@/d" \
40
-e "s/@project_name@/$projname/g" \
41
-e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/g" \
42
-e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/g" \
43
< $dsptemplate > $dspoutput.new
44
cmp $dspoutput.new $dspoutput > /dev/null 2>&1 ||
45
(echo "Building $dspoutput" && rm -f $dspoutput &&
46
cp $dspoutput.new $dspoutput && chmod 444 $dspoutput)
47
rm -f $dspoutput.insert $dspoutput.new
50
TMPA=/tmp/swin32dsp$$a
51
trap "rm -f $TMPA; exit 1" 1 2 3 15
53
# create a copy of the srcfiles with comments and 'skip' lines removed.
54
# add a space at the end of each list of modules so that each module
55
# can be unambiguously matched e.g. ' dynamic '
62
-e "s/$/ /" < $SRCFILES > $TMPA
64
# get a list of all modules mentioned
66
MODULES="`sed -e 's/^[^ ]* //' < $TMPA \
67
| tr ' ' '\012' | sort | uniq`"
69
for module in $MODULES
73
create_dsp db_dll " $module " $TMPA \
74
$BUILDDIR/dynamic_dsp.src $BUILDDIR/srcfile_dsp.src
77
create_dsp db_java " $module " $TMPA \
78
$BUILDDIR/java_dsp.src $BUILDDIR/srcfile_dsp.src
81
create_dsp db_tcl " $module " $TMPA \
82
$BUILDDIR/tcl_dsp.src $BUILDDIR/srcfile_dsp.src
85
create_dsp db_test " $module " $TMPA \
86
$BUILDDIR/db_test.src $BUILDDIR/srcfile_dsp.src
89
create_dsp db_static " $module " $TMPA \
90
$BUILDDIR/static_dsp.src $BUILDDIR/srcfile_dsp.src
93
appname=`echo $module | sed -e 's/^app=//'`
94
create_dsp $appname " $module " $TMPA \
95
$BUILDDIR/app_dsp.src $BUILDDIR/srcfile_dsp.src
98
echo "s_win32_dsp: module name $module in $SRCFILES is unknown type"