Package: arduino-mk
Version: 0.8-4
Severity: minor
Tags: patch

Dear Maintainer,

two issues:
minor: line numbers reported by gcc on ino files are off by one.
wishlist: does not automaticaly identifiy libries like the ide.



-- System Information:
Debian Release: 7.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-486
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages arduino-mk depends on:
ii  arduino-core         1:1.0.1+dfsg-7
ii  libconfig-yaml-perl  1.42-2
ii  perl-doc             5.14.2-18

arduino-mk recommends no packages.

arduino-mk suggests no packages.

-- no debconf information
--- /usr/share/arduino/Arduino.mk.orig	2013-02-18 19:13:04.000000000 -0700
+++ /usr/share/arduino/Arduino.mk.new	2013-03-10 19:53:38.000000000 -0600
@@ -63,6 +63,11 @@
 #                            Goldenberg both reported this and
 #                            provided patches in the same spirit.
 #
+#         0.9  3.x.2013    Ben Hildred
+#			   - Fixed off by one problem on line numbers
+#			     in error messages.
+#			   - Basic autodetection of libraries.
+#
 ########################################################################
 #
 # STANDARD ARDUINO WORKFLOW
@@ -313,7 +318,12 @@
 CORE_LIB   = $(OBJDIR)/libcore.a
 
 # A list of dependencies
-DEP_FILE   = $(OBJDIR)/depends.mk
+DEP_FILE     = $(OBJDIR)/depends.mk
+LIB_DEP_FILE = $(OBJDIR)/libdep.mk
+
+ifndef ARDUINO_LIBS
+include $(LIB_DEP_FILE)
+endif
 
 # Names of executables
 CC      = $(AVR_TOOLS_PATH)/avr-gcc
@@ -415,11 +425,13 @@
 # the pde -> cpp -> o file
 $(OBJDIR)/%.cpp: %.pde
 	$(ECHO) '#include "WProgram.h"' > $@
+	$(ECHO) '#line 1' \"$<\" >> $@
 	$(CAT)  $< >> $@
 
 # the ino -> cpp -> o file
 $(OBJDIR)/%.cpp: %.ino
 	$(ECHO) '#include <Arduino.h>' > $@
+	$(ECHO) '#line 1' \"$<\" >> $@
 	$(CAT)  $< >> $@
 
 $(OBJDIR)/%.o: $(OBJDIR)/%.cpp
@@ -487,6 +499,10 @@
 $(CORE_LIB):	$(CORE_OBJS) $(LIB_OBJS)
 		$(AR) rcs $@ $(CORE_OBJS) $(LIB_OBJS)
 
+$(LIB_DEP_FILE):	$(OBJDIR) *.ino *.cpp *.c *.h *.pde
+		grep -h '^[ 	]*#[ 	]*include[ 	]*<' -- *.ino *.cpp *.c *.h *.pde|sed 's!^.*<\(.*\)\.h>.*!\1!'|sort -u|xargs -d '\n' echo 'ARDUINO_LIBS =' > $(LIB_DEP_FILE)
+		echo >> $(LIB_DEP_FILE)
+
 $(DEP_FILE):	$(OBJDIR) $(DEPS)
 		cat $(DEPS) > $(DEP_FILE)
 

Reply via email to