Skip to content

Commit 518f75f

Browse files
mguetschowplmorange
andcommitted
docs: link to subfolders example in documentation
Co-authored-by: plmorange <[email protected]>
1 parent 66f1f3e commit 518f75f

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

doc/doxygen/src/creating-an-application.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,21 @@ USEMODULE += gnrc_udp
9292

9393
Modules typically pull in all required dependencies.
9494

95+
## Including source files in subfolders
96+
97+
By default, all source files in an application's (or any RIOT module's) directory
98+
are automatically compiled as part of the application. In order to organize source
99+
code in a directory structure, two different approaches can be used:
100+
101+
1. Make each subdirectory a separate RIOT module with a unique name inside its
102+
Makefile, either by adding the directory's path to `DIRS` or with the [out-of-tree
103+
module support](#external-modules).
104+
2. Add the source files within subdirectories to `SRC`, either explicitly or with
105+
Makefile wildcards.
106+
107+
Both approaches are illustrated and explained in `examples/subfolders`.
108+
109+
95110
# Helper tools
96111

97112
To help you start writing an application within RIOT, the build system provides
@@ -210,7 +225,7 @@ configuration (e.g. configuring some of the pins configured as ADC as
210225
additional PWM outputs instead) a copy of the upstream board that is then
211226
customized to the application needs is the best course of action.
212227

213-
## External Modules
228+
## External Modules {#external-modules}
214229

215230
Similar to the external boards, external modules can be written in a similar way
216231
as regular in-tree modules.

examples/subfolders/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Application Example with Subfolders
22

33
This example demonstrates the usage of subfolders in a RIOT application
4-
show-casing two possible approaches: RIOT modules and simple subfolders.
4+
(or in a RIOT module in general) show-casing two possible approaches: RIOT
5+
modules and simple subfolders.
56

67
## Details
78

0 commit comments

Comments
 (0)