From b0967cb1a4867a386c4e2116a77d89df81dd7ba3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 27 Aug 2023 16:09:17 -0500 Subject: [PATCH] Use QSTR_GLOBAL_REQUIREMENTS to give explicit dependency for qstr generation I investigated and found that this seems to be the best way to specify a file that must be generated before "qstr processing" can occur. Closes #8337 --- ports/atmel-samd/Makefile | 2 +- ports/espressif/Makefile | 5 +---- ports/raspberrypi/Makefile | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 0f01c789c6..9457486959 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -352,7 +352,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) -SRC_QSTR += $(HEADER_BUILD)/sdiodata.h +QSTR_GLOBAL_REQUIREMENTS += $(HEADER_BUILD)/sdiodata.h OBJ_EXTRA_ORDER_DEPS += $(HEADER_BUILD)/sioddata.h $(HEADER_BUILD)/sdiodata.h: tools/mksdiodata.py | $(HEADER_BUILD) $(Q)$(PYTHON) $< > $@ diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index ed4b95828b..320fda78fc 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -353,7 +353,7 @@ endif # create the config headers .PHONY: do-sdkconfig do-sdkconfig: $(BUILD)/esp-idf/config/sdkconfig.h -$(BUILD)/genhdr/qstr.i.last: $(BUILD)/esp-idf/config/sdkconfig.h +QSTR_GLOBAL_REQUIREMENTS += $(BUILD)/esp-idf/config/sdkconfig.h $(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig CMakeLists.txt | $(BUILD)/esp-idf IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja -DCIRCUITPY_ESPCAMERA=$(CIRCUITPY_ESPCAMERA) @@ -378,9 +378,6 @@ menuconfig: $(BUILD)/esp-idf/config $(BUILD)/esp-idf/config/sdkconfig.h # We should use that when available. For now, we sort out everything. python tools/update_sdkconfig.py --board=$(BOARD) --debug=$(DEBUG) -# qstr builds include headers so we need to make sure they are up to date -$(HEADER_BUILD)/qstr.split: | $(BUILD)/esp-idf/config/sdkconfig.h - BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a libsmartconfig.a libwapi.a BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libphy.a $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS)) ifeq ($(IDF_TARGET),esp32) diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 2e5d69dabf..1a9cd35f55 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -424,7 +424,8 @@ $(BUILD)/stage2.c: stage2.c.jinja gen_stage2.py | $(BUILD)/ $(STEPECHO) "GEN $<" $(Q)$(PYTHON) gen_stage2.py $< $@ $(EXTERNAL_FLASH_DEVICES) -$(HEADER_BUILD)/flash_info.h: flash_info.h.jinja gen_stage2.py | $(HEADER_BUILD)/ +QSTR_GLOBAL_REQUIREMENTS += $(HEADER_BUILD)/flash_info.h +$(HEADER_BUILD)/flash_info.h: flash_info.h.jinja gen_stage2.py $(STEPECHO) "GEN $<" $(Q)$(PYTHON) gen_stage2.py $< $@ $(EXTERNAL_FLASH_DEVICES)