Make the STM32 Makefile.includes usable from outside the examples tree

The Makefile.includes contain a hardcoded ../../../../../libopencm3
path for the TOOLCHAIN_DIR variable. They also contained another copy
of this hardcoded path, that is now generated from $TOOLCHAIN_DIR.

This allows to have a symbolic link to a Makefile.include in an
out-of-tree project and reuse the Makefile infrastructure.
This commit is contained in:
Onno Kortmann
2013-12-05 21:31:38 -08:00
committed by Piotr Esden-Tempski
parent c0791cd4a7
commit 3efd9f8675
4 changed files with 4 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ OBJDUMP = $(PREFIX)-objdump
GDB = $(PREFIX)-gdb GDB = $(PREFIX)-gdb
TOOLCHAIN_DIR ?= ../../../../../libopencm3 TOOLCHAIN_DIR ?= ../../../../../libopencm3
ifeq ($(wildcard ../../../../../libopencm3/lib/libopencm3_stm32f1.a),) ifeq ($(wildcard $(TOOLCHAIN_DIR)/lib/libopencm3_stm32f1.a),)
ifneq ($(strip $(shell which $(CC))),) ifneq ($(strip $(shell which $(CC))),)
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX) TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
endif endif

View File

@@ -28,7 +28,7 @@ OBJDUMP = $(PREFIX)-objdump
GDB = $(PREFIX)-gdb GDB = $(PREFIX)-gdb
TOOLCHAIN_DIR ?= ../../../../../libopencm3 TOOLCHAIN_DIR ?= ../../../../../libopencm3
ifeq ($(wildcard ../../../../../libopencm3/lib/libopencm3_stm32f2.a),) ifeq ($(wildcard $(TOOLCHAIN_DIR)/lib/libopencm3_stm32f2.a),)
ifneq ($(strip $(shell which $(CC))),) ifneq ($(strip $(shell which $(CC))),)
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX) TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
endif endif

View File

@@ -29,7 +29,7 @@ GDB = $(PREFIX)-gdb
FLASH = $(shell which st-flash) FLASH = $(shell which st-flash)
TOOLCHAIN_DIR ?= ../../../../../libopencm3 TOOLCHAIN_DIR ?= ../../../../../libopencm3
ifeq ($(wildcard ../../../../../libopencm3/lib/libopencm3_stm32f3.a),) ifeq ($(wildcard $(TOOLCHAIN_DIR)/lib/libopencm3_stm32f3.a),)
ifneq ($(strip $(shell which $(CC))),) ifneq ($(strip $(shell which $(CC))),)
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX) TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
endif endif

View File

@@ -29,7 +29,7 @@ GDB = $(PREFIX)-gdb
FLASH = $(shell which st-flash) FLASH = $(shell which st-flash)
TOOLCHAIN_DIR ?= ../../../../../libopencm3 TOOLCHAIN_DIR ?= ../../../../../libopencm3
ifeq ($(wildcard ../../../../../libopencm3/lib/libopencm3_stm32f4.a),) ifeq ($(wildcard $(TOOLCHAIN_DIR)/lib/libopencm3_stm32f4.a),)
ifneq ($(strip $(shell which $(CC))),) ifneq ($(strip $(shell which $(CC))),)
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX) TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
endif endif