Skip to content
Snippets Groups Projects
Commit 8beba564 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

make: board: initial commit of generic board Makefiles

parent 9dc0554d
No related branches found
No related tags found
No related merge requests found
# we build all cortex boards with the GNU toolchain
export PREFIX = arm-none-eabi-
include $(RIOTBOARD)/Makefile.include.gnu
# use cortex name of CPU folder, but enable board Makefile to override
export MCPU ?= $(CORTEX)
#
# CPU model specifics
ifeq ($(CORTEX),cortex-m4)
CFLAGS_FPU += -mfloat-abi=hard -mfpu=fpv4-sp-d16
endif
# define build specific options
export CFLAGS_CPU = -mcpu=$(MCPU) -mlittle-endian -mthumb -mno-thumb-interwork $(CFLAGS_FPU)
export CFLAGS_STYLE = -std=gnu99 -Wall -Wstrict-prototypes
export CFLAGS_LINK = -ffunction-sections -fdata-sections -fno-builtin
export CFLAGS_DBG = -ggdb -g3
export CFLAGS_OPT ?= -Os
export CFLAGS += $(CFLAGS_CPU) $(CFLAGS_STYLE) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
export ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DEBUG)
export LINKFLAGS += -L$(RIOTCPU)/$(CPU)
export LINKFLAGS += $(CFLAGS_DEBUG) $(CFLAGS_CPU) $(CFLAGS_STYLE) -static -lgcc -nostartfiles -T$(LINKERSCRIPT)
export OFLAGS ?= -O ihex
export FFLAGS ?= flash
export DEBUGGER_FLAGS ?= debug
export DEBUGSERVER_FLAGS ?= debug-server
export RESET_FLAGS ?= reset
# 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
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 DBG = $(PREFIX)gdb
export FLASHER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
export DEBUGGER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
export DEBUGSERVER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
export RESET = $(RIOTBASE)/dist/tools/openocd/openocd.sh
# set default port depending on operating system
OS := $(shell uname)
ifeq ($(OS),Linux)
PORT ?= $(PORT_LINUX)
else ifeq ($(OS),Darwin)
PORT ?= $(PORT_DARWIN)
endif
ifeq ($(PORT),)
$(info Warning: no PORT set!)
endif
export BAUD ?= 115200
export TERMFLAGS += -p "$(PORT)" -b "$(BAUD)"
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm
export PORT
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment