Why SHELL defaults to sh.exe

"Christian Jullien" <[email protected]> Thu, 23 Jan 2020 11:27:53 +0100
Newsgroups gmane.comp.gnu.make.windows
Organization Eligis
Message-ID <[email protected]>
This is a multipart message in MIME format.

------=_NextPart_000_0006_01D5D1E0.27432910
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi team,

 

I wonder why Windows native gnumake.exe defaults to sh.exe ?

Building gnumake.exe with build_w32.bat (which defaults to cl.exe) still
uses sh.exe while IMHO it should default to cmd.exe

 

In an ideal world, I should be able to get for example all .c source files
with:

 

FILES   = $(shell dir /b *.c)

 

all:

        @echo $(SHELL)

        @echo $(FILES)

 

But if fails unless I first set SHELL as with

 

SHELL = cmd

FILES = $(shell dir /b *.c)

 

all:

        @echo $(SHELL)

        @echo $(FILES)

 

To not break current practice can you please add a new build_w32.bat option
--with-cmd

 

Options:

  --without-guile   Do not compile Guile support even if found

  --with-cmd        Use cmd.exe shell instead of sh.exe

  --debug           Make a Debug build--default is Release

  --x86             Make a 32bit binary--default is 64bit

  --help            Display these instructions and exit

 

Even better if you're able to pass a shell

 

Options:

  --without-guile      Do not compile Guile support even if found

  --with-shell <shell> Specifies default SHELL instead of sh.exe

  --debug              Make a Debug build--default is Release

  --x86                Make a 32bit binary--default is 64bit

  --help               Display these instructions and exit

 

C:> build_w32.bat -with-shell PowerShell

 

 


------=_NextPart_000_0006_01D5D1E0.27432910
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 =
(filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>Hi team,<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>I wonder why Windows native =
gnumake.exe defaults to sh.exe ?<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier New"'>Building =
gnumake.exe with build_w32.bat (which defaults to cl.exe) still uses =
sh.exe while IMHO it should default to cmd.exe<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>In an ideal world, I should be able =
to get for example all .c source files with:<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>FILES&nbsp;&nbsp; =3D $(shell dir /b =
*.c)<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'>all:<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier =
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @echo =
$(SHELL)<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier =
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @echo =
$(FILES)<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier New"'>But if fails =
unless I first set SHELL as with<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>SHELL =3D =
cmd<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>FILES =3D $(shell dir /b =
*.c)<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'>all:<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier =
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @echo =
$(SHELL)<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier =
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @echo =
$(FILES)<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier New"'>To not break =
current practice can you please add a new build_w32.bat option =
&#8211;-with-cmd<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'>Options:<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>&nbsp; --without-guile&nbsp;&nbsp; =
Do not compile Guile support even if found<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier New"'>&nbsp; =
--with-cmd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Use cmd.exe shell =
instead of sh.exe<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>&nbsp; =
--debug&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Make =
a Debug build--default is Release<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier New"'>&nbsp; =
--x86&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; Make a 32bit binary--default is 64bit<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier New"'>&nbsp; =
--help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Display these instructions and exit<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>Even better if you&#8217;re able to =
pass a shell<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'>Options:<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>&nbsp; --without-guile&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;Do not compile Guile support even if =
found<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>&nbsp; --with-shell &lt;shell&gt; =
Specifies default SHELL instead of sh.exe<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier New"'>&nbsp; =
--debug&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;Make a Debug build--default is =
Release<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>&nbsp; =
--x86&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; &nbsp;&nbsp;&nbsp;Make a 32bit binary--default is =
64bit<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'>&nbsp; =
--help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;Display these instructions and =
exit<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier New"'>C:&gt; =
build_w32.bat &#8211;with-shell PowerShell<o:p></o:p></span></p><p =
class=3DMsoNormal><span style=3D'font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></p></div></body></html>
------=_NextPart_000_0006_01D5D1E0.27432910--