diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2021-12-22 03:31:04 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2021-12-22 03:31:04 +0100 |
| commit | 7dedbce91b8cb6cfbb1571f2c6dccb968d93351d (patch) | |
| tree | 68670b3ff3f2b913fdf79bcbd881dc64de678fb7 /src_doit/c.py | |
| parent | 3b22a7aee8644b26da7babfc9ea83b9cb8c7289c (diff) | |
WIP c implementation
Diffstat (limited to 'src_doit/c.py')
| -rw-r--r-- | src_doit/c.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src_doit/c.py b/src_doit/c.py new file mode 100644 index 0000000..618dd8d --- /dev/null +++ b/src_doit/c.py @@ -0,0 +1,40 @@ +from pathlib import Path + +from hat.doit.c import (exe_suffix, + CBuild) + + +__all__ = ['task_c', + 'task_c_obj', + 'task_c_dep'] + + +build_dir = Path('build') +src_c_dir = Path('src_c') +deps_dir = Path('deps') + +build_c_dir = build_dir / 'c' +exe_path = build_c_dir / f'opcut-calculate{exe_suffix}' + + +def task_c(): + """Build native app""" + return _build.get_task_exe(exe_path) + + +def task_c_obj(): + """Build .o files""" + yield from _build.get_task_objs() + + +def task_c_dep(): + """Build .d files""" + yield from _build.get_task_deps() + + +_build = CBuild( + src_paths=[*src_c_dir.rglob('*.c')], + src_dir=src_c_dir, + build_dir=build_c_dir, + cc_flags=['-fPIC', '-O2', f'-I{deps_dir / "jsmn"}'], + task_dep=['deps']) |
