Imre Kis | 1d2fbdd | 2019-12-13 11:42:08 +0100 | [diff] [blame^] | 1 | c-picker |
| 2 | ======== |
| 3 | |
| 4 | c-picker uses ``libclang``'s Python interface for parsing source files. |
| 5 | |
| 6 | Command line options |
| 7 | -------------------- |
| 8 | |
| 9 | - ``-h, --help`` - Showing help message |
| 10 | - ``--root ROOT`` - Root source directory |
| 11 | - ``--config CONFIG`` - Configuration file (``.json|.yml``) |
| 12 | - ``--output OUTPUT`` - Output file |
| 13 | - ``--print-dependencies`` - Prints the dependencies |
| 14 | - ``--version`` - Shows the program's version number and exit |
| 15 | - ``--args ...`` - clang arguments |
| 16 | |
| 17 | |
| 18 | Configuration file format |
| 19 | ------------------------- |
| 20 | |
| 21 | c-picker configuration can be described in ``JSON`` or ``YAML`` format using the |
| 22 | same object structure. |
| 23 | |
| 24 | - ``elements`` - List of elements to pick from the original code |
| 25 | |
| 26 | - ``name`` - Name of the element |
| 27 | - ``type`` - Type of the element: ``include``, ``function``, ``variable`` |
| 28 | - ``args`` - Arguments for clang used during picking the element |
| 29 | - ``options`` - Currenly the only options is ``remove_static`` which removes |
| 30 | the ``static`` qualifier from the element's definition. |
| 31 | |
| 32 | - ``options`` - Global options for all elements |
| 33 | - ``args`` - Global clang arguments for all elements |
| 34 | |
| 35 | YAML example |
| 36 | ------------ |
| 37 | |
| 38 | YAML format is preferred because it can contain metadata like comments and |
| 39 | licence information. |
| 40 | |
| 41 | .. code-block:: YAML |
| 42 | |
| 43 | elements: |
| 44 | - file: bl1/bl1_fwu.c |
| 45 | type: variable |
| 46 | name: bl1_fwu_loaded_ids |
| 47 | options: [remove_static] |
| 48 | - file: bl1/bl1_fwu.c |
| 49 | type: function |
| 50 | name: bl1_fwu_add_loaded_id |
| 51 | options: [remove_static] |
| 52 | - file: bl1/bl1_fwu.c |
| 53 | type: function |
| 54 | name: bl1_fwu_remove_loaded_id |
| 55 | options: [remove_static] |
| 56 | args: |
| 57 | - -DFWU_MAX_SIMULTANEOUS_IMAGES=10 |
| 58 | - -DINVALID_IMAGE_ID=0xffffffff |
| 59 | |
| 60 | |
| 61 | -------------- |
| 62 | |
| 63 | *Copyright (c) 2019-2020, Arm Limited. All rights reserved.* |