aboutsummaryrefslogtreecommitdiffstats
path: root/test/travis-build.sh
blob: 58be776804327819fd54440f3c0f5661e46aa215 (plain)
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
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -eux
if [ -z ${TARGET+x} ]; then
    if [ -z ${1+x} ]; then
        echo "Need a TARGET as environment variable or first parameter!"
        exit 1
    else
        TARGET="$1"
    fi
fi

echo "Target is '$TARGET'"
make clean
make distclean
unset CC
cp test/configs/${TARGET}.config .config
make olddefconfig

if [ ! -z ${GCC_SRC+x} ]; then
    if [ -z ${GCC_DIR+x} ]; then
        echo "Need a GCC_DIR together with GCC_SRC!"
        exit 1
    fi
    if [ -e "$GCC_DIR" ]; then
        echo "Reusing GCC in '$GCC_DIR'"
    else
        echo "Getting GCC from '$GCC_SRC'"
        wget "$GCC_SRC"
        echo "Unpacking GCC to '$GCC_DIR'"
        tar xf $(basename "$GCC_SRC")
    fi
    export PATH=$GCC_DIR/bin:$PATH
fi

make V=1