Use path based SHELL in Makefiles. It was suggested that this is a better solution for make for cases when there is no /usr/bin/env. See: https://github.com/purpleidea/mgmt/pull/694#discussion_r1015596204
35 lines
573 B
Bash
Executable File
35 lines
573 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e -o pipefail
|
|
|
|
echo running "$(basename "$0")"
|
|
|
|
. test/util.sh
|
|
|
|
# test if we can build for all OSes and ARCHes.
|
|
|
|
tmpdir="`$mktemp --tmpdir -d tmp.XXX`" # get a dir outside of the main package
|
|
if [[ ! "$tmpdir" =~ "/tmp" ]]; then
|
|
echo "unexpected tmpdir in: ${tmpdir}"
|
|
exit 99
|
|
fi
|
|
log="$tmpdir/$(basename $0 .sh).log"
|
|
|
|
set +e
|
|
make crossbuild &> "$log"
|
|
|
|
RET=$?
|
|
if [ ! $RET -eq 0 ]; then
|
|
echo 'FAIL'
|
|
cat "$log"
|
|
else
|
|
echo 'PASS'
|
|
fi
|
|
|
|
if [ "$tmpdir" = "" ]; then
|
|
echo "BUG, tried to delete empty string path"
|
|
exit 99
|
|
fi
|
|
rm -rf "$tmpdir"
|
|
exit $RET
|