diff options
author | Quentin Schulz <foss@0leil.net> | 2021-05-27 20:41:17 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-06-19 16:54:01 +0100 |
commit | 7d3f57cfd2e4322bcd96d67d330124f221a9aedd (patch) | |
tree | 5d07321b7c8bc59bb7fcc0372fab8b7a1966cf06 /documentation/sdk-manual/working-projects.rst | |
parent | 7a9b74e9d2a5cf3b1fb3ac7565c50eae6e0d4632 (diff) | |
download | poky-7d3f57cfd2e4322bcd96d67d330124f221a9aedd.tar.gz |
docs: replace ``FOO`` by :term:`FOO` where possible
If a variable has a glossary entry and some rST files write about those
variables, it's better to point to the glossary entry instead of just
highlighting it by surrounding it with two tick quotes.
This was automated by the following python script:
"""
import re
from pathlib import Path
with open('objects.inv.txt', 'r') as f:
objects = f.readlines()
with open('bitbake-objects.inv.txt', 'r') as f:
objects = objects + f.readlines()
re_term = re.compile(r'variables.html#term-([A-Z_0-9]*)')
terms = []
for obj in objects:
match = re_term.search(obj)
if match and match.group(1):
terms.append(match.group(1))
for rst in Path('.').rglob('*.rst'):
with open(rst, 'r') as f:
content = "".joing(f.readlines())
for term in terms:
content = re.sub(r'``({})``(?!.*\s*[~-]+)'.format(term), r':term:`\1`', content)
with open(rst, 'w') as f:
f.write(content)
"""
(From yocto-docs rev: ba49d9babfcb84bc5c26a68c8c3880a1d9c236d3)
Signed-off-by: Quentin Schulz <foss@0leil.net>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/sdk-manual/working-projects.rst')
-rw-r--r-- | documentation/sdk-manual/working-projects.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/documentation/sdk-manual/working-projects.rst b/documentation/sdk-manual/working-projects.rst index c482c38c70..27c69ca7dd 100644 --- a/documentation/sdk-manual/working-projects.rst +++ b/documentation/sdk-manual/working-projects.rst | |||
@@ -278,9 +278,9 @@ example: | |||
278 | $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux | 278 | $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux |
279 | 279 | ||
280 | 3. *Create the Makefile:* For this example, the Makefile contains | 280 | 3. *Create the Makefile:* For this example, the Makefile contains |
281 | two lines that can be used to set the ``CC`` variable. One line is | 281 | two lines that can be used to set the :term:`CC` variable. One line is |
282 | identical to the value that is set when you run the SDK environment | 282 | identical to the value that is set when you run the SDK environment |
283 | setup script, and the other line sets ``CC`` to "gcc", the default | 283 | setup script, and the other line sets :term:`CC` to "gcc", the default |
284 | GNU compiler on the build host:: | 284 | GNU compiler on the build host:: |
285 | 285 | ||
286 | # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux | 286 | # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux |
@@ -297,7 +297,7 @@ example: | |||
297 | 297 | ||
298 | 4. *Make the Project:* Use the ``make`` command to create the binary | 298 | 4. *Make the Project:* Use the ``make`` command to create the binary |
299 | output file. Because variables are commented out in the Makefile, the | 299 | output file. Because variables are commented out in the Makefile, the |
300 | value used for ``CC`` is the value set when the SDK environment setup | 300 | value used for :term:`CC` is the value set when the SDK environment setup |
301 | file was run:: | 301 | file was run:: |
302 | 302 | ||
303 | $ make | 303 | $ make |
@@ -306,10 +306,10 @@ example: | |||
306 | i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin | 306 | i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin |
307 | 307 | ||
308 | From the results of the previous command, you can see that | 308 | From the results of the previous command, you can see that |
309 | the compiler used was the compiler established through the ``CC`` | 309 | the compiler used was the compiler established through the :term:`CC` |
310 | variable defined in the setup script. | 310 | variable defined in the setup script. |
311 | 311 | ||
312 | You can override the ``CC`` environment variable with the same | 312 | You can override the :term:`CC` environment variable with the same |
313 | variable as set from the Makefile by uncommenting the line in the | 313 | variable as set from the Makefile by uncommenting the line in the |
314 | Makefile and running ``make`` again. | 314 | Makefile and running ``make`` again. |
315 | :: | 315 | :: |
@@ -333,7 +333,7 @@ example: | |||
333 | variable as part of the command line. Go into the Makefile and | 333 | variable as part of the command line. Go into the Makefile and |
334 | re-insert the comment character so that running ``make`` uses the | 334 | re-insert the comment character so that running ``make`` uses the |
335 | established SDK compiler. However, when you run ``make``, use a | 335 | established SDK compiler. However, when you run ``make``, use a |
336 | command-line argument to set ``CC`` to "gcc":: | 336 | command-line argument to set :term:`CC` to "gcc":: |
337 | 337 | ||
338 | $ make clean | 338 | $ make clean |
339 | rm -rf *.o | 339 | rm -rf *.o |