aboutsummaryrefslogtreecommitdiff
path: root/arduino-mk/Arduino.mk
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2013-05-30 13:14:20 +0200
committerMatthijs Kooijman <matthijs@stdin.nl>2013-05-30 13:14:20 +0200
commitc64f38ae6d3591e4b94f6ba8659e7ddf30446a14 (patch)
treee83072c4b088d28f291d2026af8fcf85fd81e51a /arduino-mk/Arduino.mk
parente1bed904043a79611768a8f98e32d7b79bafb3b3 (diff)
Check that there is exactly one .pde or .ino file
When there are none (and no .cpp files either), the build would stall trying to cat all the .d files together (which would result in cat getting no arguments and thus waiting for input on stdin). When there are multiple .ino and/or .pde files, the build could technically work out, the Arduino IDE concatenates all .ino / .pde files together and compiles them as a single compile unit, so unless we implement that as well, it's better to just error out.
Diffstat (limited to 'arduino-mk/Arduino.mk')
-rw-r--r--arduino-mk/Arduino.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk
index aed16d6..79878f6 100644
--- a/arduino-mk/Arduino.mk
+++ b/arduino-mk/Arduino.mk
@@ -619,6 +619,10 @@ LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES))
# Dependency files
DEPS = $(LOCAL_OBJS:.o=.d)
+ifneq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 1)
+ $(error Need exactly one .pde or .ino file)
+endif
+
# core sources
ifeq ($(strip $(NO_CORE)),)
ifdef ARDUINO_CORE_PATH