2019-01-24 14:30:57 +01:00
|
|
|
BOARDS_COMMON_MSBA2_DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
2013-03-13 16:52:00 +01:00
|
|
|
## the cpu to build for
|
|
|
|
export CPU = lpc2387
|
|
|
|
|
2019-01-24 14:30:57 +01:00
|
|
|
# Compile `lpc2k_pgm` when required
|
|
|
|
# It is still compiling in `boards` as it was the case before introducing the
|
|
|
|
# rule to autobuild
|
|
|
|
MSBA2_TOOLS = $(BOARDS_COMMON_MSBA2_DIR)/tools
|
|
|
|
LPC2K_PGM = $(MSBA2_TOOLS)/bin/lpc2k_pgm
|
|
|
|
$(LPC2K_PGM): FORCE
|
|
|
|
env -i PATH=$(PATH) make -C $(MSBA2_TOOLS)
|
|
|
|
FLASHDEPS += $(if $(findstring $(LPC2K_PGM),$(FLASHER)),$(LPC2K_PGM))
|
|
|
|
|
|
|
|
FLASHER ?= $(LPC2K_PGM)
|
2017-05-18 15:46:38 +02:00
|
|
|
|
|
|
|
# configure serial interface
|
2018-11-22 14:12:38 +01:00
|
|
|
PORT_LINUX ?= /dev/ttyUSB0
|
|
|
|
# This does not make a lot of sense, but it has the same value as the previous code
|
|
|
|
PORT_DARWIN ?= /dev/tty.usbserial-ARM
|
|
|
|
|
|
|
|
TERMFLAGS += -tg -p "$(PORT)"
|
2017-05-18 15:46:38 +02:00
|
|
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
2013-03-13 16:52:00 +01:00
|
|
|
|
2016-02-08 19:37:37 +01:00
|
|
|
export CFLAGS_CPU = -mcpu=arm7tdmi-s
|
|
|
|
export CFLAGS_LINK = -ffunction-sections -fdata-sections -fno-builtin -fshort-enums
|
2017-01-16 15:54:59 +01:00
|
|
|
export CFLAGS_DBG ?= -ggdb -g3
|
2016-02-08 19:37:37 +01:00
|
|
|
export CFLAGS_OPT ?= -Os
|
2014-02-26 18:25:15 +01:00
|
|
|
|
2016-02-08 19:37:37 +01:00
|
|
|
export CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
|
|
|
|
export ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG)
|
|
|
|
export LINKFLAGS += -T$(RIOTCPU)/$(CPU)/ldscripts/$(CPU).ld
|
|
|
|
export LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -static -lgcc -nostartfiles
|
|
|
|
export LINKFLAGS += -Wl,--gc-sections
|
|
|
|
|
|
|
|
# use the nano-specs of Newlib when available
|
2016-03-21 07:36:02 +01:00
|
|
|
USEMODULE += newlib_nano
|
2016-02-08 19:37:37 +01:00
|
|
|
|
2018-12-19 19:37:38 +01:00
|
|
|
FLASHFILE ?= $(HEXFILE)
|
|
|
|
FFLAGS = $(PORT) $(FLASHFILE)
|
2013-06-12 16:27:17 +02:00
|
|
|
|
2017-11-16 12:15:04 +01:00
|
|
|
INCLUDES += -I$(RIOTBOARD)/common/msba2/include
|
2013-12-24 14:50:26 +01:00
|
|
|
|
2016-10-18 23:27:59 +02:00
|
|
|
export UNDEF += $(BINDIR)/cpu/startup.o
|