2017-02-02 23:10:23 +08:00
|
|
|
# Makefile for building mcuboot as a Zephyr project.
|
|
|
|
|
2017-02-02 23:23:57 +08:00
|
|
|
# Configuration choices.
|
|
|
|
|
|
|
|
#####################
|
|
|
|
# Signature algorithm
|
|
|
|
#####################
|
|
|
|
# Choose one of RSA or ECDSA P-256 blocks, and uncomment the config
|
|
|
|
# lines there, and comment out any other blocks.
|
2017-02-02 23:10:23 +08:00
|
|
|
|
|
|
|
# RSA
|
2017-01-11 00:49:47 +08:00
|
|
|
CONF_FILE = boot/zephyr/prj.conf
|
2017-05-12 03:19:36 +08:00
|
|
|
CFLAGS += -DMCUBOOT_SIGN_RSA -DMCUBOOT_USE_MBED_TLS
|
2017-02-02 23:10:23 +08:00
|
|
|
|
2017-06-01 03:21:39 +08:00
|
|
|
# Newer uses should use the RSA-PSS signature algorithm. This define
|
|
|
|
# enables (and requires) this type of signature.
|
|
|
|
#CFLAGS += -DMCUBOOT_RSA_PKCS1_15
|
|
|
|
|
2017-02-02 23:10:23 +08:00
|
|
|
# ECDSA P-256
|
|
|
|
#CONF_FILE = boot/zephyr/prj-p256.conf
|
2017-05-12 03:19:36 +08:00
|
|
|
#CFLAGS += -DMCUBOOT_SIGN_EC256 -DMCUBOOT_USE_TINYCRYPT
|
2017-02-02 23:10:23 +08:00
|
|
|
|
2017-02-02 23:23:57 +08:00
|
|
|
# Enable this option to have the bootloader verify the signature of
|
|
|
|
# the primary image upon every boot. Without it, signature
|
|
|
|
# verification only happens on upgrade.
|
2017-05-12 03:19:36 +08:00
|
|
|
CFLAGS += -DMCUBOOT_VALIDATE_SLOT0
|
2017-02-02 23:23:57 +08:00
|
|
|
|
2017-06-14 21:35:40 +08:00
|
|
|
# Enabling this option uses newer flash map APIs. This saves RAM and
|
|
|
|
# avoids deprecated API usage.
|
|
|
|
#
|
|
|
|
# (This can be deleted when flash_area_to_sectors() is removed instead
|
|
|
|
# of simply deprecated.)
|
|
|
|
CFLAGS += -DMCUBOOT_USE_FLASH_AREA_GET_SECTORS
|
|
|
|
|
2017-05-05 23:41:34 +08:00
|
|
|
# Enable this option to not use the swapping code and just overwrite
|
|
|
|
# the image on upgrade.
|
2017-06-12 21:25:43 +08:00
|
|
|
#CFLAGS += -DMCUBOOT_OVERWRITE_ONLY
|
2017-05-05 23:41:34 +08:00
|
|
|
|
2017-02-02 23:10:23 +08:00
|
|
|
##############################
|
|
|
|
# End of configuration blocks.
|
|
|
|
##############################
|
|
|
|
|
|
|
|
# The board should be set to one of the targets supported by
|
|
|
|
# mcuboot/Zephyr. These can be found in ``boot/zephyr/targets``
|
|
|
|
BOARD ?= qemu_x86
|
|
|
|
|
2017-03-16 00:50:30 +08:00
|
|
|
# Additional board-specific Zephyr configuration
|
2017-03-17 05:39:04 +08:00
|
|
|
CONF_FILE += $(wildcard boot/zephyr/$(BOARD).conf)
|
2017-03-16 00:50:30 +08:00
|
|
|
|
2017-02-02 23:10:23 +08:00
|
|
|
# The source to the Zephyr-specific code lives here.
|
2017-01-11 00:49:47 +08:00
|
|
|
SOURCE_DIR = boot/zephyr
|
2017-01-07 02:16:53 +08:00
|
|
|
|
2017-01-11 00:51:39 +08:00
|
|
|
# Needed for mbedtls config-boot.h file.
|
|
|
|
CFLAGS += -I$(CURDIR)/boot/zephyr/include
|
|
|
|
|
2017-01-07 02:16:53 +08:00
|
|
|
include ${ZEPHYR_BASE}/Makefile.inc
|