forked from uncrustify/uncrustify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_win32.sh
57 lines (44 loc) · 1.31 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
#! /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.
#
# This is the prefix for the mingw32 build
HOST_PREFIX=i686-w64-mingw32
echo "Configuring for Win32 build..."
./configure --host=$HOST_PREFIX CXXFLAGS="-I../win32 -static"
# build the version string from git
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'`
THISDIR=$PWD
RELDIR=../release
if ! [ -e $RELDIR ] ; then
mkdir -p $RELDIR
fi
# convert RELDIR to an absolute path
cd $RELDIR
RELDIR=$PWD
cd $THISDIR
VERDIR=$RELDIR/uncrustify-$VERSION-win32
THEZIP=$RELDIR/$(basename $VERDIR).zip
echo
echo "Building version $VERSION for Win32"
make clean
make
if [ -e $VERDIR ] ; then
rm -rf $VERDIR
fi
mkdir $VERDIR $VERDIR/cfg $VERDIR/doc
cp 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 $RELDIR
zip -r9 $THEZIP $(basename $VERDIR)/*
cd $THISDIR
echo "Stored in $THEZIP"