Description
Reported and proposed fix by Bas Wijnen
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718892
[The makefile] doesn't track .cc, .hh and .hpp files for libraries.
The problem is in this part:
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)
The first line of that should also include $(LOCAL_CC_SRCS). It might
be best to just define $(LOCAL_SRCS) at the start which combines all of
them.
The second line (the grep command) should use the same variables as the
dependency list instead of _.ino etc; when any of the file types in the
list is not present (and *.ino and .pde can never both be present), you
get a warning about it, which is not nice. If the same list of
$(LOCAL___SRCS) as above is used (including $(LOCAL_CC_SRCS), of
course), that warning is gone and the new file types are used (.hh and
*.hpp are already included in $(LOCAL_HEADERS)).
So for your convenience, here are those lines again, but now the way
they should be:
grep -h '^[ ]#[ ]include[ ]<' -- $(LOCAL_INO_SRCS) $(LOCAL_CPP_SRCS) $(LOCAL_CC_SRCS) $(LOCAL_C_SRCS) $(LOCAL_HEADERS) $(LOCAL_PDE_SRCS)|sed 's!^.<(.).h>.!\1!'|sort -u|xargs -d '\n' echo 'ARDUINO_LIBS =' > $(LIB_DEP_FILE)
echo >> $(LIB_DEP_FILE)
Or perhaps better:
grep -h '^[ ]#[ ]include[ ]<' -- $(LOCAL_SRCS) $(LOCAL_HEADERS)|sed 's!^.<(.).h>.!\1!'|sort -u|xargs -d '\n' echo 'ARDUINO_LIBS =' > $(LIB_DEP_FILE)
echo >> $(LIB_DEP_FILE)
With a definition of $(LOCAL_SRCS) at the top of the file, just after
the definitions of $(LOCAL_*_SRCS).