David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 1 | # Makefile for building mcuboot as a Zephyr project. |
| 2 | |
David Brown | 8322c30 | 2017-02-02 08:23:57 -0700 | [diff] [blame] | 3 | # Configuration choices. |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 4 | |
David Brown | 8322c30 | 2017-02-02 08:23:57 -0700 | [diff] [blame] | 5 | ##################### |
| 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 Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 11 | # RSA |
David Brown | 299245d | 2017-01-10 09:49:47 -0700 | [diff] [blame] | 12 | CONF_FILE = boot/zephyr/prj.conf |
Fabio Utzig | 19356bf | 2017-05-11 16:19:36 -0300 | [diff] [blame] | 13 | CFLAGS += -DMCUBOOT_SIGN_RSA -DMCUBOOT_USE_MBED_TLS |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 14 | |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 15 | # ECDSA P-256 |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 16 | #CONF_FILE = boot/zephyr/prj-p256.conf |
Fabio Utzig | 19356bf | 2017-05-11 16:19:36 -0300 | [diff] [blame] | 17 | #CFLAGS += -DMCUBOOT_SIGN_EC256 -DMCUBOOT_USE_TINYCRYPT |
David Brown | 09ef1c4 | 2017-09-07 10:44:25 -0600 | [diff] [blame] | 18 | #NEED_TINYCRYPT = y |
| 19 | #export NEED_TINYCRYPT |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 20 | |
David Brown | 8322c30 | 2017-02-02 08:23:57 -0700 | [diff] [blame] | 21 | # 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 Utzig | 19356bf | 2017-05-11 16:19:36 -0300 | [diff] [blame] | 24 | CFLAGS += -DMCUBOOT_VALIDATE_SLOT0 |
David Brown | 8322c30 | 2017-02-02 08:23:57 -0700 | [diff] [blame] | 25 | |
Marti Bolivar | c50926f | 2017-06-14 09:35:40 -0400 | [diff] [blame] | 26 | # 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.) |
| 31 | CFLAGS += -DMCUBOOT_USE_FLASH_AREA_GET_SECTORS |
| 32 | |
David Brown | 17609d8 | 2017-05-05 09:41:34 -0600 | [diff] [blame] | 33 | # Enable this option to not use the swapping code and just overwrite |
| 34 | # the image on upgrade. |
Fabio Utzig | 3488eef | 2017-06-12 10:25:43 -0300 | [diff] [blame] | 35 | #CFLAGS += -DMCUBOOT_OVERWRITE_ONLY |
David Brown | 17609d8 | 2017-05-05 09:41:34 -0600 | [diff] [blame] | 36 | |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 37 | ############################## |
| 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`` |
| 43 | BOARD ?= qemu_x86 |
| 44 | |
Andrew Boie | 709b8c3 | 2017-03-15 09:50:30 -0700 | [diff] [blame] | 45 | # Additional board-specific Zephyr configuration |
Andrew Boie | ae790dd | 2017-03-16 14:39:04 -0700 | [diff] [blame] | 46 | CONF_FILE += $(wildcard boot/zephyr/$(BOARD).conf) |
Andrew Boie | 709b8c3 | 2017-03-15 09:50:30 -0700 | [diff] [blame] | 47 | |
David Brown | 3869e76 | 2017-02-02 08:10:23 -0700 | [diff] [blame] | 48 | # The source to the Zephyr-specific code lives here. |
David Brown | 299245d | 2017-01-10 09:49:47 -0700 | [diff] [blame] | 49 | SOURCE_DIR = boot/zephyr |
David Brown | c331967 | 2017-01-09 10:35:50 -0700 | [diff] [blame] | 50 | |
David Brown | e7c6663 | 2017-01-10 09:51:39 -0700 | [diff] [blame] | 51 | # Needed for mbedtls config-boot.h file. |
| 52 | CFLAGS += -I$(CURDIR)/boot/zephyr/include |
| 53 | |
Marti Bolivar | 4094813 | 2017-08-30 17:54:53 -0400 | [diff] [blame] | 54 | DTC_OVERLAY_FILE := $(CURDIR)/boot/zephyr/dts.overlay |
| 55 | export DTC_OVERLAY_FILE |
| 56 | |
David Brown | c331967 | 2017-01-09 10:35:50 -0700 | [diff] [blame] | 57 | include ${ZEPHYR_BASE}/Makefile.inc |