board: mbed_lpc1768: adapt to common board Makefile

This commit is contained in:
Kaspar Schleiser 2015-04-22 15:45:34 +02:00
parent 16d9842868
commit 401f417a78

View File

@ -1,54 +1,21 @@
# define the cpu used by the mbed_lpx1768 board # define the cpu used by the mbed_lpx1768 board
export CPU = lpc1768 export CPU = lpc1768
#define the default port depending on the host OS
OS := $(shell uname)
ifeq ($(OS),Linux)
PORT ?= /dev/ttyACM0
else ifeq ($(OS),Darwin)
PORT ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
else
$(info CAUTION: No flash tool for your host system found!)
# TODO: add support for windows as host platform
endif
export PORT
# define tools used for building the project
export PREFIX = arm-none-eabi-
export CC = $(PREFIX)gcc
export CXX = $(PREFIX)g++
export AR = $(PREFIX)ar
export AS = $(PREFIX)as
export LINK = $(PREFIX)gcc
export SIZE = $(PREFIX)size
export OBJCOPY = $(PREFIX)objcopy
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
export DEBUGGER = export DEBUGGER =
export DEBUGSERVER = export DEBUGSERVER =
# define build specific options
CPU_USAGE = -mcpu=cortex-m3
FPU_USAGE =
export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mno-thumb-interwork -nostartfiles
export CFLAGS += -ffunction-sections -fdata-sections -fno-builtin
export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian
export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mno-thumb-interwork -nostartfiles
export LINKFLAGS += -T$(LINKERSCRIPT)
export OFLAGS = -O binary export OFLAGS = -O binary
export HEXFILE = $(ELFFILE:.elf=.bin) export HEXFILE = $(ELFFILE:.elf=.bin)
export FFLAGS = export FFLAGS =
export DEBUGGER_FLAGS = export DEBUGGER_FLAGS =
export TERMFLAGS += -p "$(PORT)"
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++ # define the default port depending on the host OS
export CXXUWFLAGS += PORT_LINUX ?= /dev/ttyACM0
export CXXEXFLAGS += PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
# use newLib nano-specs if available # setup serial terminal
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0) include $(RIOTBOARD)/Makefile.include.serial
export LINKFLAGS += -specs=nano.specs -lc -lnosys
endif
# export board specific includes to the global includes-listing # include cortex defaults
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ include $(RIOTBOARD)/Makefile.include.cortex_common