1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-14 17:13:50 +01:00

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.
This commit is contained in:
crasbe 2025-05-08 14:52:03 +02:00
parent 96e202f2f0
commit 00db932aed

View File

@ -106,6 +106,28 @@ Makefile wildcards.
Both approaches are illustrated and explained in `examples/basic/subfolders`.
## Setting Board-specific Dependencies
Required dependencies of applications may change depending on the
target board or architecture. This is especially
relevant for networking applications where multiple hardware implementations
exist and the appropriate one has to be chosen for the given board
or architecture.
To achieve this task elegantly, a `Makefile.board.dep` file can be
created in the application folder, which is automatically included and
evaluated by RIOT build system during the dependency resolution phase.
This ensures that all the relevant variables such as `FEATURES_USED` or the
`USEMODULE` list are fully populated.
~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.mk}
ifneq (,$(filter arch_esp,$(FEATURES_USED)))
USEMODULE += esp_wifi
endif
ifneq (,$(filter native native32 native64,$(BOARD)))
USEMODULE += netdev_default
endif
~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Helper tools