From 9909cdfffd0d0738390c59cbc1b5db2a5f4b9d4f Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Thu, 25 Jun 2020 09:55:37 +0200 Subject: [PATCH 1/2] dist/buildsystem_sanity_check: no USEMODULE in Makefile.include --- dist/tools/buildsystem_sanity_check/check.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index e4d89c5a54..a4dd0a2170 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -288,6 +288,21 @@ check_no_pseudomodules_in_makefile_dep() { | error_with_message "Don't define PSEUDOMODULES in Makefile.dep" } +check_no_usemodules_in_makefile_include() { + local patterns=() + local pathspec=() + + patterns+=(-e 'USEMODULE[\t ]*[+:]*=') + + pathspec+=('**/Makefile.include') + pathspec+=(':!Makefile.include') + pathspec+=(':!tests/**/Makefile.include') + pathspec+=(':!examples/**/Makefile.include') + + git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" \ + | error_with_message "Don't include USEMODULE in Makefile.include" +} + error_on_input() { ! grep '' } @@ -305,6 +320,7 @@ all_checks() { checks_develhelp_not_defined_via_cflags check_files_in_boards_not_reference_board_var check_no_pseudomodules_in_makefile_dep + check_no_usemodules_in_makefile_include } main() { From e7a8c58de48b14447c4af92514bad6eadc5bfce1 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Thu, 25 Jun 2020 09:34:11 +0200 Subject: [PATCH 2/2] sys/arduino: include arduino_sketches in Makefile.dep --- sys/Makefile.dep | 2 ++ sys/arduino/Makefile.include | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/Makefile.dep b/sys/Makefile.dep index c5f1fb13a0..242f40b1d9 100644 --- a/sys/Makefile.dep +++ b/sys/Makefile.dep @@ -2,6 +2,8 @@ ifneq (,$(filter arduino,$(USEMODULE))) FEATURES_OPTIONAL += periph_i2c FEATURES_OPTIONAL += periph_spi FEATURES_REQUIRED += periph_uart + SKETCH_MODULE ?= arduino_sketches + USEMODULE += $(SKETCH_MODULE) endif ifneq (,$(filter eepreg,$(USEMODULE))) diff --git a/sys/arduino/Makefile.include b/sys/arduino/Makefile.include index 6549d6c396..16e404ff14 100644 --- a/sys/arduino/Makefile.include +++ b/sys/arduino/Makefile.include @@ -4,14 +4,16 @@ SKETCHES = $(wildcard $(APPDIR)/*.sketch) ifneq (,$(SKETCHES)) # Define application sketches module, it will be generated into $(BINDIR) - SKETCH_MODULE ?= arduino_sketches SKETCH_MODULE_DIR ?= $(BINDIR)/$(SKETCH_MODULE) include $(RIOTBASE)/sys/arduino/sketches.inc.mk # Depends on module - USEMODULE += $(SKETCH_MODULE) DIRS += $(SKETCH_MODULE_DIR) BUILDDEPS += $(SKETCH_GENERATED_FILES) +else + # arduino_sketches is now always included if arduino is, but if there + # are no sketches then no %.a will be present, so declare PSEUDOMODULE + PSEUDOMODULES += $(SKETCH_MODULE) endif # include the Arduino headers