From 6a8222ebf5e9739ce01dfbddc3ab512376d0b88a Mon Sep 17 00:00:00 2001 From: Thomas Axelsson Date: Wed, 8 Jan 2014 22:29:55 +0100 Subject: [PATCH] Makefile: Test multiple AVR roots for Linux and error out if none found Inspired by thors@github. This should find correct paths for at least Arch, Debian, Fedora, Gentoo, OpenSUSE, Ubuntu. --- Makefile.common | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index 3976b65..0477af2 100644 --- a/Makefile.common +++ b/Makefile.common @@ -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- -- 2.39.5