Makefile error make (e=2): The system cannot find the file specified

前端 未结 8 746
有刺的猬
有刺的猬 2020-12-09 09:20

I am using a makefile in windows to push some files on a Unix server (here a text file \"blob.txt\" in the same folder of my makefile). My makefile script is:



        
8条回答
  •  盖世英雄少女心
    2020-12-09 09:32

    @user3869623's solution works for me. I'd like to share some details of mine to complete the picture.

    My makefile contains below target:

    clean:
        @echo '$(OS)'
    ifeq ($(OS),Windows_NT)
        del /s *.o *.d *.elf *.map *.log
    endif
    

    When I run make clean, I see this error:

    Since it says something went wrong with echo, so I change my makefile target to below:

    clean:
    
    ifeq ($(OS),Windows_NT)
        del /s *.o *.d *.elf *.map *.log
    endif
    

    This time, make clean gives me this error:

    I am surprised to see bash here since I am working in Windows command line.

    Then I checked my %PATH%, I see this entry:

    C:\DevTools\Git\bin

    There's a bash.exe and sh.exe in that path. So I removed this entry, and it works fine now.

    BUT I STILL DON'T KNOW WHY BASH GET INTO THIS???

    ADD 1

    As to why the C:\DevTools\Git\bin shows up in my %PATH%, because I am using Sublime and it always asks me for the Git binaries:

提交回复
热议问题