blob: 2949c1806c291a6323917e53960d807e4b2b7d45 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001#!/bin/bash
2
3build_root=`pwd`
4cd ../
5wsroot=`pwd`
6
7# PATH
Ed Warnickec28b4742016-02-02 19:28:59 -08008if [[ ! $CCACHE_DIR ]];then
9 CCACHE_DIR="$build_root/.ccache"
10fi
Ed Warnickecb9cada2015-12-08 15:45:58 -070011ADD_TO_PATH="$build_root/tools/ccache-bin:$build_root/tools/bin"
12
13# Construct build-config.mk
14cd $build_root
Damjan Marion905a7f52016-07-07 20:27:49 +020015echo SOURCE_PATH = $wsroot > build-config.mk
Ed Warnickecb9cada2015-12-08 15:45:58 -070016echo
17echo Saving PATH settings in `pwd`/path_setup
18echo Source this file later, as needed
19cat >path_setup <<EOF
20#!/bin/bash
21
22export PATH=$ADD_TO_PATH:$PATH
23export CCACHE_DIR=$CCACHE_DIR
24EOF
25
26# regenerate tools/ccache-bin
27rm -rf tools/ccache-bin
28mkdir -p tools/ccache-bin
29
30if [ ! -f /usr/bin/ccache ] ; then
31 echo Please install ccache AYEC and re-run this script
32fi
33
34cd tools/ccache-bin
35for c in gcc g++
36 do
37 if [ -f /usr/bin/ccache ] ; then
38 ln -s /usr/bin/ccache $c
39 else
40 ln -s /usr/bin/gcc
41 fi
42done
43
44cd $wsroot
45
Ed Warnickecb9cada2015-12-08 15:45:58 -070046cd $build_root
47echo Compile native tools
Damjan Marion7cd468a2016-12-19 23:05:39 +010048for tool in tools
Ed Warnickecb9cada2015-12-08 15:45:58 -070049do
50 make V=0 is_build_tool=yes $tool-install
51done
52