It is often necessary to enable or disable various functions at
compilation time, for example, to test dependencies. In RIOT, features
are activated using the module concept:
USEMODULE + = feature
I'm wondering whether there is a possibility to enable modules without
changing the makefile when the make command is called, for example:
make BOARD=... USE_MODULES="sdcard_spi mrf24j40"
I was looking through the documentation and the makefile structure for
something like
USEMODULE += $(USE_MODULES)
Did I miss something? If it is not possible, would it be worth to
realize it?
Of course it is possible to do it from command-line. You were pretty close, but you don’t need an intermediate variable. Just set the variable USEMODULE in your environment:
In case anyone stumbles across this thread in the future:
The difference is that giving a variable on the command line to make will cause that variable to become immutable by the makefiles, which means that it will not be updated by the USEMODULE += module commands in the makefiles (unless the special command “override USEMODULE” is used in the makefile).
So the easy solution is to only set it in the environment and not on the command line.