Commit 6a8222ebf5e9739ce01dfbddc3ab512376d0b88a
authorThomas Axelsson <thomasa88@gmail.com>
Wed, 8 Jan 2014 21:29:55 +0000 (22:29 +0100)
committerThomas Axelsson <thomasa88@gmail.com>
Wed, 8 Jan 2014 21:31:32 +0000 (22:31 +0100)
Inspired by thors@github.

This should find correct paths for at least Arch, Debian, Fedora, Gentoo, OpenSUSE, Ubuntu.

Makefile.common

index 3976b6571d32b0a5dca7d0afdccac5bae8695310..0477af27afb9b516c2a4e22a49af5b93faecaaf6 100644 (file)
@@ -55,7 +55,11 @@ IPATH                += /opt/local/include
 LFLAGS         = -L/opt/local/lib/
 endif
 else
-AVR_ROOT       := /usr/lib/avr
+LINUX_AVR_ROOTS := /usr/lib/avr /usr/avr /opt/cross/avr/avr
+AVR_ROOT := $(firstword $(wildcard $(LINUX_AVR_ROOTS)))
+ifeq (${AVR_ROOT},)
+$(error No avr-libc root directory found. Tried the following paths: $(LINUX_AVR_ROOTS))
+endif
 AVR_INC        := ${AVR_ROOT}
 AVR            := avr-