File: generate_doxygen.py

package info (click to toggle)
dpdk 24.11.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,148 kB
  • sloc: ansic: 2,206,055; python: 11,866; sh: 4,627; makefile: 2,025; awk: 70
file content (19 lines) | stat: -rwxr-xr-x 683 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# (c) 2018 Luca Boccassi <bluca@debian.org>
# (c) 2022 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>

import os, re, subprocess, sys

pattern = re.compile('^Preprocessing (.*)...$')
out_dir, *doxygen_command = sys.argv[1:]
out_file = os.path.join(out_dir + '.out')
dep_file = f'{out_dir}.d'
with open(out_file, 'w') as out:
    subprocess.run(doxygen_command, check=True, stdout=out)
with open(out_file) as out, open(dep_file, 'w') as dep:
    print(f'{out_dir}:', end=' ', file=dep)
    for line in sorted(out):
        match = re.match(pattern, line)
        if match:
            print(match.group(1), end=' ', file=dep)