#!/bin/sh # # run-avr-gcc-XXX # # Prep-end a particular bin directory to PATH, which contains executables # avr-gcc version XXX, but without the -XXX suffix in their name. # # Copyright (C) by Volker Kuhlmann # http://volker.top.geek.nz/contact.html # All rights reserved. # Released under the terms of the GNU General Public License (GPL) Version 2. # See http://www.gnu.org/ for details. # # Volker Kuhlmann # 1.0, 14 Nov 2011 Created. # 1.1, 15 Nov 2011 Added help. # 1.2, 05 Sep 2013 Also add the paths for avr-as, and AVR's as. # VERSION="1.2, 05 Sep 2013" AUTHOR="Volker Kuhlmann" COPYRIGHT="Copyright (C) 2011-2013" # Root of bin directory for this particular gcc version. root="/opt/cross/avr/lib64/gcc/avr/4.7.3" # Root of bin directory for avr-binutils. # (May be empty, but set this if it is different to $root.) rootbinutils="/opt/cross/avr" #rootbinutils="/usr/avr" Help() { echo " Usage: `basename ${0}` [OPTIONS] CMD [ARGS...] Version $VERSION $COPYRIGHT by $AUTHOR Prepend '$root' to PATH and run CMD with arguments ARGS. OPTIONS: -h|--help Show help. --version Show version. " } Version() { echo "`basename ${0}` version $VERSION $COPYRIGHT by $AUTHOR" } case "$1" in --help|-h) Help ;; --version) Version ;; *) if [ -n "$rootbinutils" ]; then PATH="$rootbinutils/bin:$PATH" fi PATH="$root/bin:$PATH" export PATH exec "$@" ;; esac