From 00db932aed3676d58fcaa41039ea1a1cfdc96074 Mon Sep 17 00:00:00 2001 From: crasbe Date: Thu, 8 May 2025 14:52:03 +0200 Subject: [PATCH] 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. --- doc/doxygen/src/creating-an-application.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/doxygen/src/creating-an-application.md b/doc/doxygen/src/creating-an-application.md index 837fcca05f..768b4c84da 100644 --- a/doc/doxygen/src/creating-an-application.md +++ b/doc/doxygen/src/creating-an-application.md @@ -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