2 set -o pipefail -o errtrace -o nounset -o errexit
4 # Experimental script, please consult with dmarion@me.com before
5 # submitting any changes
11 prefix_path=/opt/vpp/external/$(uname -m)/
12 src_dir="$(dirname "$(readlink -f "$0")")"
17 VPP Build Configuration Script
23 --build-dir, -b Build directory
24 --install-dir, -i Install directory
25 --build-type, -t Build type (release, debug, ...)
26 --wipe, -w Wipe whole repo (except startup.* files)
37 if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
41 echo "Error: Argument for $1 is missing" >&2
46 if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
50 echo "Error: Argument for $1 is missing" >&2
55 if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
59 echo "Error: Argument for $1 is missing" >&2
64 git clean -fdx --exclude=startup.\*
67 -*|--*=) # unsupported flags
68 echo "Error: Unsupported flag $1" >&2
71 *) # preserve positional arguments
82 -DCMAKE_PREFIX_PATH=${prefix_path} \
83 -DCMAKE_INSTALL_PREFIX=${install_dir} \
84 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
85 -DCMAKE_BUILD_TYPE:STRING=${build_type}
89 Useful build commands:
92 ninja set-build-type-* Change build type to <debug|release|gcov|...>
93 ninja config Start build configuration TUI
94 ninja run Runs VPP using startup.conf in the build directory
95 ninja debug Runs VPP inside GDB using startup.conf in the build directory
96 ninja pkg-deb Create .deb packages
97 ninja install Install VPP to $install_dir