summaryrefslogtreecommitdiff
path: root/scripts/build.sh
blob: f7c7a2d3a97503f652bbbd4f8c4b6b097d4235f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash -e

taskdir=${TOOLCHAIN_BUILD}/etc/tasks
export _maxjobs=$(getconf _NPROCESSORS_ONLN)

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}"
    ${task}
    retval=$?
    if [[ ${retval} != 0 ]]; then
        echo "TASK FAILED: ${task}"
        exit ${retval}
    fi
done