[solved] building in MINGW32 / make TARGET=app fails with 'no rule to make target'



  • Submitted issue @ https://github.com/pycom/pycom-micropython-sigfox/issues/220

    Hello. I am trying to build firmware from source and make TARGET=app does not compile with following error. Hopefully it's something silly due to my unfamiliarity with the environment.

    ...
    CC ../py/../extmod/uos_dupterm.c
    CC ../py/../lib/embed/abort_.c
    CC ../py/../lib/utils/printf.c
    make: *** No rule to make target 'build/WIPY/release/frozen_mpy/frozen/Base/_boot.mpy', needed by 'build/WIPY/release/frozen_mpy.c'.  Stop.
    

    I have followed these instructions to setup the build environment on Windows 10:

    1. https://docs.espressif.com/projects/esp-idf/en/latest/get-started/
      I am able to build vanilla esp-idf hello_world example.
    2. https://github.com/pycom/pycom-micropython-sigfox
      I did not download the listed xtensa gcc compiler since one already exists from step #1.
    xtensa-esp32-elf-gcc.exe (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 5.2.0
    
    $ printenv PATH
    /mingw32/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/opt/xtensa-esp32-elf/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
    
    1. https://github.com/pycom/pycom-esp-idf
    $ printenv IDF_PATH
    D:/msys32/home/chris/esp/pycom-esp-idf
    
    1. build
    cd mpy-cross && make clean && make && cd ..
    cd esp32
    make clean
    make TARGET=boot
    make TARGET=app
    make flash
    

    output of mpy-cross:

    LINK mpy-cross
       text    data     bss     dec     hex filename
     128257    2596     708  131561   201e9 mpy-cross
    

    output of boot target:

    LINK xtensa-esp32-elf-gcc *** -nostdlib -Wl,-Map=build/WIPY/release/bootloader/bootloader.map -Wl,--no-check-sections -u call_user_start_cpu0 -Wl,-static -Wl,--undefined=uxTopUsedPriority -Wl,--gc-sections -T esp32.bootloader.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.bootloader.rom.ld -T esp32.rom.spiram_incompatible_fns.ld *** -Wl,--start-group -Lbootloader/lib -Lbootloader -Lbuild/WIPY/release/bootloader -LD:/msys32/home/chris/esp/pycom-esp-idf/components/esp32/ld -LD:/msys32/home/chris/esp/pycom-esp-idf/components/esp32/lib -llog -lcore -lbootloader_support -lspi_flash -lsoc -lmicro-ecc -lgcc -lstdc++ -lgcov build/WIPY/release/bootloader/bootloader.a -Wl,--end-group -Wl,-EL -o build/WIPY/release/bootloader/bootloader.elf
       text    data     bss     dec     hex filename
      16310       8      40   16358    3fe6 build/WIPY/release/bootloader/bootloader.elf
    IMAGE build/WIPY/release/bootloader/bootloader.bin
    

    Thanks
    Chris



  • Resolved...

    diff --git a/py/mkrules.mk b/py/mkrules.mk
    index 633b0df..b9b235c 100644
    --- a/py/mkrules.mk
    +++ b/py/mkrules.mk
    @@ -115,6 +115,13 @@ FROZEN_MPY_PY_FILES += $(shell find -L $(FROZEN_MPY_DIR)/Common/ -type f -name '
     ifeq ($(BOARD), $(filter $(BOARD), GPY FIPY))
     FROZEN_MPY_PY_FILES += $(shell find -L $(FROZEN_MPY_DIR)/LTE/ -type f -name '*.py' | $(SED) -e 's/$(FROZEN_MPY_DIR)\/LTE\///')
     endif
    +else ifeq ($(findstring MINGW32,$(OS_NAME)),MINGW32)
    +# make a list of all the .py files that need compiling and freezing
    +FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR)/Base/ -type f -name '*.py' | $(SED) -e 's/$(FROZEN_MPY_DIR)\/Base\///')
    +FROZEN_MPY_PY_FILES += $(shell find -L $(FROZEN_MPY_DIR)/Common/ -type f -name '*.py' | $(SED) -e 's/$(FROZEN_MPY_DIR)\/Common\///')
    +ifeq ($(BOARD), $(filter $(BOARD), GPY FIPY))
    +FROZEN_MPY_PY_FILES += $(shell find -L $(FROZEN_MPY_DIR)/LTE/ -type f -name '*.py' | $(SED) -e 's/$(FROZEN_MPY_DIR)\/LTE\///')
    +endif
     else
     # make a list of all the .py files that need compiling and freezing
     FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR)/Base/ -type f -name '*.py' | $(SED) -e 's=^$(FROZEN_MPY_DIR)\/Base\//==')
    


Pycom on Twitter