From 50c92cc7e2924009ecab3e4004448b01d687707c Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 8 Aug 2024 18:13:00 +0300 Subject: meson: Move all code generation scripts to utils/codegen/ We have multiple code generation scripts in utils/, mixed with other miscellaneous utilities, as well as a larger code base based on mojom in utils/ipc/. To make code sharing easier between the generator scripts, without creating a mess in the utils/ directory, move all the code generation code to utils/codegen/. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Scally Reviewed-by: Paul Elder --- utils/tracepoints/gen-tp-header.py | 39 -------------------------------------- utils/tracepoints/meson.build | 5 ----- 2 files changed, 44 deletions(-) delete mode 100755 utils/tracepoints/gen-tp-header.py delete mode 100644 utils/tracepoints/meson.build (limited to 'utils/tracepoints') diff --git a/utils/tracepoints/gen-tp-header.py b/utils/tracepoints/gen-tp-header.py deleted file mode 100755 index 83606c32..00000000 --- a/utils/tracepoints/gen-tp-header.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (C) 2020, Google Inc. -# -# Author: Paul Elder -# -# Generate header file to contain lttng tracepoints - -import datetime -import jinja2 -import pathlib -import os -import sys - -def main(argv): - if len(argv) < 4: - print(f'Usage: {argv[0]} include_build_dir output template tp_files...') - return 1 - - output = argv[2] - template = argv[3] - - year = datetime.datetime.now().year - path = pathlib.Path(output).absolute().relative_to(argv[1]) - - source = '' - for fname in argv[4:]: - source += open(fname, 'r', encoding='utf-8').read() + '\n\n' - - template = jinja2.Template(open(template, 'r', encoding='utf-8').read()) - string = template.render(year=year, path=path, source=source) - - f = open(output, 'w', encoding='utf-8').write(string) - - return 0 - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/utils/tracepoints/meson.build b/utils/tracepoints/meson.build deleted file mode 100644 index 807230fc..00000000 --- a/utils/tracepoints/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 - -py_modules += ['jinja2'] - -gen_tracepoints_header = find_program('./gen-tp-header.py') -- cgit v1.2.1