xref: /linux/tools/testing/selftests/bpf/test_doc_build.sh (revision daa2be74b1b2302004945b2a5e32424e177cc7da)
1#!/bin/bash
2# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
3set -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.
7SCRIPT_REL_PATH=$(realpath $0)
8SCRIPT_REL_DIR=$(dirname $SCRIPT_REL_PATH)
9KDIR_ROOT_DIR=$(realpath $SCRIPT_REL_DIR/../../../../)
10SCRIPT_REL_DIR=$(dirname $(realpath --relative-to=$KDIR_ROOT_DIR $SCRIPT_REL_PATH))
11cd $KDIR_ROOT_DIR
12
13if [ ! -e $PWD/$SCRIPT_REL_DIR/Makefile ]; then
14	echo -e "skip:    bpftool files not found!\n"
15	exit 4 # KSFT_SKIP=4
16fi
17
18for tgt in docs docs-clean; do
19	make -s -C $PWD/$SCRIPT_REL_DIR $tgt;
20done
21