Skip to content

Commit 28128e8

Browse files
committed
Added script to build packages for Arduino
1 parent 074780d commit 28128e8

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

arduino/make_package.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
if [[ ! -f Makefile ]];
4+
then
5+
echo Run this script from the root folder of BOSSA
6+
exit 1
7+
fi
8+
9+
make clean
10+
11+
VERSION=`cat Makefile | grep ^VERSION= | tr '=' ' ' | awk '{ print $2; }'`
12+
OS=`uname -s | cut -c -7`
13+
14+
if [[ x$OS == xDarwin ]];
15+
then
16+
# OSX
17+
make bin/bossac -j4
18+
strip bin/bossac
19+
GCC_ARCH=`gcc -v -arch i386 2>&1 | awk '/Target/ { print $2 }'`
20+
elif [[ x$OS == xMINGW32 ]];
21+
then
22+
# Windows
23+
make bin/bossac.exe -j4
24+
strip --strip-all bin/bossac.exe
25+
GCC_ARCH=`gcc -v 2>&1 | awk '/Target/ { print $2 }'`
26+
else
27+
# Linux
28+
make bin/bossac -j4
29+
strip --strip-all bin/bossac
30+
GCC_ARCH=`gcc -v 2>&1 | awk '/Target/ { print $2 }'`
31+
fi
32+
33+
mkdir "arduino/bossac-$VERSION"
34+
cp bin/bossac* "arduino/bossac-$VERSION"
35+
cd arduino
36+
tar cfz bossac-$VERSION-$GCC_ARCH.tar.gz bossac-$VERSION
37+
cd ..
38+
rm -r "arduino/bossac-$VERSION"
39+

0 commit comments

Comments
 (0)