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.
This commit is contained in:
Matthijs Kooijman 2013-05-30 13:14:20 +02:00
parent e1bed90404
commit c64f38ae6d

View file

@ -619,6 +619,10 @@ LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES))
# Dependency files # Dependency files
DEPS = $(LOCAL_OBJS:.o=.d) 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 # core sources
ifeq ($(strip $(NO_CORE)),) ifeq ($(strip $(NO_CORE)),)
ifdef ARDUINO_CORE_PATH ifdef ARDUINO_CORE_PATH