From 340f4c17dc61d2fe9077bce1c4e6934bffd5eb9b Mon Sep 17 00:00:00 2001 From: lalbornoz Date: Thu, 4 Feb 2016 13:18:07 +0100 Subject: Initial commit --- build.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 build.sh (limited to 'build.sh') diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..e4931044 --- /dev/null +++ b/build.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +{ +unset AR ARFLAGS CC CFLAGS CXX CXXFLAGS LD LDFLAGS; +. ./build.vars; . ./build.subr; +check_prereqs git make sed tar wget; +log_msg info "Build started by ${USER}@$(hostname)."; +#trap +(set -o errexit; mkdir -p "${PREFIX}" "${WORKDIR}"); +BUILD_NFINI=${BUILD_NSKIP:=${BUILD_NFAIL:=${_nbuild:=0}}}; +for BUILD_LVL in 0 1 2; do + for BUILD_SCRIPT_FNAME in ${BUILD_LVL}[0-9][0-9].*.build; do + if [ -n "${DEBUG_SCRIPT}" ]\ + && [ "x${DEBUG_SCRIPT}" != "x${BUILD_SCRIPT_FNAME}" ]; then + continue; + elif [ ! -f "${BUILD_SCRIPT_FNAME}" ]; then + continue; + else + unset BUILD_SCRIPT_RC; : $((_nbuild+=1)); + log_msg info "Invoking build script \`${BUILD_SCRIPT_FNAME}'"; + (set -o errexit -- $(split "." "${BUILD_SCRIPT_FNAME%.build}"); \ + SCRIPT_FNAME="${BUILD_SCRIPT_FNAME}"; _pwd="$(pwd)"; \ + cd "${WORKDIR}"; . "${_pwd}/build.subr"; \ + . "${_pwd}/${BUILD_SCRIPT_FNAME}"); + case ${BUILD_SCRIPT_RC:=${?}} in + 0) log_msg succ "Finished build script \`${BUILD_SCRIPT_FNAME}'."; + : $((BUILD_NFINI+=1)); continue; ;; + 212) log_msg info "Skipped build script \`${BUILD_SCRIPT_FNAME}' (already built.)"; + : $((BUILD_NSKIP+=1)); BUILD_SCRIPT_RC=0; continue; ;; + *) log_msg fail "Build failed in build script \`${BUILD_SCRIPT_FNAME}' (last return code ${BUILD_SCRIPT_RC}.)."; + : $((BUILD_NFAIL+=1)); break; ;; + esac; + fi; + done; + if [ ${BUILD_SCRIPT_RC:-0} != 0 ]; then + break; + fi; +done; +log_msg info "${BUILD_NFINI} finished, ${BUILD_NSKIP} skipped, and ${BUILD_NFAIL} failed builds in ${_nbuild} build script(s)."; +exit ${BUILD_SCRIPT_RC}; +} 2>&1 | tee build.log; + +# vim:filetype=sh -- cgit v1.2.3