2017-09-28 12:14:10 +02:00
|
|
|
# Add Arduino sketches to the application as a module
|
2015-09-18 23:00:31 +02:00
|
|
|
|
2019-09-09 01:59:01 +02:00
|
|
|
SKETCHES = $(wildcard $(APPDIR)/*.sketch)
|
2021-06-25 11:46:39 +02:00
|
|
|
SKETCH_MODULE = arduino_sketches
|
2017-09-28 12:14:10 +02:00
|
|
|
|
2019-09-09 01:59:01 +02:00
|
|
|
ifneq (,$(SKETCHES))
|
|
|
|
# Define application sketches module, it will be generated into $(BINDIR)
|
|
|
|
SKETCH_MODULE_DIR ?= $(BINDIR)/$(SKETCH_MODULE)
|
|
|
|
include $(RIOTBASE)/sys/arduino/sketches.inc.mk
|
|
|
|
|
|
|
|
# Depends on module
|
|
|
|
DIRS += $(SKETCH_MODULE_DIR)
|
|
|
|
BUILDDEPS += $(SKETCH_GENERATED_FILES)
|
2020-06-25 09:34:11 +02:00
|
|
|
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)
|
2019-09-09 01:59:01 +02:00
|
|
|
endif
|
2015-09-18 23:00:31 +02:00
|
|
|
|
|
|
|
# include the Arduino headers
|
2016-10-24 11:01:48 +02:00
|
|
|
INCLUDES += -I$(RIOTBASE)/sys/arduino/include
|
2019-10-20 21:47:35 +02:00
|
|
|
|
|
|
|
# Arduino provices C++11, which is not enabled by default in Ubuntu's avr-gcc
|
|
|
|
# package, which is __horrible__ out of date. However, we cannot simply ignore
|
|
|
|
# all Ubuntu users and instead simply manually enable C++11 support
|
|
|
|
CXXEXFLAGS += -std=c++11
|