Skip to content

Commit

Permalink
Makefile.features: assert CPU has been defined by BOARD/Makefile.feat…
Browse files Browse the repository at this point in the history
…ures

CPU must now be defined by `$(RIOTBOARD)/$(BOARD)/Makefile.features` or
one of its common included Makefile.features file.
The cpu `Makefile.dep` file can now automatically be included when it exists.
  • Loading branch information
cladmi committed Oct 1, 2019
1 parent 39a27a8 commit 08d2fae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
8 changes: 2 additions & 6 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ OLD_USEPKG := $(sort $(USEPKG))
# include board dependencies
-include $(RIOTBOARD)/$(BOARD)/Makefile.dep

# Transitional conditional include until all boards define 'CPU' in
# Makefile.features
ifneq (,$(CPU))
# include cpu dependencies
-include $(RIOTCPU)/$(CPU)/Makefile.dep
endif
# include cpu dependencies
-include $(RIOTCPU)/$(CPU)/Makefile.dep

# include external modules dependencies
# processed before RIOT ones to be evaluated before the 'default' rules.
Expand Down
14 changes: 5 additions & 9 deletions Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
# This makes them available when setting features based on CPU_MODEL in the cpu
# Makefile.features and also during dependency resolution.

# Transition:
# Moving 'CPU/CPU_MODEL' to Makefile.features is an ongoing work and may not
# reflect the state of all boards for the moment.

include $(RIOTBOARD)/$(BOARD)/Makefile.features

# Transitional conditional include until all boards define 'CPU'
ifneq (,$(CPU))
include $(RIOTCPU)/$(CPU)/Makefile.features
else
$(warning CPU must be defined by board / board_common Makefile.features)
# Sanity check
ifeq (,$(CPU))
$(error CPU must be defined by board / board_common Makefile.features)
endif

include $(RIOTCPU)/$(CPU)/Makefile.features


# Resolve FEATURES_ variables
# Their value will only be complete after resolving dependencies
Expand Down
7 changes: 0 additions & 7 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,6 @@ include $(RIOTBOARD)/$(BOARD)/Makefile.include
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
include $(RIOTCPU)/$(CPU)/Makefile.include

# Sanity check
# The check is only done after 'include $(RIOTBOARD)/$(BOARD)/Makefile.include'
# because we need to have the 'CPU' variable defined
ifeq (,$(filter $(RIOTCPU)/$(CPU)/Makefile.features,$(MAKEFILE_LIST)))
$(error $$(RIOTCPU)/$$(CPU)/Makefile.features must have been included by the board / board common Makefile.features or Makefile.features)
endif

# Assume GCC/GNU as supported toolchain if CPU's Makefile.include doesn't
# provide this macro
TOOLCHAINS_SUPPORTED ?= gnu
Expand Down

0 comments on commit 08d2fae

Please sign in to comment.