|
| 1 | +# define the cpu used by the phyWAVE-KW22 board |
| 2 | +export CPU = kw2x |
| 3 | +export CPU_MODEL = kw22d512 |
| 4 | + |
| 5 | +#define the default port depending on the host OS |
| 6 | +OS := $(shell uname) |
| 7 | +ifeq ($(OS),Linux) |
| 8 | + PORT ?= /dev/ttyACM0 |
| 9 | +else ifeq ($(OS),Darwin) |
| 10 | + PORT ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) |
| 11 | +else |
| 12 | + $(info CAUTION: No flash tool for your host system found!) |
| 13 | +endif |
| 14 | +export PORT |
| 15 | + |
| 16 | +# define tools used for building the project |
| 17 | +export PREFIX = arm-none-eabi- |
| 18 | +export CC = $(PREFIX)gcc |
| 19 | +export AR = $(PREFIX)ar |
| 20 | +export AS = $(PREFIX)as |
| 21 | +export LINK = $(PREFIX)gcc |
| 22 | +export SIZE = $(PREFIX)size |
| 23 | +export OBJCOPY = $(PREFIX)objcopy |
| 24 | +export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm |
| 25 | +export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh |
| 26 | +export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh |
| 27 | +export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh |
| 28 | +export DEBUGSERVER = openocd |
| 29 | + |
| 30 | +# define build specific options |
| 31 | +CPU_USAGE = -mcpu=cortex-m4 |
| 32 | +FPU_USAGE = |
| 33 | +export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles |
| 34 | +export CFLAGS += -ffunction-sections -fdata-sections -fno-builtin |
| 35 | +export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian |
| 36 | +export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles |
| 37 | +export LINKFLAGS += -T$(LINKERSCRIPT) |
| 38 | +export OFLAGS = -O binary |
| 39 | +export FFLAGS = $(HEXFILE) |
| 40 | +export DEBUGGER_FLAGS = $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE) |
| 41 | +export TERMFLAGS = -p $(PORT) |
| 42 | + |
| 43 | +# use newLib nano-specs if available |
| 44 | +ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0) |
| 45 | +export LINKFLAGS += -specs=nano.specs -lc -lnosys |
| 46 | +endif |
| 47 | + |
| 48 | +# export board specific includes to the global includes-listing |
| 49 | +export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ |
| 50 | + |
0 commit comments