Support building existing TARGET= with `make libwolfboot.a`.

pull/569/head
David Garske 2025-04-18 15:58:22 -07:00 committed by Daniele Lacamera
parent 3a2ac0b7a8
commit a24a52fa65
2 changed files with 12 additions and 5 deletions

15
arch.mk
View File

@ -1158,11 +1158,18 @@ else
UPDATE_OBJS:=src/update_flash_hwswap.o
endif
endif
# Set default update object (if not library)
ifneq ($(TARGET),library)
ifeq ($(UPDATE_OBJS),)
UPDATE_OBJS:=./src/update_flash.o
## For library target disable partitions
ifeq ($(TARGET),library)
WOLFBOOT_NO_PARTITIONS=1
NO_LOADER=1
endif
## Set default update object
ifneq ($(WOLFBOOT_NO_PARTITIONS),1)
ifeq ($(UPDATE_OBJS),)
UPDATE_OBJS:=./src/update_flash.o
endif
endif
## wolfBoot origin

View File

@ -621,7 +621,7 @@ void RAMFUNCTION hal_flash_lock(void)
return;
}
#ifndef TARGET_library
#if !defined(WOLFBOOT_NO_PARTITIONS) && !defined(TARGET_library)
void* hal_get_primary_address(void)
{
return (void*)WOLFBOOT_PARTITION_BOOT_ADDRESS;