-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathbuild
executable file
·57 lines (38 loc) · 1.15 KB
/
build
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
#!/bin/bash
#
# build firmwares for version
R=Releases
V=$(grep '#define VERSION' version.h | cut -d\" -f2 | \
sed 's/^\(.\)\(.\)\(.\)$/\1.\2.\3/')
# check, if not already released
if [ -f $R/MANUAL-$V.txt -a x"$1" != "x--force" ]; then
echo "Version '$V' already released !!!" >&2
exit 1
fi
# manual, set FIRMWARE_END_ADDRESS to actual value
FEA=$(perl -e "printf \"%x\", $(grep 'segment \.text' gt3b.map | head -n 1 | awk '{print "0x"$4}') - 1;");
NMODELS=$(( (0xffff - 0x$FEA) / 108 + 8 ))
sed -e "s/FIRMWARE_END_ADDR/$FEA/" \
-e "s/NUMBER_OF_MODELS/$NMODELS/" \
MANUAL.txt >$R/MANUAL-$V.txt
git add $R/MANUAL-$V.txt
# ChangeLog - only copy to have it in the Release directory
cp -p ChangeLog $R/ChangeLog.txt
# firmwares for more max channels
#for N in 3 8 6; do
# make clean
# make CHANNELS=$N || exit 2
# cp -p gt3b.s19 $R/gt3b-ch$N-$V.s19
# git add $R/gt3b-ch$N-$V.s19
#done
#
# only one firmware now
cp -p gt3b.s19 $R/gt3b-$V.s19
git add $R/gt3b-$V.s19
# commit generated firmwares
git ci -am "Release: version-$V"
# tag this release
git tag version-$V
# push it to github
git push origin master
git push origin version-$V