help-make
[Top][All Lists]
Advanced

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

Re: A function to print instead of $(warning ) or $(error )


From: Pete Johnson
Subject: Re: A function to print instead of $(warning ) or $(error )
Date: Wed, 23 Feb 2005 07:00:20 -0800


No, it won't work for a number of reasons. First, the output of the shell command has newlines collapsed to spaces and then becomes the return value of the shell function. It does not generate any output to the terminal. Below I had mentioned that I tried this with redirecting stdout to stderr. This does cause output, but only works with single line variable values. Multi line strings cause make errors.

The irony in all of this is that adding a function say "print" to make to do this would only take a few lines of code in function.c, but I just can't figure out how to do it within make.

-Pete

On Feb 23, 2005, at 5:27 AM, Noel Yap wrote:

Would $(shell echo) do?

HTH,
Noel

Pete Johnson wrote:

In trying to add some help messages to my Makefiles I have come across the following problem. I would like a function just like $(warning ), except I don't want it to prefix the message with <makefile>:<line>:
For example, if I have a Makefile like this...
define foo
a multi
line
string
endef
$(warning $(foo))
nothing:
and I run make, I get the following...
% make
Makefile:6: a multi
line
string
make: Nothing to be done for `nothing'.
I would like to just see...
% make
a multi
line
string
make: Nothing to be done for `nothing'.
I have tried using something like $(shell echo $(foo) 1>&2) but this will not work with multi-line strings (although it works fine for one line strings). Does anyone know how to do this? I am surprised that this is not a built-in function.
Thanks,
-Pete
_______________________________________________
Help-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-make





reply via email to

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