From: Thomas Axelsson Date: Wed, 8 Jan 2014 21:29:55 +0000 (+0100) Subject: Makefile: Test multiple AVR roots for Linux and error out if none found X-Git-Tag: v1.2~44^2 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=6a8222ebf5e9739ce01dfbddc3ab512376d0b88a;p=sx%2Fsimavr.git 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. --- 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-