Skip to content
Snippets Groups Projects
Unverified Commit 6b534a93 authored by Gaëtan Harter's avatar Gaëtan Harter
Browse files

make: process include and dep for external modules

Process `Makefile.include` for external modules. It is included after the others
so it could overwrite some of the configuration if wanted.

Process `Makefile.dep` for external modules. It is included before the others so
it could be parsed before setting 'default' values to dependencies.
parent 2260cd7f
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,10 @@ OLD_USEPKG := $(sort $(USEPKG)) ...@@ -5,6 +5,10 @@ OLD_USEPKG := $(sort $(USEPKG))
# include board dependencies # include board dependencies
-include $(RIOTBOARD)/$(BOARD)/Makefile.dep -include $(RIOTBOARD)/$(BOARD)/Makefile.dep
# include external modules dependencies
# processed before RIOT ones to be evaluated before the 'default' rules.
-include $(EXTERNAL_MODULE_DIRS:%=%/Makefile.dep)
# pull dependencies from sys and drivers # pull dependencies from sys and drivers
include $(RIOTBASE)/sys/Makefile.dep include $(RIOTBASE)/sys/Makefile.dep
include $(RIOTBASE)/drivers/Makefile.dep include $(RIOTBASE)/drivers/Makefile.dep
......
...@@ -353,6 +353,9 @@ $(RIOTPKG)/%/Makefile.include:: ...@@ -353,6 +353,9 @@ $(RIOTPKG)/%/Makefile.include::
$(USEPKG:%=$(RIOTPKG)/%/Makefile.include): FORCE $(USEPKG:%=$(RIOTPKG)/%/Makefile.include): FORCE
-include $(USEPKG:%=$(RIOTPKG)/%/Makefile.include) -include $(USEPKG:%=$(RIOTPKG)/%/Makefile.include)
# include external modules configuration
-include $(EXTERNAL_MODULE_DIRS:%=%/Makefile.include)
# Deduplicate includes without sorting them # Deduplicate includes without sorting them
# see https://stackoverflow.com/questions/16144115/makefile-remove-duplicate-words-without-sorting # see https://stackoverflow.com/questions/16144115/makefile-remove-duplicate-words-without-sorting
define uniq define uniq
......
...@@ -67,8 +67,12 @@ their dependencies. ...@@ -67,8 +67,12 @@ their dependencies.
Modules outside of RIOTBASE {#modules-outside-of-riotbase} Modules outside of RIOTBASE {#modules-outside-of-riotbase}
=========================== ===========================
Modules can be defined outside `RIOTBASE`. In addition to add it to `USEMODULE` Modules can be defined outside `RIOTBASE`. In addition to add it to `USEMODULE`
the user needs to add the path to the module to `EXTERNAL_MODULE_DIRS` and add the user needs to add the module path to `EXTERNAL_MODULE_DIRS`.
the include path to the API definitions to `INCLUDES`.
The external module can optionally define the following files:
* `Makefile.include` file to set global build configuration like `CFLAGS` or add
API headers include paths to the `USEMODULE_INCLUDES` variable.
* `Makefile.dep` file to set module dependencies
Pseudomodules {#pseudomodules} Pseudomodules {#pseudomodules}
============= =============
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment