bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Windows shell discovery (was: Re: Incorrect path and shell script er


From: Eli Zaretskii
Subject: Re: Windows shell discovery (was: Re: Incorrect path and shell script error)
Date: Fri, 08 May 2020 09:22:23 +0300

> From: Loch Brandon <address@hidden>
> CC: "address@hidden" <address@hidden>
> Date: Thu, 7 May 2020 19:47:58 +0000
> 
> Alright so I added the path to the cmd.exe and I now see a different error.

I didn't say to add the path to cmd.exe.  I meant to write exactly
this line in the beginning of the Makefile:

  SHELL = cmd.exe

> This is the output while running make.
> 
> C:\Users\bl68969.JDNET\Projects\HHP2\Code\M2_501\ProgramSpecific\MakeFileBuild>make
> echo 
> ------------------------------------------------------------------------------
> A subdirectory or file C:\Users\BL6896~1.JDN\AppData\Local\Temp\make75042.sh 
> already exists.
> Error occurred while processing: 
> C:\Users\BL6896~1.JDN\AppData\Local\Temp\make75042.sh.
> make: *** [dirs] Error 1

This probably means your old version of Make doesn't support
"SHELL = cmd.exe".  I guess I've misremembered when this was added.
The bottom line is that your Make is too old to handle the situation
with PATH and Unix shell availability on your system.

So my suggestion is to do either of the following:

  . find out what changed on your system that this Makefile started
    failing (Paul's hypothesis about Git for Windows making sh.exe
    appear on PATH sounds in the right direction), and fix it

  . rewrite your Makefile to invoke cmd.exe explicitly.  For example,
    instead of

      @if not exist $(OUTPUTDIR) $(MKDIR) $(OUTPUTDIR)

    write something like

      @cmd.exe /c if not exist $(OUTPUTDIR) $(MKDIR) $(OUTPUTDIR)

  . upgrade to a newer version of Make, where SHELL = cmd.exe should
    fix the problem.

In general, as Paul said, your problems happen because the Makefile
commands are supposed to be run by cmd.exe, but for some reason Make
invokes sh.exe to run them.  If none of the above advice helps,
finding out why Make calls sh.exe now where it didn't before should
provide a clue for how to fix the problem.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]