mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
248a8531a5
Sometimes boards/*/Makefile.include (e. g. in case of the msba2) gets included twice somehow, leading the TERMFLAG to be set twice and faulty. This fixes that.
54 lines
2.0 KiB
Makefile
54 lines
2.0 KiB
Makefile
# define the cpu used by the nRF51822 board pca10000
|
|
export CPU = nrf51822
|
|
export CPU_MODEL = nrf51822qfaa
|
|
|
|
#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 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 DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
|
|
export DEBUGSERVER = JLinkGDBServer -device nrf51822 -if SWD
|
|
export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
|
|
|
|
# define build specific options
|
|
CPU_USAGE = -mcpu=cortex-m0
|
|
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
|
|
# $(LINKERSCRIPT) is specified in cpu/Makefile.include
|
|
export LINKFLAGS += -T$(LINKERSCRIPT)
|
|
export OFLAGS = -O binary
|
|
export HEXFILE = $(ELFFILE:.elf=.bin)
|
|
export TERMFLAGS += -p "$(PORT)"
|
|
export FFLAGS = $(BINDIR) $(HEXFILE)
|
|
export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE)
|
|
export RESET_FLAGS = $(BINDIR)
|
|
|
|
# use the nano-specs of the NewLib when available
|
|
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
|
|
export LINKFLAGS += -specs=nano.specs -lc -lnosys
|
|
endif
|
|
|
|
# export board specific includes to the global includes-listing
|
|
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
|