mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #1879 from Kijewski/issue-1876
make: fix `FEATURES_REQUIRED` and `FEATURES_PROVIDED` a bit
This commit is contained in:
commit
1fc5bd46a2
@ -169,8 +169,16 @@ info-build:
|
||||
@echo 'ELFFILE: $(ELFFILE)'
|
||||
@echo 'HEXFILE: $(HEXFILE)'
|
||||
@echo ''
|
||||
@echo 'FEATURES_REQUIRED: $(sort $(FEATURES_REQUIRED))'
|
||||
@echo 'FEATURES_PROVIDED: $(sort $(FEATURES_PROVIDED))'
|
||||
@echo 'FEATURES_REQUIRED (excl. optional features):'
|
||||
@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 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-)'
|
||||
@echo 'FEATURES_MISSING (only non-optional features):'
|
||||
@echo ' $(or $(sort $(filter-out $(FEATURES_OPTIONAL) $(FEATURES_PROVIDED), $(FEATURES_REQUIRED))), -none-)'
|
||||
@echo ''
|
||||
@echo 'CC: $(CC)'
|
||||
@echo -e 'CFLAGS:$(patsubst %, \n\t%, $(CFLAGS))'
|
||||
@ -215,17 +223,22 @@ info-features-missing:
|
||||
info-boards-features-missing:
|
||||
@for f in $(BOARDS_FEATURES_MISSING); do echo $${f}; done | column -t
|
||||
|
||||
FEATURES_REQUIRED += $(FEATURES_OPTIONAL)
|
||||
|
||||
ifneq (, $(filter info-boards-supported info-boards-features-missing info-build, $(MAKECMDGOALS)))
|
||||
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))
|
||||
ifneq (, $${FEATURES_MISSING})
|
||||
BOARDS_WITH_MISSING_FEATURES += ${1}
|
||||
BOARDS_FEATURES_MISSING += "${1} $${FEATURES_MISSING}"
|
||||
|
||||
ifneq (, $$(filter-out $$(FEATURES_OPTIONAL), $$(FEATURES_MISSING)))
|
||||
BOARDS_WITH_MISSING_FEATURES += ${1}
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
|
@ -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.
|
||||
@ -219,9 +221,9 @@ ifneq (, $(filter all, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
|
||||
endif
|
||||
|
||||
# Test if all feature requirements were met by the selected board.
|
||||
ifneq (, $(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED)))
|
||||
ifneq (, $(filter-out $(FEATURES_PROVIDED) $(FEATURES_OPTIONAL), $(FEATURES_REQUIRED)))
|
||||
$(shell $(COLOR_ECHO) "$(COLOR_RED)There are unsatisfied feature requirements:$(COLOR_RESET)"\
|
||||
"$(filter-out $(FEATURES_PROVIDED), $(FEATURES_REQUIRED))" 1>&2)
|
||||
"$(sort $(filter-out $(FEATURES_PROVIDED) $(FEATURES_OPTIONAL), $(FEATURES_REQUIRED)))" 1>&2)
|
||||
EXPECT_ERRORS := 1
|
||||
endif
|
||||
|
||||
|
@ -5,6 +5,7 @@ USEMODULE += $(filter-out $(DISABLE_MODULE), $(DEFAULT_MODULE))
|
||||
|
||||
INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include
|
||||
ED = $(patsubst %,-DMODULE_%,$(subst -,_,$(USEMODULE) $(USEPKG)))
|
||||
ED += $(patsubst %,-DFEATURE_%,$(subst -,_,$(filter $(FEATURES_PROVIDED), $(FEATURES_REQUIRED))))
|
||||
EXTDEFINES = $(shell echo $(sort $(ED))|tr 'a-z' 'A-Z')
|
||||
REALMODULES = $(filter-out $(PSEUDOMODULES), $(sort $(USEMODULE)))
|
||||
export BASELIBS += $(REALMODULES:%=$(BINDIR)%.a)
|
||||
|
@ -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
|
||||
#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
|
||||
|
@ -36,6 +36,8 @@ USEMODULE += ps
|
||||
USEMODULE += vtimer
|
||||
USEMODULE += defaulttransceiver
|
||||
|
||||
FEATURES_OPTIONAL += transceiver
|
||||
|
||||
ifneq (,$(filter msb-430,$(BOARD)))
|
||||
USEMODULE += sht11
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user