diff options
| author | Quentin Schulz <quentin.schulz@cherry.de> | 2026-01-21 14:31:45 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2026-02-10 13:11:48 +0000 |
| commit | a9615a233584be0185d1af0fcdc3299b0b99671e (patch) | |
| tree | 0badfbf9f8b26594af8823bc8e0ff119e4cb33a4 /documentation | |
| parent | aadcf56af2937756723d5b7c258f7e120098a7c7 (diff) | |
| download | poky-a9615a233584be0185d1af0fcdc3299b0b99671e.tar.gz | |
sdk-manual: working-projects: properly highlight code code-blocks
There are some blocks containing C code so highlight them as C with the
"c" lexer.
For autotool'ed files, there's no lexer available so "none" will do just
fine.
Finally, there's one Makefile code block so highlight it with the
"makefile" lexer.
(From yocto-docs rev: 6c3802113231393ff02d8ac96418f59cfc4c0124)
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
(cherry picked from commit 10d40604cb4affb17dda2253f82a2422d5a9bcf6)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
| -rw-r--r-- | documentation/sdk-manual/working-projects.rst | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/documentation/sdk-manual/working-projects.rst b/documentation/sdk-manual/working-projects.rst index ceae1fedd5..d64dae435f 100644 --- a/documentation/sdk-manual/working-projects.rst +++ b/documentation/sdk-manual/working-projects.rst | |||
| @@ -56,7 +56,9 @@ project: | |||
| 56 | Create the remaining | 56 | Create the remaining |
| 57 | three files as follows: | 57 | three files as follows: |
| 58 | 58 | ||
| 59 | - ``hello.c``:: | 59 | - ``hello.c``: |
| 60 | |||
| 61 | .. code-block:: c | ||
| 60 | 62 | ||
| 61 | #include <stdio.h> | 63 | #include <stdio.h> |
| 62 | 64 | ||
| @@ -66,7 +68,9 @@ project: | |||
| 66 | return 0; | 68 | return 0; |
| 67 | } | 69 | } |
| 68 | 70 | ||
| 69 | - ``configure.ac``:: | 71 | - ``configure.ac``: |
| 72 | |||
| 73 | .. code-block:: none | ||
| 70 | 74 | ||
| 71 | AC_INIT(hello,0.1) | 75 | AC_INIT(hello,0.1) |
| 72 | AM_INIT_AUTOMAKE([foreign]) | 76 | AM_INIT_AUTOMAKE([foreign]) |
| @@ -74,7 +78,9 @@ project: | |||
| 74 | AC_CONFIG_FILES(Makefile) | 78 | AC_CONFIG_FILES(Makefile) |
| 75 | AC_OUTPUT | 79 | AC_OUTPUT |
| 76 | 80 | ||
| 77 | - ``Makefile.am``:: | 81 | - ``Makefile.am``: |
| 82 | |||
| 83 | .. code-block:: none | ||
| 78 | 84 | ||
| 79 | bin_PROGRAMS = hello | 85 | bin_PROGRAMS = hello |
| 80 | hello_SOURCES = hello.c | 86 | hello_SOURCES = hello.c |
| @@ -271,7 +277,9 @@ example: | |||
| 271 | 277 | ||
| 272 | Create the three files as follows: | 278 | Create the three files as follows: |
| 273 | 279 | ||
| 274 | - ``main.c``:: | 280 | - ``main.c``: |
| 281 | |||
| 282 | .. code-block:: c | ||
| 275 | 283 | ||
| 276 | #include "module.h" | 284 | #include "module.h" |
| 277 | void sample_func(); | 285 | void sample_func(); |
| @@ -281,12 +289,16 @@ example: | |||
| 281 | return 0; | 289 | return 0; |
| 282 | } | 290 | } |
| 283 | 291 | ||
| 284 | - ``module.h``:: | 292 | - ``module.h``: |
| 293 | |||
| 294 | .. code-block:: c | ||
| 285 | 295 | ||
| 286 | #include <stdio.h> | 296 | #include <stdio.h> |
| 287 | void sample_func(); | 297 | void sample_func(); |
| 288 | 298 | ||
| 289 | - ``module.c``:: | 299 | - ``module.c``: |
| 300 | |||
| 301 | .. code-block:: c | ||
| 290 | 302 | ||
| 291 | #include "module.h" | 303 | #include "module.h" |
| 292 | void sample_func() | 304 | void sample_func() |
| @@ -321,7 +333,9 @@ example: | |||
| 321 | two lines that can be used to set the :term:`CC` variable. One line is | 333 | two lines that can be used to set the :term:`CC` variable. One line is |
| 322 | identical to the value that is set when you run the SDK environment | 334 | identical to the value that is set when you run the SDK environment |
| 323 | setup script, and the other line sets :term:`CC` to "gcc", the default | 335 | setup script, and the other line sets :term:`CC` to "gcc", the default |
| 324 | GNU compiler on the build host:: | 336 | GNU compiler on the build host: |
| 337 | |||
| 338 | .. code-block:: Makefile | ||
| 325 | 339 | ||
| 326 | # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux | 340 | # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux |
| 327 | # CC="gcc" | 341 | # CC="gcc" |
