-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup-openocd-src.sh
executable file
·52 lines (41 loc) · 1.21 KB
/
setup-openocd-src.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
set -e
openocd_rev=2e60e2e
msg () {
echo
echo \* "$@"
}
cmd () {
echo ' '"$@"
"$@"
}
if test -d efm32s2; then :
else
echo please run this script from the project root
exit 2
fi
msg cloning OpenOCD\'s official Github mirror repository
cmd git clone -q https://github.com/openocd-org/openocd
cmd cd openocd
msg checking out a revision compatible to this EFM32 series 2 extension: $openocd_rev
cmd git checkout -q $openocd_rev
msg initializing sub modules
cmd git submodule -q init
cmd git submodule -q update
# If using a builddir different from srcdir, the build process
# fails when trying to update stamp-vti, and version.texi.
# Apparently this can't be fixed using the automake option
# info-in-builddir, so we deactivate 'make' in ./doc completely.
msg deactivating doc generation
mv Makefile.am ,,m
sed '/^include.doc.Makefile.am/s/^/#/' < ,,m > Makefile.am
rm -f ,,m
msg copying efm32s2 files to the OpenOCD source tree
cmd cp ../efm32s2/efm32s2.c src/flash/nor/
cmd cp ../efm32s2/efm32s2.cfg tcl/target/
cmd cp ../efm32s2/efm32s2_g23.cfg tcl/target/
cmd patch -p1 -i ../efm32s2/adjust_openocd.patch
cmd ./bootstrap
cat <<EOF
Finished setting up the OpenOCD source tree.
To build a minimal setup, run: sh build.sh
EOF