Skip to content

Commit

Permalink
boot/mcuboot: Fix inclusion of more than one example app
Browse files Browse the repository at this point in the history
Even though the options existed, the second application would override
the values, resulting in the missing first application on the final
binary.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
  • Loading branch information
gustavonihei authored and xiaoxiang781216 committed Nov 5, 2021
1 parent fbdfb0e commit 6942378
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions boot/mcuboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,27 @@ VPATH += :$(MCUBOOT_UNPACK)$(DELIM)src
VPATH += :$(MCUBOOT_SRCDIR)

ifneq ($(CONFIG_MCUBOOT_UPDATE_AGENT_EXAMPLE),)
MAINSRC = mcuboot_agent_main.c

PROGNAME = mcuboot_agent
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE)
else ifneq ($(CONFIG_MCUBOOT_SLOT_CONFIRM_EXAMPLE),)
MAINSRC = mcuboot_confirm_main.c

PROGNAME = mcuboot_confirm
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE)
else ifneq ($(CONFIG_MCUBOOT_BOOTLOADER),)
MAINSRC = mcuboot/boot/nuttx/main.c

PROGNAME = mcuboot_loader
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE)
MAINSRC += mcuboot_agent_main.c

PROGNAME += mcuboot_agent
PRIORITY += SCHED_PRIORITY_DEFAULT
STACKSIZE += $(CONFIG_DEFAULT_TASK_STACKSIZE)
endif

ifneq ($(CONFIG_MCUBOOT_SLOT_CONFIRM_EXAMPLE),)
MAINSRC += mcuboot_confirm_main.c

PROGNAME += mcuboot_confirm
PRIORITY += SCHED_PRIORITY_DEFAULT
STACKSIZE += $(CONFIG_DEFAULT_TASK_STACKSIZE)
endif

ifneq ($(CONFIG_MCUBOOT_BOOTLOADER),)
MAINSRC += mcuboot/boot/nuttx/main.c

PROGNAME += mcuboot_loader
PRIORITY += SCHED_PRIORITY_DEFAULT
STACKSIZE += $(CONFIG_DEFAULT_TASK_STACKSIZE)
endif

CFLAGS += -Wno-undef
Expand Down

0 comments on commit 6942378

Please sign in to comment.