#! /bin/bash PROJECT=ellcc # Available sub-projects. AVAILABLE_PROJECTS=( ellcc ) # Enabled sub-projects. PROJECTS=( ellcc ) # Additional options (see functions sources below). # Options followed by a ':' require an argument, by '::' allow an optional argument. SHORT_OPTIONS= # Long options are not available with BSD getopt. LONG_OPTIONS= # Help for additional options usage() { # option h "help" "display this help and exit" return } # Find the directory containing this script. source="${BASH_SOURCE[0]}" while [ -h "${source}" ] ; do SCRIPTS="$(cd -P "$(dirname "${source}")" && pwd)" source="$(readlink "${source}")" [[ ${source} != /* ]] && source="$DIR/${source}" done SCRIPTS="$(cd -P "$(dirname "${source}")" && pwd)" # Get the list of available target hosts. get_targets() { cat ${TOOLINFO}/buildhosts | grep -v ^\# } # Get support functions and definitions. source ${SCRIPTS}/support if [ "${CROSS}" != "yes" -a "${TARGET}" = "" ] ; then TARGET=${HOSTTUPLE} fi if [ "${BUILD}" = "y" ] ; then if [ "${TARGET}" != "all" ] ; then # Build for a single host. if [ "${CROSS}" != "yes" -a "$(get_toolinfo ${TARGET})" = "" ] ; then bailout "'${TARGET}' is not a valid target." fi run ${SCRIPTS}/make-ecc ${TARGET} run ${SCRIPTS}/make-patchelf -cCbi ${TARGET} elif [ "${TARGET}" = "all" ] ; then # Build for all known working hosts. for host in ${TARGETS} ; do run ${SCRIPTS}/make-ecc ${host} run ${SCRIPTS}/make-patchelf -cCbi ${host} done fi fi