forked from laswick/arm-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
07_openocd
executable file
·50 lines (41 loc) · 830 Bytes
/
07_openocd
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
#!/bin/bash
#
# 07_openocd
#
# Rob Laswick
# May 9 2013
#
# Script to configure, build, install, and patch openocd.
if [ $# -ne 3 ]; then
echo
echo
echo *** RUNNING SCRIPT STAND ALONE ***
echo
echo
WORKING_DIR=/home/rlaswick/engineering/arm-toolchain-build
PREFIX=/home/rlaswick/opt/arm-toolchain
NUM_CORES=1
else
WORKING_DIR=$1
PREFIX=$2
NUM_CORES=$3
fi
SCRIPTS_DIR=`pwd`
cd ${WORKING_DIR}/build/openocd.git
./bootstrap || exit 1
rm -rf build
mkdir build
cd build
../configure \
--prefix=${PREFIX}/openocd \
--enable-osbdm \
--enable-jlink \
--enable-maintainer-mode || exit 1
make -j${NUM_CORES} || exit 1
make install || exit 1
patch -b ${PREFIX}/openocd/share/openocd/scripts/target/k60.cfg ${SCRIPTS_DIR}/openocd.k60.patch || exit 1
echo
echo
echo
echo openocd built and installed successfully!
echo