27 lines
343 B
Bash
Executable File
27 lines
343 B
Bash
Executable File
#!/bin/bash
|
|
|
|
SRCDIR=$1
|
|
MAJOR=$2
|
|
MINOR=$3
|
|
BUG=$4
|
|
EXTRA=""
|
|
|
|
if [ "$5" == "y" ]; then
|
|
EXTRA="-debug"
|
|
fi
|
|
|
|
FILE=$SRCDIR/include/version.h
|
|
rm -f $FILE
|
|
cp $SRCDIR/scripts/version.tmpl $FILE
|
|
|
|
function replace
|
|
{
|
|
sed "s/$1/$2/" $FILE > $FILE.new
|
|
mv $FILE.new $FILE
|
|
}
|
|
|
|
replace AAAAA $MAJOR
|
|
replace BBBBB $MINOR
|
|
replace CCCCC $BUG
|
|
replace DDDDD $EXTRA
|