From c64f38ae6d3591e4b94f6ba8659e7ddf30446a14 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 30 May 2013 13:14:20 +0200 Subject: [PATCH] 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. --- arduino-mk/Arduino.mk | 4 ++++ 1 file changed, 4 insertions(+) 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