forked from uncrustify/uncrustify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_win32.sh
63 lines (48 loc) · 1.43 KB
/
make_win32.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /bin/sh
#
# Builds the 32-bit Windows release zip using mingw.
# Tested only on Ubuntu 14.04 x86_64 host.
# You'll need to install the "mingw-w64" package.
#
make distclean
# This is the prefix for the mingw32 build
HOST_PREFIX=i686-w64-mingw32
SRC_DIR=$PWD
cd ..
BLD_DIR=$PWD/build-$HOST_PREFIX
REL_DIR=$PWD/release
echo "Configuring for Win32 build..."
rm -rf $BLD_DIR
[ -d $BLD_DIR ] || mkdir $BLD_DIR
cd $BLD_DIR
$SRC_DIR/configure --srcdir=$SRC_DIR --host=$HOST_PREFIX CXXFLAGS="-I$SRC_DIR/win32 -static"
# build the version string from git
cd $SRC_DIR
python make_version.py > /dev/null
# extract the version from src/uncrustify_version.h...
VERSION=`grep '#define UNCRUSTIFY_VERSION ' src/uncrustify_version.h | \
sed -e "s/#define UNCRUSTIFY_VERSION//" -e 's/\"//g' -e 's/ //g'`
[ -d $REL_DIR ] || mkdir -p $REL_DIR
cd $SRC_DIR
VERDIR=$REL_DIR/uncrustify-$VERSION-win32
THEZIP=$REL_DIR/$(basename $VERDIR).zip
echo
echo "Building version $VERSION for Win32"
cd $BLD_DIR
make clean
make
cd $SRC_DIR
if [ -e $VERDIR ] ; then
rm -rf $VERDIR
fi
mkdir $VERDIR $VERDIR/cfg $VERDIR/doc
cp $BLD_DIR/src/uncrustify.exe $VERDIR/
cp README* BUGS ChangeLog $VERDIR/
cp etc/*.cfg $VERDIR/cfg/
cp documentation/htdocs/index.html $VERDIR/doc/
$HOST_PREFIX-strip $VERDIR/uncrustify.exe
[ -e $THEZIP ] && rm -f $THEZIP
cd $REL_DIR
zip -r9 $THEZIP $(basename $VERDIR)/*
cd $THISDIR
echo "Stored in $THEZIP"