Browse Source

make: board: initial commit of generic board Makefiles

dev/timer
Kaspar Schleiser 8 years ago
parent
commit
8beba5645b
  1. 38
      boards/Makefile.include.cortex_common
  2. 8
      boards/Makefile.include.gnu
  3. 4
      boards/Makefile.include.openocd
  4. 17
      boards/Makefile.include.serial

38
boards/Makefile.include.cortex_common

@ -0,0 +1,38 @@
# 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

8
boards/Makefile.include.gnu

@ -0,0 +1,8 @@
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

4
boards/Makefile.include.openocd

@ -0,0 +1,4 @@
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

17
boards/Makefile.include.serial

@ -0,0 +1,17 @@
# 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
Loading…
Cancel
Save