2014-11-19 11:17:56 +01:00
|
|
|
# define the cpu used by the mbed_lpx1768 board
|
2013-11-09 00:43:35 +01:00
|
|
|
export CPU = lpc1768
|
|
|
|
|
2014-11-19 11:17:56 +01:00
|
|
|
#define the default port depending on the host OS
|
|
|
|
OS := $(shell uname)
|
|
|
|
ifeq ($(OS),Linux)
|
|
|
|
PORT ?= /dev/ttyUSB0
|
|
|
|
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
|
2013-11-09 00:43:35 +01:00
|
|
|
export PREFIX = arm-none-eabi-
|
2014-01-03 19:00:41 +01:00
|
|
|
export CC = $(PREFIX)gcc
|
2014-11-18 18:35:01 +01:00
|
|
|
export CXX = $(PREFIX)g++
|
2014-01-03 19:00:41 +01:00
|
|
|
export AR = $(PREFIX)ar
|
2013-11-09 00:43:35 +01:00
|
|
|
export AS = $(PREFIX)as
|
|
|
|
export LINK = $(PREFIX)gcc
|
|
|
|
export SIZE = $(PREFIX)size
|
|
|
|
export OBJCOPY = $(PREFIX)objcopy
|
2014-11-19 11:17:56 +01:00
|
|
|
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm
|
|
|
|
export FLASHER =
|
|
|
|
export DEBUGGER =
|
|
|
|
export DEBUGSERVER =
|
2014-11-18 18:35:01 +01:00
|
|
|
|
2014-11-19 11:17:56 +01:00
|
|
|
# define build specific options
|
2014-11-18 18:35:01 +01:00
|
|
|
CPU_USAGE = -mcpu=cortex-m3
|
|
|
|
FPU_USAGE =
|
|
|
|
export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-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 -mthumb-interwork -nostartfiles
|
2014-11-19 16:34:45 +01:00
|
|
|
export LINKFLAGS += -T$(LINKERSCRIPT)
|
2014-11-19 11:17:56 +01:00
|
|
|
export OFLAGS = -O binary
|
2014-12-09 13:31:17 +01:00
|
|
|
export HEXFILE = $(ELFFILE:.elf=.bin)
|
2014-11-19 11:17:56 +01:00
|
|
|
export FFLAGS =
|
|
|
|
export DEBUGGER_FLAGS =
|
|
|
|
export TERMFLAGS += -p "$(PORT)"
|
2014-11-18 18:35:01 +01:00
|
|
|
|
2014-11-19 11:17:56 +01:00
|
|
|
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
|
|
|
|
export CXXUWFLAGS +=
|
|
|
|
export CXXEXFLAGS +=
|
2013-11-09 00:43:35 +01:00
|
|
|
|
2014-11-19 11:17:56 +01:00
|
|
|
# use newLib nano-specs if available
|
|
|
|
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
|
|
|
|
export LINKFLAGS += -specs=nano.specs -lc -lnosys
|
2013-11-09 00:43:35 +01:00
|
|
|
endif
|
|
|
|
|
2014-11-19 11:17:56 +01:00
|
|
|
# export board specific includes to the global includes-listing
|
2014-11-19 16:34:45 +01:00
|
|
|
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/
|