aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKarl Palsson2012-07-04 21:45:14 +0000
committerKarl Palsson2012-11-07 21:50:27 +0000
commitf1f1aa84f30d9496dbaaff1bb252ddb5a0a77660 (patch)
tree37edab1076c29d4d477fd4e7b5fffcf7d28c890b /Makefile
parent507a1742dc09ed8152c882f3dd4ffd387d6a09b5 (diff)
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
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
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