3 # Experimental script, please consult with dmarion@me.com before
4 # submitting any changes
10 prefix_path=/opt/vpp/external/$(uname -m)/
11 src_dir="$(dirname "$(readlink -f "$0")")"
16 VPP Build Configuration Script
22 --build-dir, -b Build directory
23 --install-dir, -i Install directory
24 --build-type, -t Build type (release, debug, ...)
25 --wipe, -w Wipe whole repo (except startup.* files)
36 if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
40 echo "Error: Argument for $1 is missing" >&2
45 if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
49 echo "Error: Argument for $1 is missing" >&2
54 if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
58 echo "Error: Argument for $1 is missing" >&2
63 git clean -fdx --exclude=startup.\*
66 -*|--*=) # unsupported flags
67 echo "Error: Unsupported flag $1" >&2
70 *) # preserve positional arguments
81 -DCMAKE_PREFIX_PATH=${prefix_path} \
82 -DCMAKE_INSTALL_PREFIX=${install_dir} \
83 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
84 -DCMAKE_BUILD_TYPE:STRING=${build_type}
88 Useful build commands:
91 ninja set-build-type-* Change build type to <debug|release|gcov|...>
92 ninja config Start build configuration TUI
93 ninja run Runs VPP using startup.conf in the build directory
94 ninja debug Runs VPP inside GDB using startup.conf in the build directory
95 ninja pkg-deb Create .deb packages
96 ninja install Install VPP to $install_dir