Browse Source

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`.
dev/timer
René Kijewski 8 years ago
parent
commit
765c88d08a
  1. 4
      Makefile.buildtests
  2. 8
      Makefile.include
  3. 2
      boards/arduino-due/Makefile.features
  4. 2
      boards/arduino-mega2560/Makefile.features
  5. 2
      boards/avsextrem/Makefile.features
  6. 2
      boards/cc2538dk/Makefile.features
  7. 2
      boards/iot-lab_M3/Makefile.features
  8. 2
      boards/msb-430h/Makefile.features
  9. 2
      boards/msba2/Makefile.features
  10. 2
      boards/msbiot/Makefile.features
  11. 2
      boards/native/Makefile.features
  12. 2
      boards/openmote/Makefile.features
  13. 2
      boards/pca10000/Makefile.features
  14. 2
      boards/pca10005/Makefile.features
  15. 2
      boards/pttu/Makefile.features
  16. 2
      boards/redbee-econotag/Makefile.features
  17. 2
      boards/samr21-xpro/Makefile.features
  18. 2
      boards/stm32f0discovery/Makefile.features
  19. 2
      boards/stm32f3discovery/Makefile.features
  20. 2
      boards/stm32f4discovery/Makefile.features
  21. 2
      boards/telosb/Makefile.features
  22. 2
      boards/udoo/Makefile.features
  23. 2
      boards/wsn430-v1_3b/Makefile.features
  24. 2
      boards/wsn430-v1_4/Makefile.features
  25. 2
      boards/yunjia-nrf51822/Makefile.features
  26. 2
      boards/z1/Makefile.features

4
Makefile.buildtests

@ -173,7 +173,7 @@ info-build:
@echo ' $(or $(sort $(filter-out $(FEATURES_OPTIONAL), $(FEATURES_REQUIRED))), -none-)'
@echo 'FEATURES_OPTIONAL (strictly "nice to have"):'
@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 'FEATURES_MISSING (incl. optional features):'
@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)
define board_missing_features
FEATURES_PROVIDED :=
FEATURES_PROVIDED := $(FEATURES_PROVIDED_BAK)
-include $${RIOTBOARD}/${1}/Makefile.features
FEATURES_MISSING := $$(filter-out $$(FEATURES_PROVIDED), $$(FEATURES_REQUIRED))

8
Makefile.include

@ -77,9 +77,6 @@ ifeq ($(strip $(MCU)),)
MCU = $(CPU)
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
BOARDDEF := $(shell echo $(BOARD) | 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.
include $(RIOTBASE)/Makefile.buildtests
# import list of provided features
-include $(RIOTBOARD)/$(BOARD)/Makefile.features
# Export variables used throughout the whole make system:
include $(RIOTBASE)/Makefile.vars
# Warn if the selected board and drivers don't provide all needed featues:
ifneq (, $(filter all, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
EXPECT_ERRORS :=
# Test if there where dependencies against a module in DISABLE_MODULE.

2
boards/arduino-due/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio periph_spi periph_random
FEATURES_PROVIDED += periph_gpio periph_spi periph_random

2
boards/arduino-mega2560/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED =
FEATURES_PROVIDED +=

2
boards/avsextrem/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver
FEATURES_PROVIDED += transceiver

2
boards/cc2538dk/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio periph_random periph_cpuid
FEATURES_PROVIDED += periph_gpio periph_random periph_cpuid

2
boards/iot-lab_M3/Makefile.features

@ -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

2
boards/msb-430h/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver
FEATURES_PROVIDED += transceiver

2
boards/msba2/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver periph_pwm
FEATURES_PROVIDED += transceiver periph_pwm

2
boards/msbiot/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio
FEATURES_PROVIDED += periph_gpio

2
boards/native/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver periph_cpuid
FEATURES_PROVIDED += transceiver periph_cpuid

2
boards/openmote/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio periph_random periph_cpuid
FEATURES_PROVIDED += periph_gpio periph_random periph_cpuid

2
boards/pca10000/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid
FEATURES_PROVIDED += periph_gpio periph_random periph_rtt periph_cpuid

2
boards/pca10005/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid
FEATURES_PROVIDED += periph_gpio periph_random periph_rtt periph_cpuid

2
boards/pttu/Makefile.features

@ -1,2 +1,2 @@
# Enable this after fixing https://github.com/RIOT-OS/RIOT/issues/659
#FEATURES_PROVIDED = transceiver
#FEATURES_PROVIDED += transceiver

2
boards/redbee-econotag/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver
FEATURES_PROVIDED += transceiver

2
boards/samr21-xpro/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio
FEATURES_PROVIDED += periph_gpio

2
boards/stm32f0discovery/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio periph_spi
FEATURES_PROVIDED += periph_gpio periph_spi

2
boards/stm32f3discovery/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio
FEATURES_PROVIDED += periph_gpio

2
boards/stm32f4discovery/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio periph_spi periph_pwm periph_random
FEATURES_PROVIDED += periph_gpio periph_spi periph_pwm periph_random

2
boards/telosb/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver
FEATURES_PROVIDED += transceiver

2
boards/udoo/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio
FEATURES_PROVIDED += periph_gpio

2
boards/wsn430-v1_3b/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver
FEATURES_PROVIDED += transceiver

2
boards/wsn430-v1_4/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver
FEATURES_PROVIDED += transceiver

2
boards/yunjia-nrf51822/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid
FEATURES_PROVIDED += periph_gpio periph_random periph_rtt periph_cpuid

2
boards/z1/Makefile.features

@ -1 +1 @@
FEATURES_PROVIDED = transceiver
FEATURES_PROVIDED += transceiver

Loading…
Cancel
Save