Commit f352d021ecd0bcd58c5d747c84364f7357af809d
authorMichel Pollet <github.com@pollet.net>
Tue, 19 Jan 2016 09:41:34 +0000 (09:41 +0000)
committerMichel Pollet <github.com@pollet.net>
Tue, 19 Jan 2016 09:41:34 +0000 (09:41 +0000)
Allow for homebrew installed avr-gcc to any prefix

1  2 
Makefile.common

diff --cc Makefile.common
index a46b57822d9568f6713bcdd752064ceb5167e8cb,ff32da1fbce8b8858733909f0ece64b515584b85..e7cee3d36c7165ec2e43704df22427720c926ea0
@@@ -51,24 -51,16 +51,25 @@@ ifeq (${shell uname}, Darwin
   AVR          := ${AVR_ROOT}/bin/avr-
   # Thats for MacPorts libelf
   ifeq (${shell test -d /opt/local && echo Exists}, Exists)
 -  IPATH               += /opt/local/include
 -  LFLAGS              = -L/opt/local/lib/
 +  ifneq (${shell test -d /opt/local/avr && echo Exists}, Exists)
 +   $(error Please install avr-gcc: port install avr-gcc avr-libc)
 +  endif
 +  ifneq (${shell test -d /opt/local/include/libelf && echo Exists}, Exists)
 +   $(error Please install libelf: port install libelf)
 +  endif
 +  CC          = clang
 +  IPATH               += /opt/local/include /opt/local/include/libelf
 +  LFLAGS      = -L/opt/local/lib/
 +  AVR_INC     := /opt/local/avr
 +  AVR                 := /opt/local/bin/avr-
   else
    # That's for Homebrew libelf and avr-gcc support
-   ifeq (${shell test -d /usr/local/Cellar && echo Exists}, Exists)
-    ifneq (${shell test -d /usr/local/Cellar/avr-gcc/ && echo Exists}, Exists)
-     $(error Please install avr-gcc: brew tap larsimmisch/avr ; brew install avr-gcc avr-libc)
+   HOMEBREW_PREFIX ?= /usr/local
+   ifeq (${shell test -d $(HOMEBREW_PREFIX)/Cellar && echo Exists}, Exists)
+    ifneq (${shell test -d $(HOMEBREW_PREFIX)/Cellar/avr-gcc/ && echo Exists}, Exists)
+     $(error Please install avr-gcc: brew tap osx-cross/homebrew-avr ; brew install avr-libc)
     endif
-    ifneq (${shell test -d /usr/local/Cellar/libelf/ && echo Exists}, Exists)
+    ifneq (${shell test -d $(HOMEBREW_PREFIX)/Cellar/libelf/ && echo Exists}, Exists)
      $(error Please install libelf: brew install libelf)
     endif
     CC                 = clang