From 7977cddc1301c50d9c74be95ce5dc56a3a4282c0 Mon Sep 17 00:00:00 2001 From: "joeholdsworth@gmail.com" Date: Mon, 5 Sep 2011 17:15:01 +0000 Subject: [PATCH] updated make file for cygwin compatibility git-svn-id: https://arducopter.googlecode.com/svn/trunk@3277 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Common/Arduino.mk | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libraries/AP_Common/Arduino.mk b/libraries/AP_Common/Arduino.mk index 05a9eb497b..ae3f3e572e 100644 --- a/libraries/AP_Common/Arduino.mk +++ b/libraries/AP_Common/Arduino.mk @@ -96,6 +96,8 @@ ifneq ($(findstring CYGWIN, $(SYSTYPE)),) endif endif +# Jump over the next makefile sections when runing a "make configure" +ifneq ($(MAKECMDGOALS),configure) ################################################################################ # Config options @@ -130,7 +132,7 @@ ifeq ($(ARDUINO),) endif ifeq ($(SYSTYPE),Linux) - ARDUINO_SEARCHPATH = /usr/share/arduino /usr/local/share/arduino /usr/bin/arduino + ARDUINO_SEARCHPATH = /usr/share/arduino* /usr/local/share/arduino* ARDUINOS := $(wildcard $(ARDUINO_SEARCHPATH)) endif @@ -257,12 +259,7 @@ SKETCHCPP_SRC := $(SKETCHPDE) $(sort $(filter-out $(SKETCHPDE),$(SKETCHPDESRCS) # make. # SEXPR = 's/^[[:space:]]*\#include[[:space:]][<\"]([^>\"./]+).*$$/\1/p' -ifneq ($(findstring CYGWIN, $(SYSTYPE)),) - # Workaround a cygwin issue - LIBTOKENS := $(sort $(shell cat $(SKETCHPDESRCS) $(SKETCHSRCS) | sed -nre $(SEXPR))) -else - LIBTOKENS := $(sort $(shell cat $(SKETCHPDESRCS) $(SKETCHSRCS) | sed -nEe $(SEXPR))) -endif +LIBTOKENS := $(sort $(shell cat $(SKETCHPDESRCS) $(SKETCHSRCS) | sed -nre $(SEXPR))) # # Find sketchbook libraries referenced by the sketch. @@ -361,6 +358,7 @@ ALLOBJS = $(SKETCHOBJS) $(LIBOBJS) $(CORELIBOBJS) # All of the dependency files that may be generated ALLDEPS = $(ALLOBJS:%.o=%.d) +endif ################################################################################ # Targets @@ -372,6 +370,12 @@ all: $(SKETCHELF) $(SKETCHEEP) $(SKETCHHEX) upload: $(SKETCHHEX) avrdude -c $(UPLOAD_PROTOCOL) -p $(MCU) -P $(PORT) -b$(UPLOAD_SPEED) -U $(SKETCHHEX) +configure: + $(warning WARNING - A $(SKETCHBOOK)/config.mk file has been written) + $(warning Please edit the file to match your system configuration, if you use a different board or port) + @echo BOARD=mega > $(SKETCHBOOK)/config.mk + @echo PORT=/dev/null >> $(SKETCHBOOK)/config.mk + debug: avarice --mkII --capture --jtag usb :4242 & \ gnome-terminal -x avr-gdb $(SKETCHELF) & \