Remove autotools generated products
[vpp.git] / build-root / bootstrap.sh
1 #!/bin/bash
2
3 build_root=`pwd`
4 cd ../
5 wsroot=`pwd`
6
7 # PATH
8 CCACHE_DIR="$build_root/.ccache"
9 ADD_TO_PATH="$build_root/tools/ccache-bin:$build_root/tools/bin"
10
11 # Construct build-config.mk
12 cd $build_root
13 echo SOURCE_PATH = $wsroot > build-config.mk
14 echo 
15 echo Saving PATH settings in `pwd`/path_setup
16 echo Source this file later, as needed
17 cat >path_setup <<EOF
18 #!/bin/bash
19
20 export PATH=$ADD_TO_PATH:$PATH
21 export CCACHE_DIR=$CCACHE_DIR
22 EOF
23
24 # regenerate tools/ccache-bin
25 rm -rf tools/ccache-bin
26 mkdir -p tools/ccache-bin
27
28 if [ ! -f /usr/bin/ccache ] ; then
29     echo Please install ccache AYEC and re-run this script
30 fi
31
32 cd tools/ccache-bin
33 for c in gcc g++
34     do
35     if [ -f /usr/bin/ccache ] ; then
36         ln -s /usr/bin/ccache $c
37     else
38         ln -s /usr/bin/gcc
39     fi
40 done
41
42 cd $wsroot
43
44 cd $build_root
45 echo Compile native tools
46 for tool in vppapigen
47 do
48     make V=0 is_build_tool=yes $tool-install
49 done
50