From a16452a5187314523a0d3d1431d589463e3f281d Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 31 Jan 2019 13:23:24 -0500 Subject: Initial commit --- scripts/build.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 scripts/build.sh (limited to 'scripts') diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..9575888 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash -x + +prefix="${TOOLCHAIN}" +taskdir=${TOOLCHAIN_BUILD}/etc/tasks + +export _maxjobs=$(getconf _NPROCESSORS_ONLN) +export PATH="${prefix}/bin:${PATH}" +export CFLAGS="-I${prefix}/include" +export LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib" +export PKG_CONFIG_PATH="${prefix}/lib/pkgconfig" +export PREFIX="${prefix}" + +if [[ ! -d ${taskdir} ]]; then + echo "No tasks. ${taskdir} does not exist." + exit 1 +fi + +for task in ${taskdir}/* +do + # Check for execution permission + if [[ ! -x ${task} ]]; then + echo "Skipping: ${task}" + continue + fi + echo "Executing: ${task}" + hash -r + ${task} + retval=$? + if [[ ${retval} != 0 ]]; then + echo "TASK FAILED: ${task}" + exit ${retval} + fi +done -- cgit