#! /bin/bash

# Assist build script debugging
env
set -x

export CFLAGS='-Wall -Werror -O2 -g -pipe -std=gnu99'
./bootstrap && \
./configure && \
make && \
make distcheck && \
make package && \
(cd test; make valgrind) && \
echo "Build passed" || \
(echo "Build failed" && exit 1)

#! /bin/bash

# Assist build script debugging
env
set -x

# For convenience we set us up to fail on any error.
# and use a trapfunc to let us know abotu failure
function trapfunc {
    set +e
    echo Build failed
    exit 1
}
trap trapfunc ERR
set -e

export CFLAGS='-Wall -Werror -O2 -g -pipe -std=c99'
./bootstrap
./configure
make
make distcheck
make package
(cd test; make valgrind)

echo "Build passed"
exit 0

Make scripting easier by using set -e and a trapfunc
Make scripting easier by using set -e and a trapfunc
