aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/f2/Makefile.include
diff options
context:
space:
mode:
authorchrysn2012-10-17 18:55:54 +0200
committerchrysn2012-10-17 18:55:54 +0200
commit7c33025c318bcc43cfcd3a23a76d14b299fecc0a (patch)
tree491adcf9ada616f15c435929e878c5ca3cddc568 /examples/stm32/f2/Makefile.include
parenta69d83d312396ee604426dce5341a54316c7c9b5 (diff)
parent0a483449654e18189ff017f70d6b97888cdba382 (diff)
Merge branch 'master' into generalizations
Conflicts: lib/lm3s/vector.c -- split out to lm3s/irq.h lib/stm32/f4/vector.c -- put the floating point initialization code into a function like in lpc43xx
Diffstat (limited to 'examples/stm32/f2/Makefile.include')
-rw-r--r--examples/stm32/f2/Makefile.include6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/stm32/f2/Makefile.include b/examples/stm32/f2/Makefile.include
index 690f8c4..10eed79 100644
--- a/examples/stm32/f2/Makefile.include
+++ b/examples/stm32/f2/Makefile.include
@@ -26,14 +26,18 @@ LD = $(PREFIX)-gcc
OBJCOPY = $(PREFIX)-objcopy
OBJDUMP = $(PREFIX)-objdump
GDB = $(PREFIX)-gdb
+
+TOOLCHAIN_DIR ?= ../../../../..
ifeq ($(wildcard ../../../../../lib/libopencm3_stm32f2.a),)
+ifneq ($(strip $(shell which $(CC))),)
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
+endif
else
ifeq ($(V),1)
$(info We seem to be building the example in the source directory. Using local library!)
endif
-TOOLCHAIN_DIR := ../../../../..
endif
+
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
-fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD -DSTM32F2
LDSCRIPT ?= $(BINARY).ld