aboutsummaryrefslogtreecommitdiff
path: root/examples/mswin-build/mkprerelease
blob: 1cace46a35de40369500bf84c57feb66b9f75bd5 (plain)
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
#!/bin/sh
#
# Build busybox prerelease binaries
#
TARGETS="build_pre_32 build_pre_64 build_pre_64u"

# If an argument is supplied it overrides the default source directory.
SRC=busybox-w32
if [ $# -eq 1 ]
then
	SRC=$1
fi

if [ ! -d $SRC ]
then
	echo "$SRC doesn't exist"
	exit 0
fi

# remove old and make new build directories
for i in $TARGETS
do
	rm -rf $i
	cp -rp $SRC $i
done

# apply default configuration
for i in $TARGETS
do
	if [ $i = "build_pre_64" ]
	then
		CONFIG=mingw64_defconfig
	elif [ $i = "build_pre_64u" ]
	then
		CONFIG=mingw64u_defconfig
	elif [ $i = "build_pre_32" ]
	then
		CONFIG=mingw32_defconfig
	fi

	(cd $i; git checkout master; make ${CONFIG})
done

# perform build
for i in $TARGETS
do
	BITS=64
	if [ $i = "build_pre_32" ]
	then
		BITS=32;
	fi

	(
	cd $i
	GCCV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-gcc)
	CRTV=$(rpm -q --qf '%{name} %{version}-%{release}\n' mingw${BITS}-crt)
	make -j $(nproc) EXTRAVERSION="-$(git describe --match=FRP | sed 's/FRP/PRE/')" MINGW_VER="$GCCV; $CRTV"
	)
done