2 # SPDX-License-Identifier: BSD-3-Clause
3 # (c) 2018 Luca Boccassi <bluca@debian.org>
4 # (c) 2022 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
8 examples_dir, api_examples = sys.argv[1:]
11 with open(f'{api_examples}.d', 'w') as dep:
12 print(f'{api_examples}:', end=' ', file=dep)
13 for root, _, files in os.walk(examples_dir):
15 is_source = name.endswith('.c')
16 if is_source or name == 'meson.build':
17 path = os.path.join(root, name)
20 print(path , end=' ', file=dep)
22 with open(api_examples, 'w') as out:
24 @page examples DPDK Example Programs
27 # Produce consistent output with forward slashes on all systems.
28 # Every \ in paths within examples directory is a separator, not escape.
29 relpath = os.path.relpath(path, examples_dir).replace('\\', '/')
30 print(f'@example examples/{relpath}', file=out)