Make the STM32 Makefile.includes usable from outside the examples tree (Issue #28)

This commit is contained in:
Frantisek Burian
2014-01-06 22:11:32 +01:00
parent 9934e40fe9
commit 02c35eee70
7 changed files with 12 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ LDSCRIPT ?= $(BINARY).ld
OBJS += $(BINARY).o
TOOLCHAIN_DIR ?= ../../../../../libopencm3
ifeq ($(wildcard ../../../../../libopencm3/lib/lib$(LIBNAME).a),)
ifeq ($(wildcard $(TOOLCHAIN_DIR)/lib/lib$(LIBNAME).a),)
ifneq ($(strip $(shell which $(CC))),)
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
endif