1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #9081 from kaspar030/add_arch_features

make: add architecture features and feature blacklisting
This commit is contained in:
Kaspar Schleiser 2019-10-14 16:12:54 +02:00 committed by GitHub
commit 8a1e78bf4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 42 additions and 37 deletions

View File

@ -979,6 +979,8 @@ FEATURES_OPTIONAL += periph_pm
# include package dependencies
-include $(USEPKG:%=$(RIOTPKG)/%/Makefile.dep)
# always select provided architecture features
FEATURES_REQUIRED += $(filter arch_%,$(FEATURES_PROVIDED))
# all periph features correspond to a periph submodule
# FEATURES_USED is defined in Makefile.features

View File

@ -22,9 +22,11 @@ endif
# Resolve FEATURES_ variables
# Their value will only be complete after resolving dependencies
# Features that are required by the application but not provided by the BSP
# Features that are required by the application but not provided by the BSP and
# features that are used but blacklisted (prepended with "!").
# Having features missing may case the build to fail.
FEATURES_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_REQUIRED)))
FEATURES_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_REQUIRED)) \
$(call _features_used_blacklisted))
# Features that are only optional and not required at the same time.
# The policy is to by default use by features if they are provided by the BSP.
@ -47,3 +49,7 @@ _features_conflicting = $(if $(call _features_used_conflicting,$(subst :, ,$1)),
# $1: list of features that conflict together
# Return non empty on error
_features_used_conflicting = $(filter $(words $1),$(words $(filter $(FEATURES_USED),$1)))
# Return features that are used but blacklisted as
# "!<feature>" ("not feature")
_features_used_blacklisted = $(addprefix !,$(sort $(filter $(FEATURES_USED), $(FEATURES_BLACKLIST))))

View File

@ -732,6 +732,9 @@ ifneq (, $(filter all flash, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
EXPECT_ERRORS := 1
endif
# turn provided but blacklisted features into required "!<feature>"
FEATURES_REQUIRED += $(addprefix !,$(sort $(filter $(FEATURES_PROVIDED), $(FEATURES_BLACKLIST))))
# Test if all feature requirements were met by the selected board.
ifneq (,$(FEATURES_MISSING))
$(shell $(COLOR_ECHO) "$(COLOR_RED)There are unsatisfied feature requirements:$(COLOR_RESET)"\

View File

@ -1,2 +1,5 @@
FEATURES_PROVIDED += arch_32bit
FEATURES_PROVIDED += arch_arm
FEATURES_PROVIDED += arch_arm7
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_pm

View File

@ -1,4 +1,5 @@
FEATURES_PROVIDED += arch_8bit
FEATURES_PROVIDED += arch_avr8
FEATURES_PROVIDED += atmega_pcint0
FEATURES_PROVIDED += periph_eeprom
FEATURES_PROVIDED += periph_pm
FEATURES_PROVIDED += atmega_pcint0

View File

@ -1,3 +1,6 @@
FEATURES_PROVIDED += arch_32bit
FEATURES_PROVIDED += arch_arm
FEATURES_PROVIDED += arch_cortexm
FEATURES_PROVIDED += periph_pm
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += cpu_check_address

View File

@ -1,4 +1,5 @@
# Features that are provided by the CPU independent on the board
FEATURES_PROVIDED += arch_32bit
FEATURES_PROVIDED += arch_esp32
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_hwrng

View File

@ -1,5 +1,7 @@
# MCU defined features that are provided independent on board definitions
FEATURES_PROVIDED += arch_32bit
FEATURES_PROVIDED += arch_esp8266
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_hwrng
FEATURES_PROVIDED += periph_pm

View File

@ -1,2 +1,4 @@
FEATURES_PROVIDED += arch_32bit
FEATURES_PROVIDED += arch_mips32r2
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_pm

View File

@ -1,2 +1,4 @@
FEATURES_PROVIDED += arch_16bit
FEATURES_PROVIDED += arch_msp430
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_pm

View File

@ -1,3 +1,5 @@
FEATURES_PROVIDED += arch_32bit
FEATURES_PROVIDED += arch_native
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_hwrng

View File

@ -9,6 +9,7 @@ FEATURES_CONFLICT_GLOBAL := $(FEATURES_CONFLICT)
FEATURES_CONFLICT_MSG_GLOBAL := $(FEATURES_MSG_CONFLICT)
DISABLE_MODULE_GLOBAL := $(DISABLE_MODULE)
DEFAULT_MODULE_GLOBAL := $(DEFAULT_MODULE)
FEATURES_BLACKLIST_GLOBAL := $(FEATURES_BLACKLIST)
define board_missing_features
BOARD := $(1)
@ -20,6 +21,7 @@ define board_missing_features
FEATURES_OPTIONAL := $(FEATURES_OPTIONAL_GLOBAL)
FEATURES_CONFLICT := $(FEATURES_CONFLICT_GLOBAL)
FEATURES_CONFLICT_MSG := $(FEATURES_CONFLICT_MSG_GLOBAL)
FEATURES_BLACKLIST:= $(FEATURES_BLACKLIST_GLOBAL)
# Remove board specific variables set by Makefile.features/Makefile.dep
FEATURES_PROVIDED :=

View File

@ -60,6 +60,8 @@ info-build:
@echo ' $(or $(sort $(FEATURES_PROVIDED)), -none-)'
@echo 'FEATURES_MISSING (only non optional features):'
@echo ' $(or $(FEATURES_MISSING), -none-)'
@echo 'FEATURES_BLACKLIST (blacklisted features):'
@echo ' $(or $(sort $(FEATURES_BLACKLIST)), -none-)'
@echo ''
@echo 'FEATURES_CONFLICT: $(FEATURES_CONFLICT)'
@echo 'FEATURES_CONFLICT_MSG: $(FEATURES_CONFLICT_MSG)'

6
pkg/lwip/Makefile.dep Normal file
View File

@ -0,0 +1,6 @@
# lwIP's memory management doesn't seem to work on non 32-bit platforms at the
# moment.
FEATURES_REQUIRED += arch_32bit
# lwip currently doesn't compile on esp8266
FEATURES_BLACKLIST += arch_esp8266

View File

@ -1,13 +1,5 @@
include ../Makefile.tests_common
# lwIP's memory management doesn't seem to work on non 32-bit platforms at the
# moment.
BOARD_BLACKLIST := arduino-duemilanove arduino-leonardo \
arduino-mega2560 arduino-nano \
arduino-uno chronos esp8266-esp-12x esp8266-olimex-mod \
esp8266-sparkfun-thing mega-xplained \
msb-430 msb-430h telosb waspmote-pro \
wsn430-v1_3b wsn430-v1_4 z1
BOARD_INSUFFICIENT_MEMORY := airfy-beacon hifive1 hifive1b i-nucleo-lrwan1 nrf6310 \
nucleo-f031k6 nucleo-f042k6 \
nucleo-l031k6 nucleo-f030r8 nucleo-f303k8 \

View File

@ -1,13 +1,5 @@
include ../Makefile.tests_common
# lwIP's memory management doesn't seem to work on non 32-bit platforms at the
# moment.
BOARD_BLACKLIST := arduino-duemilanove arduino-leonardo \
arduino-mega2560 arduino-nano \
arduino-uno chronos esp8266-esp-12x esp8266-olimex-mod \
esp8266-sparkfun-thing mega-xplained \
msb-430 msb-430h telosb waspmote-pro \
wsn430-v1_3b wsn430-v1_4 z1
BOARD_INSUFFICIENT_MEMORY = i-nucleo-lrwan1 nucleo-f031k6 nucleo-f042k6 \
nucleo-l031k6 nucleo-f030r8 nucleo-f303k8 \
nucleo-f334r8 nucleo-l053r8 stm32f0discovery \

View File

@ -1,13 +1,5 @@
include ../Makefile.tests_common
# lwIP's memory management doesn't seem to work on non 32-bit platforms at the
# moment.
BOARD_BLACKLIST := arduino-duemilanove arduino-leonardo \
arduino-mega2560 arduino-nano \
arduino-uno chronos esp8266-esp-12x esp8266-olimex-mod \
esp8266-sparkfun-thing mega-xplained \
msb-430 msb-430h telosb waspmote-pro \
wsn430-v1_3b wsn430-v1_4 z1
BOARD_INSUFFICIENT_MEMORY = blackpill bluepill i-nucleo-lrwan1 \
nucleo-f031k6 nucleo-f042k6 \
nucleo-l031k6 nucleo-f030r8 nucleo-f302r8 \

View File

@ -1,13 +1,5 @@
include ../Makefile.tests_common
# lwIP's memory management doesn't seem to work on non 32-bit platforms at the
# moment.
BOARD_BLACKLIST := arduino-duemilanove arduino-leonardo \
arduino-mega2560 arduino-nano \
arduino-uno chronos esp8266-esp-12x esp8266-olimex-mod \
esp8266-sparkfun-thing mega-xplained \
msb-430 msb-430h telosb waspmote-pro \
wsn430-v1_3b wsn430-v1_4 z1
BOARD_INSUFFICIENT_MEMORY = i-nucleo-lrwan1 nucleo-f031k6 nucleo-f042k6 \
nucleo-l031k6 nucleo-f030r8 \
nucleo-f303k8 nucleo-f334r8 nucleo-l053r8 \