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