From b8344734d145d48e1cb0c14d235059aad4ce66bb Mon Sep 17 00:00:00 2001 From: drmpjz <80600186+drmpjz@users.noreply.github.com> Date: Thu, 4 May 2023 20:18:17 +0200 Subject: [PATCH] Add option -f to build.sh (#1342) --- build.sh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 03c69984..833e1ec1 100755 --- a/build.sh +++ b/build.sh @@ -24,8 +24,35 @@ # On MacOS, an attempt is made to find out whether Mac ports or brew # are in place, and are assumed to have install the prerequisites. +usage() +{ + echo "Build script for avrdude" + echo + echo "Syntax: build.sh -h -f " + echo "Options" + echo "-h Display this usage information and exit" + echo "-f Extra build flags to pass to cmake" + echo +} + ostype=$(uname | tr '[A-Z]' '[a-z]') +build_flags="" + +while getopts :hf: OPT; do + case "$OPT" in + f) + build_flags="$OPTARG" + ;; + h | *) + usage + exit + ;; + esac +done +shift $((OPTIND-1)) # remove parsed options and args from $@ list + + build_type=RelWithDebInfo # build_type=Release # no debug info @@ -35,8 +62,6 @@ build_type=RelWithDebInfo #extra_enable="-D HAVE_PARPORT=1" extra_enable="" -build_flags="" - case "${ostype}" in linux) # try to find out whether this is an Embedded Linux