Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
[linux-2.6-microblaze.git] / tools / testing / selftests / bpf / test_doc_build.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
3 set -e
4
5 # Assume script is located under tools/testing/selftests/bpf/. We want to start
6 # build attempts from the top of kernel repository.
7 SCRIPT_REL_PATH=$(realpath $0)
8 SCRIPT_REL_DIR=$(dirname $SCRIPT_REL_PATH)
9 KDIR_ROOT_DIR=$(realpath $SCRIPT_REL_DIR/../../../../)
10 SCRIPT_REL_DIR=$(dirname $(realpath --relative-to=$KDIR_ROOT_DIR $SCRIPT_REL_PATH))
11 cd $KDIR_ROOT_DIR
12
13 if [ ! -e $PWD/$SCRIPT_REL_DIR/Makefile ]; then
14         echo -e "skip:    bpftool files not found!\n"
15         exit 4 # KSFT_SKIP=4
16 fi
17
18 for tgt in docs docs-clean; do
19         make -s -C $PWD/$SCRIPT_REL_DIR $tgt;
20 done