2 run gmake -w -j $(detectNumCPUs) "$@"
5 function configure () {
6 if [[ ! -f configure.ac && ! -f configure.in ]]; then
7 echo "ERROR: Neither configure.ac nor configure.in exists in the current directory." >&2
11 if [[ ! -f configure ]]; then
12 run autoreconf -v -i -f
15 if [[ ! -f "_build/Makefile" ]]; then
18 run ../configure --prefix="$prefix" "${configArgs[@]}"
25 runMake -C "_build" $buildTarget
30 runMake -C "_build/$docDirectory" $docTarget
35 runMake -C "_build" check "$@"
44 runMake -C "_build" dist
47 function distcheck () {
49 runMake -C "_build" distcheck DISTCHECK_CONFIGURE_FLAGS="${configArgs[*]}"
54 runMake -C "_build" install "$@"
61 This is an automation script designed to work with autotools. It creates a
62 directory "./_build" and builds any files inside it. Its behaviour is
63 somewhat configurable: See "./Build.rc" for details.
65 If no COMMAND is given, it defaults to "build".
68 build run "$0 configure" then make(1)
69 check [ARG] run "$0 build" then "make check [ARG]"
70 configure run autoreconf(1) and "./configure" if necessary
71 clean run "rm -rf _build"
73 distcheck run "$0 configure" then "make distcheck"
74 doc similar to "$0 build" but only build the documentation
75 help print this message
76 install [ARG] run "$0 build" then "make install [ARG]"
78 Please report any bugs, feature requests, and pull requests (the most
79 preferred!) to the maintainer presented in the preamble of the "$0" itself.
87 ""|"build" ) cmd="build" ;;
88 "configure") cmd="configure";;
90 "check" ) cmd="check" ;;
91 "clean" ) cmd="clean" ;;
92 "dist" ) cmd="dist" ;;
93 "distcheck") cmd="distcheck";;
94 "help" ) cmd="usage" ;;
95 "install" ) cmd="install" ;;