forked from adafruit/Adafruit_Adalink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_openocd_debian.sh
executable file
·38 lines (34 loc) · 1.24 KB
/
install_openocd_debian.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
#!/bin/bash
set -e
# First update the apt package list and install required dependencies.
echo '============================================================'
echo 'Installing dependencies (enter sudo password if prompted)...'
echo '============================================================'
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libusb-1.0-0 libusb-1.0-0-dev libftdi1 libftdi-dev
# Next download the source and unpack it (deleting any old version of it).
echo '==================================='
echo 'Downloading OpenOCD 0.9.0 source...'
echo '==================================='
if [ -f openocd-0.9.0.tar.gz ];
then
rm openocd-0.9.0.tar.gz
fi
wget http://downloads.sourceforge.net/project/openocd/openocd/0.9.0/openocd-0.9.0.tar.gz
if [ -d openocd-0.9.0 ];
then
rm -rf openocd-0.9.0
fi
tar xvfz openocd-0.9.0.tar.gz
# Finally change to openocd directory to build and install it.
echo '========================================'
echo 'Building and installing OpenOCD 0.9.0...'
echo '========================================'
cd openocd-0.9.0
./configure
make
sudo make install
echo '====================================='
echo 'Successfully installed OpenOCD 0.9.0!'
echo '====================================='
cd ..