espressif: fix dependencies in esp-idf modules

while developing esp-camera I had the problem that firmware.elf was
not regenerated if the only file I edited was in the esp32-camera
submodule.

By telling make that $(IDF_CMAKE_TARGETS), the list of .a fliles
produced by ninja-building esp-idf, depend on esp-idf-stamp and that
firmware.elf in turn depends on these files, the ninja build is re-run
on each make, which is reasonably quick if nothing needs to be rebuilt.
This commit is contained in:
Jeff Epler 2023-08-02 07:52:45 -05:00
parent cfbfd53b00
commit 2b0f1cd087
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -446,11 +446,13 @@ else
all: $(BUILD)/firmware.bin
endif
$(IDF_CMAKE_TARGETS): esp-idf-stamp
.PHONY: esp-idf-stamp
esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h
$(Q)ninja -C $(BUILD)/esp-idf $(IDF_CMAKE_TARGETS)
$(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp
$(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp $(IDF_CMAKE_TARGETS)
$(STEPECHO) "LINK $@"
$(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) $(MBEDTLS_COMPONENTS_LINK_EXPANDED) $(BUILD)/esp-idf/esp-idf/newlib/libnewlib.a -Wl,--end-group -u newlib_include_pthread_impl -u ld_include_highint_hdl -Wl,--start-group $(LIBS) -Wl,--end-group $(BUILD)/esp-idf/esp-idf/pthread/libpthread.a -u __cxx_fatal_exception