Initial commit of vpp code.
[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 for dir in vppapigen vppinfra sample-plugin vppversion svm vlib vlib-api vnet \
45     vpp vpp-api-test vpp-japi 
46 do
47     cd $dir
48     echo "Autowank in $dir"
49     ../build-root/autowank --touch
50     cd $wsroot
51 done
52
53 cd $build_root
54 echo Compile native tools
55 for tool in vppapigen vppversion
56 do
57     make V=0 is_build_tool=yes $tool-install
58 done
59