diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2018-06-22 15:11:55 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-07-02 13:08:21 +0100 |
commit | f4639235768641b8adc520f515635c57e576c92c (patch) | |
tree | 564a7ce1a7923204650267d11f7066c22b5b1999 | |
parent | df7d096af7108df4d81199c14cfdd403cbd7d3f2 (diff) |
contrib/generate_all.sh: allow passing of arguments to risugen
This allows us to use any new risugen options when generating all our
test patterns.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180622141205.16306-13-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rwxr-xr-x | contrib/generate_all.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/contrib/generate_all.sh b/contrib/generate_all.sh index 1e6b847..651cb23 100755 --- a/contrib/generate_all.sh +++ b/contrib/generate_all.sh @@ -12,11 +12,11 @@ # Alex Bennée <alex.bennee@linaro.org> - initial implementation # # Usage: -# ./contrib/generate_all.sh <arch.risu> <target directory> +# ./contrib/generate_all.sh <arch.risu> <target directory> -- risugen args set -e -USAGE="Usage: `basename $0` [-h] [-n x] <risufile> <target dir>" +USAGE="Usage: `basename $0` [-h] [-n x] <risufile> <target dir> -- [risugen args]" SPLIT=4 RISUGEN=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd -P)/risugen @@ -41,18 +41,24 @@ done # Remove the switches we parsed above. shift `expr $OPTIND - 1` -while [ $# -ne 0 ]; do +# Parse up to and including any -- +RISUGEN_ARGS="" +while [ $# -ne 0 ] && [ -z "$RISUGEN_ARGS" ]; do if [ -f $1 ]; then RISU_FILE=$1; elif [ -d $1 ]; then TARGET_DIR=$1; + elif [ "$1" = "--" ]; then + RISUGEN_ARGS=$1 elif [ ! -e $1 ]; then TARGET_DIR=$1 fi shift done +# anything left is for RISUGEN +RISUGEN_ARGS=$@ if test -z "${RISUGEN}" || test ! -x "${RISUGEN}"; then echo "Couldn't find risugen (${RISUGEN})" @@ -90,7 +96,7 @@ while test $# -gt 0 ; do fi done I_FILE="${I_FILE}_INC.risu.bin" - CMD="${RISUGEN} ${INSN_PATTERNS} ${RISU_FILE} ${I_FILE}" + CMD="${RISUGEN} ${RISUGEN_ARGS} ${INSN_PATTERNS} ${RISU_FILE} ${I_FILE}" echo "Running: $CMD" $CMD done |