From 30ea4ba9222c0d9b24bf401639eddef4e5b9ef89 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 31 Jan 2019 14:24:24 -0500 Subject: Initial commit --- scripts/build.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 scripts/build.sh (limited to 'scripts/build.sh') diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..63f0a00 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,34 @@ +#!/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 + +printenv | sort + +for task in ${taskdir}/* +do + # Check for execution permission + if [[ ! -x ${task} ]]; then + echo "Skipping: ${task}" + continue + fi + echo "Executing: ${task}" + ${task} + retval=$? + if [[ ${retval} != 0 ]]; then + echo "TASK FAILED: ${task}" + exit ${retval} + fi +done -- cgit