Skip to content

Commit

Permalink
Fix rules for building nonsecure image
Browse files Browse the repository at this point in the history
  • Loading branch information
sihyung-maxim committed Jun 10, 2024
1 parent bd62eed commit 88754c6
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Libraries/CMSIS/Device/Maxim/MAX32657/Source/GCC/max32657.mk
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,9 @@ SECURE_IMPLIB_OBJ := $(SECURE_BUILD_DIR)/secure_implib.o
# Add the Non-Secure project object to the build. This is the critical
# line that will get the linker to bring it into the .elf file.
PROJ_OBJS = ${NONSECURE_CODE_OBJ}
# PROJ_OBJS = ${SECURE_IMPLIB_OBJ}

.PHONY: nonsecurecode
nonsecurecode: $(NONSECURE_CODE_BIN)

$(NONSECURE_CODE_BIN):
# Run linker to generate
.PHONY: secure_implib_obj
secure_implib_obj:
@echo ""
@echo "****************************************************************************"
@echo "* Building Secure Code and generating a CMSE importlib object file"
Expand All @@ -159,6 +155,9 @@ $(NONSECURE_CODE_BIN):
@echo "****************************************************************************"
$(MAKE) -C ${SECURE_CODE_DIR} BUILD_DIR=$(SECURE_BUILD_DIR) PROJECT=secure GEN_CMSE_IMPLIB_OBJ=1

# Build non-secure code when secure code is updated (dependent on generated
# CMSE implib.o file).
$(NONSECURE_CODE_BIN): secure_implib_obj
@echo ""
@echo "****************************************************************************"
@echo "* Building Non-Secure Code with generated CMSE importlib object file."
Expand All @@ -170,9 +169,6 @@ $(NONSECURE_CODE_BIN):
@echo "* Linking Secure and Non-Secure images together."
@echo "****************************************************************************"

.PHONY: nsobj
nsobj: $(NONSECURE_CODE_OBJ)

${NONSECURE_CODE_OBJ}: $(LOADER_SCRIPT) ${NONSECURE_CODE_BIN}
@${CC} ${AFLAGS} -o ${@} -c $(LOADER_SCRIPT)

Expand Down

0 comments on commit 88754c6

Please sign in to comment.