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
This commit is contained in:
Karl Palsson
2012-07-04 21:45:14 +00:00
parent 507a1742dc
commit f1f1aa84f3
3 changed files with 43 additions and 8 deletions

View File

@@ -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