2014-04-17 19:35:40 +02:00
|
|
|
|
|
|
|
# define the cpu used by the arduino due board
|
|
|
|
export CPU = sam3x8e
|
|
|
|
|
|
|
|
# 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.py
|
|
|
|
|
|
|
|
#define the flash-tool and default port depending on the host operating system
|
|
|
|
OS = $(shell uname)
|
|
|
|
ifeq ($(OS),Linux)
|
|
|
|
PORT ?= /dev/ttyACM0
|
|
|
|
FLASHER = stty -F $(PORT) raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255; $(RIOTBOARD)/$(BOARD)/dist/bossac
|
|
|
|
else ifeq ($(OS),Darwin)
|
|
|
|
PORT ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1)
|
|
|
|
FLASHER = stty -f $(PORT) raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255; $(RIOTBOARD)/$(BOARD)/dist/bossac_osx
|
|
|
|
else
|
|
|
|
$(info CAUTION: No flash tool for your host system found!)
|
|
|
|
# TODO: fix for building under windows
|
|
|
|
endif
|
|
|
|
export FLASHER
|
|
|
|
export PORT
|
|
|
|
|
|
|
|
# define build specific options
|
|
|
|
export CPU_USAGE = -mcpu=cortex-m3
|
|
|
|
export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles
|
|
|
|
export CFLAGS += -DREENTRANT_SYSCALLS_PROVIDED
|
|
|
|
export ASFLAGS += -ggdb -g3 -mcpu=cortex-m4 $(FPU_USAGE) -mlittle-endian
|
|
|
|
export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles
|
|
|
|
# linkerscript specified in cpu/Makefile.include
|
|
|
|
export LINKFLAGS += -T$(LINKERSCRIPT)
|
|
|
|
export OFLAGS += -O binary
|
2014-05-23 10:33:02 +02:00
|
|
|
export FFLAGS += -e -w -v -b bin/$(BOARD)/$(APPLICATION).hex
|
2014-04-17 19:35:40 +02:00
|
|
|
|
|
|
|
# additional compiler and linker flags to enable newlib-nano and optimize for it
|
|
|
|
# CAREFUL: newlib-nano is not supported by the ubuntu arm-none-eabi- toolchain, so its disabled by default
|
|
|
|
#export CFLAGS += -flto -ffunction-sections -fdata-sections -fno-builtin
|
|
|
|
#export LINKFLAGS += -specs=nano.specs -lc -lnosys
|
|
|
|
|
|
|
|
|
|
|
|
# export board specific includes to the global includes-listing
|
|
|
|
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
|