Stewart Smith | c4b9bf6 | 2018-08-24 13:30:15 +1000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | set -eo pipefail |
| 5 | |
| 6 | if [ -z "$1" ]; then |
| 7 | echo "No build distro specified" |
| 8 | exit 1; |
| 9 | fi |
| 10 | |
| 11 | if [ -z "$2" ]; then |
| 12 | echo "No defconfig to build SDK from specified" |
| 13 | exit 1; |
| 14 | fi |
| 15 | |
| 16 | if [ -z "$CCACHE_DIR" ]; then |
| 17 | CCACHE_DIR=`pwd`/.op-build_ccache |
| 18 | fi |
| 19 | |
| 20 | shopt -s expand_aliases |
| 21 | source op-build-env |
| 22 | |
| 23 | if [ -n "$DL_DIR" ]; then |
| 24 | unset BR2_DL_DIR |
| 25 | export BR2_DL_DIR=${DL_DIR} |
| 26 | fi |
| 27 | |
| 28 | export O=`pwd`/output-$1-$2/ |
| 29 | op-build O=$O $2 |
| 30 | ./buildroot/utils/config --file $O/.config --set-val BR2_CCACHE y |
| 31 | ./buildroot/utils/config --file $O/.config --set-str BR2_CCACHE_DIR $CCACHE_DIR |
| 32 | op-build O=$O olddefconfig |
| 33 | op-build O=$O sdk |