Only add the MacPort dir if it's there. This
removes a warning when linking
Signed-off-by: Michel Pollet <buserror@gmail.com>
AVR_ROOT := "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/"
AVR_INC := ${AVR_ROOT}/avr-4/
AVR := ${AVR_ROOT}/bin/avr-
-LFLAGS += -L/opt/local/lib
+# Thats for MacPorts libelf
+ifeq (${shell test -d /opt/local && echo Exists}, Exists)
+IPATH += /opt/local/include
+LFLAGS = -L/opt/local/lib/
+endif
else
AVR_ROOT := /usr/lib/avr
AVR_INC := ${AVR_ROOT}