From f1f1aa84f30d9496dbaaff1bb252ddb5a0a77660 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 4 Jul 2012 21:45:14 +0000 Subject: Use make flags to help control where the library is installed Where the library is installed has quite an affect on what -L and -I flags are used. If you install into the toolchain, you don't want to use them at all, but if you install out of tree (/opt/mycm3 for example) you need to specify the -L and -I flags. Update the documentation and the example makefiles to support this --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 063d613..83332e9 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,13 @@ PREFIX ?= arm-none-eabi #PREFIX ?= arm-elf + +ifeq ($(DETECT_TOOLCHAIN),) DESTDIR ?= /usr/local +else +DESTDIR ?= $(shell dirname $(shell readlink -f $(shell which $(PREFIX)-gcc)))/.. +endif + INCDIR = $(DESTDIR)/$(PREFIX)/include LIBDIR = $(DESTDIR)/$(PREFIX)/lib SHAREDIR = $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts -- cgit v1.2.3