From c92d6724d711acccacf917a63b683fa10812e876 Mon Sep 17 00:00:00 2001 From: Sudar Date: Fri, 9 Aug 2013 21:36:22 +0530 Subject: Autodetect baudrate only if either a .ino/.pde is present Because of the way the autodetect code works, if no .ino/.pde file is present, then the makefile hangs --- arduino-mk/Arduino.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'arduino-mk/Arduino.mk') diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 62ef75b..23e621b 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -657,8 +657,10 @@ endif # ifeq ($(strip $(NO_CORE)),) ifndef MONITOR_BAUDRATE - SPEED = $(shell egrep -h 'Serial.begin\([0-9]+\)' $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS) | sed -e 's/[^0-9]//g'| head -n1) - MONITOR_BAUDRATE = $(findstring $(SPEED),300 1200 2400 4800 9600 14400 19200 28800 38400 57600 115200) + ifeq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 1) + SPEED = $(shell egrep -h 'Serial.begin\([0-9]+\)' $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS) | sed -e 's/[^0-9]//g'| head -n1) + MONITOR_BAUDRATE = $(findstring $(SPEED),300 1200 2400 4800 9600 14400 19200 28800 38400 57600 115200) + endif ifeq ($(MONITOR_BAUDRATE),) MONITOR_BAUDRATE = 9600 -- cgit v1.2.3