Difference between revisions of "Vim/makevim"
From RonWareWiki
< Vim
(New page: The script I use to build vim: <code sh> #!/bin/sh # setup: die() { echo $2 exit $1 } vimdir=~/proj/vim if [ ! -d $vimdir ]; then vimdir=/c/vim7 ; fi if [ ! -d $vimdir ]; then vimdi...) |
|||
Line 1: | Line 1: | ||
The script I use to build vim: | The script I use to build vim: | ||
− | <code | + | <code bash> |
#!/bin/sh | #!/bin/sh | ||
Revision as of 12:31, 24 April 2009
The script I use to build vim:
- !/bin/sh
- setup:
die()
{
echo $2
exit $1
}
vimdir=~/proj/vim
if [ ! -d $vimdir ]; then vimdir=/c/vim7 ; fi
if [ ! -d $vimdir ]; then vimdir=~/src/vim ; fi
if [ ! -d $vimdir ]
then
die 1 "Cannot determine the VIM directory. Please update script"
fi
rawos=`uname`
os="?"
if [ "$rawos" == "Darwin" ]; then os="Mac" ; fi
if [ "$rawos" == "Linux" ]; then os="Lin" ; fi
if [ "$os" == "?" ]
then
die 1 "I don't know what the OS ${rawos} is. Please update script"
fi
patches()
{
patchvim
}
clean()
{
echo "Cleaning previous VIM build"
pushd $vimdir
make distclean
popd
}
config()
{
cf="-O3 -s -fomit-frame-pointer -freg-struct-return -fmerge-all-constants"
echo "Configuring VIM"
pushd $vimdir
./configure --with-features=big --with-compiledby="ron@ronware.org" CFLAGS="$cf"\
2>&1 > config.log \
|| die 2 "Failed to configure. See config.log"
popd
}
build()
{
echo "Building VIM"
pushd $vimdir/src
make EXTRA_LIBS="-lsqlite3" \
2>&1 > ../make.log \
|| die 3 "Make failed. See make.log"
popd
}
install()
{
sudo make install
}
if [ "$1" == "-f" ]
then
clean
patches
config
build
install
exit 0
fi
if [ "$1" == "clean" ]
then
clean
exit 0
fi
patches
build
install