fix clean target for example makefiles if the compiler is not in PATH
This commit is contained in:
committed by
Piotr Esden-Tempski
parent
0c779512d6
commit
b7ebe6e705
@@ -27,14 +27,18 @@ LD = $(PREFIX)-gcc
|
||||
OBJCOPY = $(PREFIX)-objcopy
|
||||
OBJDUMP = $(PREFIX)-objdump
|
||||
GDB = $(PREFIX)-gdb
|
||||
|
||||
TOOLCHAIN_DIR ?= ../../../..
|
||||
ifeq ($(wildcard ../../../../lib/libopencm3_lpc43xx.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 += -O2 -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
|
||||
-mcpu=cortex-m4 -mthumb -MD \
|
||||
-mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
|
||||
Reference in New Issue
Block a user