+usage()
+{
+ # if exiting with 0, write to stdout, else write to stderr
+ local ret=${1:-0}
+ [ "${ret}" -eq 1 ] && exec 1>&2
+ cat <<-EOF
+ Usage: MAKEALL [options] [--] [boards-to-build]
+
+ Options:
+ -a ARCH, --arch ARCH Build all boards with arch ARCH
+ -c CPU, --cpu CPU Build all boards with cpu CPU
+ -v VENDOR, --vendor VENDOR Build all boards with vendor VENDOR
+ -s SOC, --soc SOC Build all boards with soc SOC
+ -b BOARD, --board BOARD Build all boards with board name BOARD
+ -l, --list List all targets to be built
+ -m, --maintainers List all targets and maintainer email
+ -M, --mails List all targets and all affilated emails
+ -C, --check Enable build checking
+ -n, --continue Continue (skip boards already built)
+ -r, --rebuild-errors Rebuild any boards that errored
+ -h, --help This help output
+
+ Selections by these options are logically ANDed; if the same option
+ is used repeatedly, such selections are ORed. So "-v FOO -v BAR"
+ will select all configurations where the vendor is either FOO or
+ BAR. Any additional arguments specified on the command line are
+ always build additionally. See the boards.cfg file for more info.
+
+ If no boards are specified, then the default is "powerpc".
+
+ Environment variables:
+ BUILD_NCPUS number of parallel make jobs (default: auto)
+ CROSS_COMPILE cross-compiler toolchain prefix (default: "")
+ CROSS_COMPILE_<ARCH> cross-compiler toolchain prefix for
+ architecture "ARCH". Substitute "ARCH" for any
+ supported architecture (default: "")
+ MAKEALL_LOGDIR output all logs to here (default: ./LOG/)
+ BUILD_DIR output build directory (default: ./)
+ BUILD_NBUILDS number of parallel targets (default: 1)
+
+ Examples:
+ - build all Power Architecture boards:
+ MAKEALL -a powerpc
+ MAKEALL --arch powerpc
+ MAKEALL powerpc
+ - build all PowerPC boards manufactured by vendor "esd":
+ MAKEALL -a powerpc -v esd
+ - build all PowerPC boards manufactured either by "keymile" or "siemens":
+ MAKEALL -a powerpc -v keymile -v siemens
+ - build all Freescale boards with MPC83xx CPUs, plus all 4xx boards:
+ MAKEALL -c mpc83xx -v freescale 4xx
+ EOF
+ exit ${ret}
+}
+
+SHORT_OPTS="ha:c:v:s:b:lmMCnr"
+LONG_OPTS="help,arch:,cpu:,vendor:,soc:,board:,list,maintainers,mails,check,continue,rebuild-errors"