2015-02-06 14:35:48 +00:00
|
|
|
# Select the board to build for: if not given on the command line,
|
2015-05-28 12:22:26 +01:00
|
|
|
# then default to WIPY
|
|
|
|
BOARD ?= WIPY
|
2015-02-06 14:35:48 +00:00
|
|
|
ifeq ($(wildcard boards/$(BOARD)/.),)
|
|
|
|
$(error Invalid BOARD specified)
|
|
|
|
endif
|
|
|
|
|
2015-05-28 12:22:26 +01:00
|
|
|
# Make 'release' the default build type
|
2015-02-28 11:20:04 +00:00
|
|
|
BTYPE ?= release
|
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
# If the build directory is not given, make it reflect the board name.
|
2015-02-28 11:20:04 +00:00
|
|
|
BUILD ?= build/$(BOARD)/$(BTYPE)
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
include ../py/mkenv.mk
|
|
|
|
-include ../../localconfig.mk
|
|
|
|
|
|
|
|
CROSS_COMPILE ?= arm-none-eabi-
|
|
|
|
|
|
|
|
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -march=armv7e-m -mabi=aapcs -mcpu=cortex-m4 -msoft-float -mfloat-abi=soft -fsingle-precision-constant -Wdouble-promotion
|
2015-04-28 20:18:47 +01:00
|
|
|
CFLAGS = -Wall -Wpointer-arith -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4)
|
2015-02-06 14:35:48 +00:00
|
|
|
CFLAGS += -g -ffunction-sections -fdata-sections -fno-common -fsigned-char -mno-unaligned-access
|
|
|
|
CFLAGS += -Iboards/$(BOARD)
|
|
|
|
|
2015-06-18 07:59:59 +01:00
|
|
|
LDFLAGS = -Wl,-nostdlib -Wl,--gc-sections -Wl,-Map=$@.map
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
ifeq ($(BTARGET), application)
|
|
|
|
# qstr definitions (must come before including py.mk)
|
|
|
|
QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h
|
|
|
|
# include MicroPython make definitions
|
|
|
|
include ../py/py.mk
|
|
|
|
include application.mk
|
|
|
|
else
|
|
|
|
ifeq ($(BTARGET), bootloader)
|
|
|
|
include bootmgr/bootloader.mk
|
|
|
|
else
|
|
|
|
$(error Invalid BTARGET specified)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# always include MicroPython make rules
|
|
|
|
include ../py/mkrules.mk
|