make: allow drivers to implement features
This change allows drivers (or any module for that matter) to provide
features. This is e.g. useful if a board does not have a transceiver,
but your application uses `USEMODULE += some_driver`, which implements
the transceiver interface.
The line `FEATURES_PROVIDED += some_feature` should go to the guarded
block in `{sys,drivers}/Makefile.include`.
This commit is contained in:
parent
938d7d441b
commit
765c88d08a
@ -173,7 +173,7 @@ info-build:
|
|||||||
@echo ' $(or $(sort $(filter-out $(FEATURES_OPTIONAL), $(FEATURES_REQUIRED))), -none-)'
|
@echo ' $(or $(sort $(filter-out $(FEATURES_OPTIONAL), $(FEATURES_REQUIRED))), -none-)'
|
||||||
@echo 'FEATURES_OPTIONAL (strictly "nice to have"):'
|
@echo 'FEATURES_OPTIONAL (strictly "nice to have"):'
|
||||||
@echo ' $(or $(sort $(FEATURES_OPTIONAL)), -none-)'
|
@echo ' $(or $(sort $(FEATURES_OPTIONAL)), -none-)'
|
||||||
@echo 'FEATURES_PROVIDED (by the board):'
|
@echo 'FEATURES_PROVIDED (by the board or USEMODULE'"'"'d drivers):'
|
||||||
@echo ' $(or $(sort $(FEATURES_PROVIDED)), -none-)'
|
@echo ' $(or $(sort $(FEATURES_PROVIDED)), -none-)'
|
||||||
@echo 'FEATURES_MISSING (incl. optional features):'
|
@echo 'FEATURES_MISSING (incl. optional features):'
|
||||||
@echo ' $(or $(sort $(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED))), -none-)'
|
@echo ' $(or $(sort $(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED))), -none-)'
|
||||||
@ -229,7 +229,7 @@ ifneq (, $(filter info-boards-supported info-boards-features-missing info-build,
|
|||||||
FEATURES_PROVIDED_BAK := $(FEATURES_PROVIDED)
|
FEATURES_PROVIDED_BAK := $(FEATURES_PROVIDED)
|
||||||
|
|
||||||
define board_missing_features
|
define board_missing_features
|
||||||
FEATURES_PROVIDED :=
|
FEATURES_PROVIDED := $(FEATURES_PROVIDED_BAK)
|
||||||
-include $${RIOTBOARD}/${1}/Makefile.features
|
-include $${RIOTBOARD}/${1}/Makefile.features
|
||||||
|
|
||||||
FEATURES_MISSING := $$(filter-out $$(FEATURES_PROVIDED), $$(FEATURES_REQUIRED))
|
FEATURES_MISSING := $$(filter-out $$(FEATURES_PROVIDED), $$(FEATURES_REQUIRED))
|
||||||
|
|||||||
@ -77,9 +77,6 @@ ifeq ($(strip $(MCU)),)
|
|||||||
MCU = $(CPU)
|
MCU = $(CPU)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# import list of provided features
|
|
||||||
-include $(RIOTBOARD)/$(BOARD)/Makefile.features
|
|
||||||
|
|
||||||
# if you want to publish the board into the sources as an uppercase #define
|
# if you want to publish the board into the sources as an uppercase #define
|
||||||
BOARDDEF := $(shell echo $(BOARD) | tr 'a-z' 'A-Z' | tr '-' '_')
|
BOARDDEF := $(shell echo $(BOARD) | tr 'a-z' 'A-Z' | tr '-' '_')
|
||||||
CPUDEF := $(shell echo $(CPU) | tr 'a-z' 'A-Z' | tr '-' '_')
|
CPUDEF := $(shell echo $(CPU) | tr 'a-z' 'A-Z' | tr '-' '_')
|
||||||
@ -205,10 +202,15 @@ objdump:
|
|||||||
# Extra make goals for testing and comparing changes.
|
# Extra make goals for testing and comparing changes.
|
||||||
include $(RIOTBASE)/Makefile.buildtests
|
include $(RIOTBASE)/Makefile.buildtests
|
||||||
|
|
||||||
|
# import list of provided features
|
||||||
|
-include $(RIOTBOARD)/$(BOARD)/Makefile.features
|
||||||
|
|
||||||
# Export variables used throughout the whole make system:
|
# Export variables used throughout the whole make system:
|
||||||
include $(RIOTBASE)/Makefile.vars
|
include $(RIOTBASE)/Makefile.vars
|
||||||
|
|
||||||
|
# Warn if the selected board and drivers don't provide all needed featues:
|
||||||
ifneq (, $(filter all, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
|
ifneq (, $(filter all, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
|
||||||
|
|
||||||
EXPECT_ERRORS :=
|
EXPECT_ERRORS :=
|
||||||
|
|
||||||
# Test if there where dependencies against a module in DISABLE_MODULE.
|
# Test if there where dependencies against a module in DISABLE_MODULE.
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio periph_spi periph_random
|
FEATURES_PROVIDED += periph_gpio periph_spi periph_random
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED =
|
FEATURES_PROVIDED +=
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver
|
FEATURES_PROVIDED += transceiver
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio periph_random periph_cpuid
|
FEATURES_PROVIDED += periph_gpio periph_random periph_cpuid
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver periph_gpio periph_uart periph_spi periph_i2c periph_rtt
|
FEATURES_PROVIDED += transceiver periph_gpio periph_uart periph_spi periph_i2c periph_rtt
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver
|
FEATURES_PROVIDED += transceiver
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver periph_pwm
|
FEATURES_PROVIDED += transceiver periph_pwm
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio
|
FEATURES_PROVIDED += periph_gpio
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver periph_cpuid
|
FEATURES_PROVIDED += transceiver periph_cpuid
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio periph_random periph_cpuid
|
FEATURES_PROVIDED += periph_gpio periph_random periph_cpuid
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid
|
FEATURES_PROVIDED += periph_gpio periph_random periph_rtt periph_cpuid
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid
|
FEATURES_PROVIDED += periph_gpio periph_random periph_rtt periph_cpuid
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
# Enable this after fixing https://github.com/RIOT-OS/RIOT/issues/659
|
# Enable this after fixing https://github.com/RIOT-OS/RIOT/issues/659
|
||||||
#FEATURES_PROVIDED = transceiver
|
#FEATURES_PROVIDED += transceiver
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver
|
FEATURES_PROVIDED += transceiver
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio
|
FEATURES_PROVIDED += periph_gpio
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio periph_spi
|
FEATURES_PROVIDED += periph_gpio periph_spi
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio
|
FEATURES_PROVIDED += periph_gpio
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio periph_spi periph_pwm periph_random
|
FEATURES_PROVIDED += periph_gpio periph_spi periph_pwm periph_random
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver
|
FEATURES_PROVIDED += transceiver
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio
|
FEATURES_PROVIDED += periph_gpio
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver
|
FEATURES_PROVIDED += transceiver
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver
|
FEATURES_PROVIDED += transceiver
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid
|
FEATURES_PROVIDED += periph_gpio periph_random periph_rtt periph_cpuid
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
FEATURES_PROVIDED = transceiver
|
FEATURES_PROVIDED += transceiver
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user