make-w32
[Top][All Lists]
Advanced

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

Re: setting SHELL variable


From: Paul D. Smith
Subject: Re: setting SHELL variable
Date: Fri, 29 Jul 2005 10:23:44 -0400

%% Eli Zaretskii <address@hidden> writes:

  >> $(warning SHELL=$(SHELL))
  >> SHELL := cmd.exe
  >> $(warning SHELL=$(SHELL))
  >> 
  >> And I get:
  >> Makefile:1: SHELL=C:/mks/mksnt/sh.exe
  >> Makefile:3: SHELL=C:/mks/mksnt/sh.exe
  >> 
  >> However, I notice that the behavior for simple commands before setting
  >> SHELL is the behavior of sh.exe, and the behavior for simple commands
  >> after setting SHELL is the behavior of cmd.exe.  Is this the expected
  >> behavior or not?

  ez> Yes, I think this is expected behavior: you are neglecting the
  ez> fact that Make first reads the entire Makefile, and at that time
  ez> all the variables are set and all the non-command parts are
  ez> evaluated.

No, variables are set as soon as the makefile is read.  The only
question is whether the value that they're set to is evaluated
immediately (as above when you use :=) or deferred until later (when you
use "=" etc.)

In the case above, since the value has no variables or functions in it,
it doesn't actually matter.  Plus, even if it was deferred, it would be
evaluated when the warning function was evaluated.

The second $(warning ...) should print  "cmd.exe" I would think.

But, there's a lot of strange behavior regarding SHELL in
DOS/Windows/OS2 that I'm not familiar with.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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