ethdev: announce migration to generic flow modify action
[dpdk.git] / doc / api / generate_examples.sh
1 #! /bin/sh -e
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2018 Luca Boccassi <bluca@debian.org>
4
5 EXAMPLES_DIR=$1
6 API_EXAMPLES=$2
7
8 FIND=find
9 if [ "$(uname)" = "FreeBSD" ] ; then
10 # on FreeBSD, we need GNU find for "-printf" flag
11         FIND=gfind
12         if ! which -s $FIND ; then
13                 echo "Error: need '$FIND' on FreeBSD. Install 'findutils' pkg"
14                 exit 1
15         fi
16 fi
17
18 # generate a .d file including both C files and also build files, so we can
19 # detect both file changes and file additions/deletions
20 echo "$API_EXAMPLES: $($FIND ${EXAMPLES_DIR} -type f \( -name '*.c' -o -name 'meson.build' \) -printf '%p ' )" > ${API_EXAMPLES}.d
21
22 exec > "${API_EXAMPLES}"
23 printf '/**\n'
24 printf '@page examples DPDK Example Programs\n\n'
25 $FIND "${EXAMPLES_DIR}" -type f -name '*.c' -printf '@example examples/%P\n' | LC_ALL=C sort
26 printf '*/\n'