mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ef542ef92c
These are already exported by `makefiles/vars.inc.mk`. It is a prerequisite to allow handling compilation without global exports.
42 lines
1.3 KiB
Makefile
42 lines
1.3 KiB
Makefile
BOARDS_COMMON_MSBA2_DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
|
|
|
|
# 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)
|
|
|
|
# configure serial interface
|
|
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)"
|
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
|
|
|
CFLAGS_CPU = -mcpu=arm7tdmi-s
|
|
CFLAGS_LINK = -ffunction-sections -fdata-sections -fno-builtin -fshort-enums
|
|
CFLAGS_DBG ?= -ggdb -g3
|
|
CFLAGS_OPT ?= -Os
|
|
|
|
CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
|
|
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
|
|
USEMODULE += newlib_nano
|
|
|
|
FLASHFILE ?= $(HEXFILE)
|
|
FFLAGS = $(PORT) $(FLASHFILE)
|
|
|
|
INCLUDES += -I$(RIOTBOARD)/common/msba2/include
|
|
|
|
export UNDEF += $(BINDIR)/cpu/startup.o
|