blob: bb8d00439c308f8291470a7ca3f5c71b2d9a1659 [file] [log] [blame]
Imre Kis124f0e32021-02-12 18:03:24 +01001User guide
2==========
3
4c-picker uses ``libclang``'s Python interface for parsing source files.
5
6Command 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
18Configuration file format
19-------------------------
20
21c-picker configuration can be described in ``JSON`` or ``YAML`` format using the same object structure.
22
23- ``elements`` - List of elements to pick from the original code
24
25 - ``name`` - Name of the element
26 - ``type`` - Type of the element: ``include``, ``function``, ``variable``
27 - ``args`` - Arguments for clang used during picking the element
28 - ``options`` - Currenly the only options is ``remove_static`` which removes
29 the ``static`` qualifier from the element's definition.
30
31- ``options`` - Global options for all elements
32- ``args`` - Global clang arguments for all elements
33
34YAML example
35------------
36
37YAML format is preferred because it can contain metadata like comments and licence information.
38
39.. code-block:: YAML
40
41 elements:
42 - file: bl1/bl1_fwu.c
43 type: variable
44 name: bl1_fwu_loaded_ids
45 options: [remove_static]
46 - file: bl1/bl1_fwu.c
47 type: function
48 name: bl1_fwu_add_loaded_id
49 options: [remove_static]
50 - file: bl1/bl1_fwu.c
51 type: function
52 name: bl1_fwu_remove_loaded_id
53 options: [remove_static]
54 args:
55 - -DFWU_MAX_SIMULTANEOUS_IMAGES=10
56 - -DINVALID_IMAGE_ID=0xffffffff
57
58
59--------------
60
61*Copyright (c) 2019-2021, Arm Limited. All rights reserved.*