File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,22 +181,19 @@ ifneq ($(FROZEN_MPY_DIR),)
181181# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
182182MPY_CROSS = ../mpy-cross/mpy-cross
183183MPY_TOOL = ../tools/mpy-tool.py
184- FROZEN_MPY_PY_FILES := $(wildcard $(FROZEN_MPY_DIR ) /* .py)
184+ FROZEN_MPY_PY_FILES := $(shell find $(FROZEN_MPY_DIR ) / -type f -name ' * .py' )
185185FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD ) /,$(FROZEN_MPY_PY_FILES:.py=.mpy ) )
186186CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
187187CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
188188CFLAGS += -DMICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE=0 # not supported
189189CFLAGS += -DMPZ_DIG_SIZE=16 # force 16 bits to work on both 32 and 64 bit archs
190190OBJ += $(BUILD ) /$(BUILD ) /frozen_mpy.o
191191
192- # to create output directory for .mpy files
193- $(BUILD ) /$(FROZEN_MPY_DIR ) :
194- $(MKDIR ) -p $@
195-
196192# to build .mpy files from .py files
197- $(BUILD ) /$(FROZEN_MPY_DIR ) /% .mpy : $(FROZEN_MPY_DIR ) /% .py | $( BUILD ) / $( FROZEN_MPY_DIR )
193+ $(BUILD ) /$(FROZEN_MPY_DIR ) /% .mpy : $(FROZEN_MPY_DIR ) /% .py
198194 @$(ECHO ) " MPY $<"
199- $(Q )$(MPY_CROSS ) -o $@ $^
195+ $(Q )$(MKDIR ) -p $(dir $@ )
196+ $(Q )$(MPY_CROSS ) -o $@ -s $(^:$(FROZEN_MPY_DIR ) /%=% ) $^
200197
201198# to build frozen_mpy.c from all .mpy files
202199$(BUILD ) /frozen_mpy.c : $(FROZEN_MPY_MPY_FILES ) $(BUILD ) /genhdr/qstrdefs.generated.h
You can’t perform that action at this time.
0 commit comments