%% "Robert P. J. Day" <[EMAIL PROTECTED]> writes:

  rpjd> all:
  rpjd>         # $(warning whatever)

  rpjd> that command above has a leading tab so, according to the docs,
  rpjd> it should be treated as a shell command.  but it's clearly the
  rpjd> make warning built-in and, even with that "#", it's processed by
  rpjd> make as a warning.  why?

Just like any other command: when make sees it needs to invoke the
command line it first expands it, then it sends the result of the
expansion to the shell.

In this case, the act of expanding the string causes the warning to fire
and print the warning (since that's what the warning function does).
The result of expanding the $(warning ...) function is the empty string,
so the string "# " is first printed by make (since you don't prefix the
line by "@"), then it is passed to the shell for execution.  The shell
sees this as a comment (in most shells anyway) and doesn't do anything.


Hope this makes things more clear.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          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


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to