Search code examples
cbashcmdmakefilecygwin

Cygwin bash.exe cannot run make, works in cmd.exe


I am having issues running any make command in a Cygwin bash terminal. The following is the error that is returned.

"'ygdrive' is not reconized as an internal or external command, operable program or batch file"

However I am able to properly run the make file using cmd.exe, any help would be appreciated.

Thanks Eric E


Solution

  • Looks like you are referencing a path in some recipe with \cygdrive\<letter>\.... bash interprets a single backslash as an escape character and therefore ignores the c directly following it.

    Solutions:

    1. If you want the Makefile to be portable to Unix systems, just write forward slashes in paths like this /cygdrive/<letter>/....

    2. If you instead want the Makefile to be compatible with cmd, too, use double backslashes like \\cygdrive\\<letter\\... -- both bash and cmd will understand this.

    In any case, such a path should be in a make variable because it is probably completely different on another machine.