py/mkrules.mk: Reset USER_C_MODULES when building mpy-cross dependency.

When a port automatically compiles `mpy-cross`, if `USER_C_MODULES` is
provided by the user on the command line then it is also applied to the
`mpy-cross` build.  That can lead to build errors if the path is relative
and not found when building `mpy-cross`.

Fix that by explicitly resetting `USER_C_MODULES` when invoking the
`mpy-cross` build.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This commit is contained in:
Andrew Leech
2025-02-03 16:03:22 +11:00
committed by Damien George
parent 71e8b27b26
commit b603fa38b2
2 changed files with 2 additions and 2 deletions

View File

@@ -211,7 +211,7 @@ if(MICROPY_FROZEN_MANIFEST)
endif()
add_custom_command(
OUTPUT ${MICROPY_MPYCROSS_DEPENDENCY}
COMMAND ${MICROPY_MAKE_EXECUTABLE} -C ${MICROPY_DIR}/mpy-cross
COMMAND ${MICROPY_MAKE_EXECUTABLE} -C ${MICROPY_DIR}/mpy-cross USER_C_MODULES=
)
endif()

View File

@@ -176,7 +176,7 @@ $(HEADER_BUILD):
ifneq ($(MICROPY_MPYCROSS_DEPENDENCY),)
# to automatically build mpy-cross, if needed
$(MICROPY_MPYCROSS_DEPENDENCY):
$(MAKE) -C "$(abspath $(dir $@)..)"
$(MAKE) -C "$(abspath $(dir $@)..)" USER_C_MODULES=
endif
ifneq ($(FROZEN_DIR),)