blob: def6b518719bfd729cb83f023b80db5b49cc1e40 [file] [log] [blame]
David Brown3869e762017-02-02 08:10:23 -07001# Makefile for building mcuboot as a Zephyr project.
2
David Brown8322c302017-02-02 08:23:57 -07003# Configuration choices.
David Brown3869e762017-02-02 08:10:23 -07004
David Brown8322c302017-02-02 08:23:57 -07005#####################
6# Signature algorithm
7#####################
8# Choose one of RSA or ECDSA P-256 blocks, and uncomment the config
9# lines there, and comment out any other blocks.
10
David Brown3869e762017-02-02 08:10:23 -070011# RSA
David Brown299245d2017-01-10 09:49:47 -070012CONF_FILE = boot/zephyr/prj.conf
Fabio Utzig19356bf2017-05-11 16:19:36 -030013CFLAGS += -DMCUBOOT_SIGN_RSA -DMCUBOOT_USE_MBED_TLS
David Brown3869e762017-02-02 08:10:23 -070014
David Brown3869e762017-02-02 08:10:23 -070015# ECDSA P-256
David Brown3869e762017-02-02 08:10:23 -070016#CONF_FILE = boot/zephyr/prj-p256.conf
Fabio Utzig19356bf2017-05-11 16:19:36 -030017#CFLAGS += -DMCUBOOT_SIGN_EC256 -DMCUBOOT_USE_TINYCRYPT
David Brown09ef1c42017-09-07 10:44:25 -060018#NEED_TINYCRYPT = y
19#export NEED_TINYCRYPT
David Brown3869e762017-02-02 08:10:23 -070020
David Brown8322c302017-02-02 08:23:57 -070021# Enable this option to have the bootloader verify the signature of
22# the primary image upon every boot. Without it, signature
23# verification only happens on upgrade.
Fabio Utzig19356bf2017-05-11 16:19:36 -030024CFLAGS += -DMCUBOOT_VALIDATE_SLOT0
David Brown8322c302017-02-02 08:23:57 -070025
Marti Bolivarc50926f2017-06-14 09:35:40 -040026# Enabling this option uses newer flash map APIs. This saves RAM and
27# avoids deprecated API usage.
28#
29# (This can be deleted when flash_area_to_sectors() is removed instead
30# of simply deprecated.)
31CFLAGS += -DMCUBOOT_USE_FLASH_AREA_GET_SECTORS
32
David Brown17609d82017-05-05 09:41:34 -060033# Enable this option to not use the swapping code and just overwrite
34# the image on upgrade.
Fabio Utzig3488eef2017-06-12 10:25:43 -030035#CFLAGS += -DMCUBOOT_OVERWRITE_ONLY
David Brown17609d82017-05-05 09:41:34 -060036
David Brown3869e762017-02-02 08:10:23 -070037##############################
38# End of configuration blocks.
39##############################
40
41# The board should be set to one of the targets supported by
42# mcuboot/Zephyr. These can be found in ``boot/zephyr/targets``
43BOARD ?= qemu_x86
44
Andrew Boie709b8c32017-03-15 09:50:30 -070045# Additional board-specific Zephyr configuration
Andrew Boieae790dd2017-03-16 14:39:04 -070046CONF_FILE += $(wildcard boot/zephyr/$(BOARD).conf)
Andrew Boie709b8c32017-03-15 09:50:30 -070047
David Brown3869e762017-02-02 08:10:23 -070048# The source to the Zephyr-specific code lives here.
David Brown299245d2017-01-10 09:49:47 -070049SOURCE_DIR = boot/zephyr
David Brownc3319672017-01-09 10:35:50 -070050
David Browne7c66632017-01-10 09:51:39 -070051# Needed for mbedtls config-boot.h file.
52CFLAGS += -I$(CURDIR)/boot/zephyr/include
53
Marti Bolivar40948132017-08-30 17:54:53 -040054DTC_OVERLAY_FILE := $(CURDIR)/boot/zephyr/dts.overlay
55export DTC_OVERLAY_FILE
56
David Brownc3319672017-01-09 10:35:50 -070057include ${ZEPHYR_BASE}/Makefile.inc