Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | build_root=`pwd` |
| 4 | cd ../ |
| 5 | wsroot=`pwd` |
| 6 | |
| 7 | # PATH |
Ed Warnicke | c28b474 | 2016-02-02 19:28:59 -0800 | [diff] [blame] | 8 | if [[ ! $CCACHE_DIR ]];then |
| 9 | CCACHE_DIR="$build_root/.ccache" |
| 10 | fi |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 11 | ADD_TO_PATH="$build_root/tools/ccache-bin:$build_root/tools/bin" |
| 12 | |
| 13 | # Construct build-config.mk |
| 14 | cd $build_root |
Damjan Marion | 905a7f5 | 2016-07-07 20:27:49 +0200 | [diff] [blame] | 15 | echo SOURCE_PATH = $wsroot > build-config.mk |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 16 | echo |
| 17 | echo Saving PATH settings in `pwd`/path_setup |
| 18 | echo Source this file later, as needed |
| 19 | cat >path_setup <<EOF |
| 20 | #!/bin/bash |
| 21 | |
| 22 | export PATH=$ADD_TO_PATH:$PATH |
| 23 | export CCACHE_DIR=$CCACHE_DIR |
| 24 | EOF |
| 25 | |
| 26 | # regenerate tools/ccache-bin |
| 27 | rm -rf tools/ccache-bin |
| 28 | mkdir -p tools/ccache-bin |
| 29 | |
| 30 | if [ ! -f /usr/bin/ccache ] ; then |
| 31 | echo Please install ccache AYEC and re-run this script |
| 32 | fi |
| 33 | |
| 34 | cd tools/ccache-bin |
| 35 | for 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 |
| 42 | done |
| 43 | |
| 44 | cd $wsroot |
| 45 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 46 | cd $build_root |
| 47 | echo Compile native tools |
Damjan Marion | 29b6af9 | 2015-12-13 21:17:07 +0100 | [diff] [blame] | 48 | for tool in vppapigen |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 49 | do |
| 50 | make V=0 is_build_tool=yes $tool-install |
| 51 | done |
| 52 | |