From 7d3f57cfd2e4322bcd96d67d330124f221a9aedd Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Thu, 27 May 2021 20:41:17 +0200 Subject: 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 Reviewed-by: Michael Opdenacker Reviewed-by: Nicolas Dechesne Signed-off-by: Richard Purdie --- documentation/sdk-manual/working-projects.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'documentation/sdk-manual/working-projects.rst') 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: $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux 3. *Create the Makefile:* For this example, the Makefile contains - two lines that can be used to set the ``CC`` variable. One line is + two lines that can be used to set the :term:`CC` variable. One line is identical to the value that is set when you run the SDK environment - setup script, and the other line sets ``CC`` to "gcc", the default + setup script, and the other line sets :term:`CC` to "gcc", the default GNU compiler on the build host:: # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux @@ -297,7 +297,7 @@ example: 4. *Make the Project:* Use the ``make`` command to create the binary output file. Because variables are commented out in the Makefile, the - value used for ``CC`` is the value set when the SDK environment setup + value used for :term:`CC` is the value set when the SDK environment setup file was run:: $ make @@ -306,10 +306,10 @@ example: i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin From the results of the previous command, you can see that - the compiler used was the compiler established through the ``CC`` + the compiler used was the compiler established through the :term:`CC` variable defined in the setup script. - You can override the ``CC`` environment variable with the same + You can override the :term:`CC` environment variable with the same variable as set from the Makefile by uncommenting the line in the Makefile and running ``make`` again. :: @@ -333,7 +333,7 @@ example: variable as part of the command line. Go into the Makefile and re-insert the comment character so that running ``make`` uses the established SDK compiler. However, when you run ``make``, use a - command-line argument to set ``CC`` to "gcc":: + command-line argument to set :term:`CC` to "gcc":: $ make clean rm -rf *.o -- cgit v1.2.3-54-g00ecf