Skip to content

Instantly share code, notes, and snippets.

@spirilis
Last active August 29, 2015 14:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spirilis/115655b9bf206402ff50 to your computer and use it in GitHub Desktop.
Save spirilis/115655b9bf206402ff50 to your computer and use it in GitHub Desktop.
#!/bin/bash
INSTALL_TARGET_PREFIX=/raptor/spirilis/mspgcc49_bin/msp430-elf-dev-20140423
PATH_TO_ZIP=/home/spirilis/inst/GCC_RH_20131206.zip
cd $INSTALL_TARGET_PREFIX/msp430-elf
unzip -u $PATH_TO_ZIP
# Header files should be inside include/, but also a boatload of directories containing the linker scripts; they need
# to be combined and stored into lib/<part#>.ld.
cd include
echo "Generating ldscripts-"
for i in $(find . -maxdepth 1 -name 'msp430*' -type d | sed -e 's/^\.\///') $(find . -maxdepth 1 -name 'cc430*' -type d | sed -e 's/^\.\///') ; do
echo "Processing $i..."
cat ${i}/memory.ld ${i}/peripherals.ld > ../lib/ldscripts/${i}.ld
rm -f ${i}/*.ld
rmdir ${i}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment