Skip to content

Commit 00db932

Browse files
committed
doc/creating-an-app: add section about Makefile.board.dep
The existance of the `Makefile.board.dep` files in application directories was previously undocumented, but used throughout the RIOT example applications.
1 parent 96e202f commit 00db932

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,28 @@ Makefile wildcards.
106106

107107
Both approaches are illustrated and explained in `examples/basic/subfolders`.
108108

109+
## Setting Board-specific Dependencies
110+
111+
Required dependencies of applications may change depending on the
112+
target board or architecture. This is especially
113+
relevant for networking applications where multiple hardware implementations
114+
exist and the appropriate one has to be chosen for the given board
115+
or architecture.
116+
To achieve this task elegantly, a `Makefile.board.dep` file can be
117+
created in the application folder, which is automatically included and
118+
evaluated by RIOT build system during the dependency resolution phase.
119+
This ensures that all the relevant variables such as `FEATURES_USED` or the
120+
`USEMODULE` list are fully populated.
121+
122+
~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.mk}
123+
ifneq (,$(filter arch_esp,$(FEATURES_USED)))
124+
USEMODULE += esp_wifi
125+
endif
126+
127+
ifneq (,$(filter native native32 native64,$(BOARD)))
128+
USEMODULE += netdev_default
129+
endif
130+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
109131

110132
# Helper tools
111133

0 commit comments

Comments
 (0)