Created
December 10, 2012 15:26
-
-
Save cjmeyer/4251241 to your computer and use it in GitHub Desktop.
Bash: OpenOCD build script (Cygwin/MinGW).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/sh | |
OPENOCD_VERSION=0.5.0 | |
D2XXLIB_SRC="CDM%202.08.24%20WHQL%20Certified" | |
D2XXLIB=CDM_20824 | |
OPENOCD=openocd-${OPENOCD_VERSION} | |
PREFIX=/opt/${OPENOCD} | |
PATH_DIR=/opt/openocd | |
if [ ! -e ${D2XXLIB}.zip ]; then | |
echo "Downloading D2XX..." | |
curl -L "http://www.ftdichip.com/Drivers/CDM/${D2XXLIB_SRC}.zip" -o ${D2XXLIB}.zip | |
fi | |
if [ ! -e ${OPENOCD}.tar.gz ]; then | |
echo "Downloading OpenOCD..." | |
curl -L "http://downloads.sourceforge.net/project/openocd/openocd/${OPENOCD_VERSION}/${OPENOCD}.tar.gz" -o ${OPENOCD}.tar.gz | |
fi | |
echo "Unpacking D2XX..." | |
unzip -uo -qq ${D2XXLIB}.zip -d ${D2XXLIB} | |
echo "Unpacking OpenOCD..." | |
tar -zxf ${OPENOCD}.tar.gz | |
cp ${D2XXLIB}/i386/ftd2xx.dll ${OPENOCD} | |
chmod +x ${OPENOCD}/ftd2xx.dll | |
cd ${OPENOCD} | |
./configure --enable-maintainer-mode --disable-werror --disable-shared \ | |
--enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=../${D2XXLIB} \ | |
--prefix=${PREFIX} | |
make | |
make install | |
cd .. | |
ln -s ${PREFIX} ${PATH_DIR} | |
echo "Add ${PATH_DIR} to your PATH environment variable." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment