On Sat, Jul 31, 2010 at 4:54 PM, Jon Grant <[email protected]> wrote:
> I am using make 3.81 built for MinGW.
>
> How easy to output the Makefile.mak:line for each command that fails to start?
I don't think there's any way for a snippet of Makefile to figure out
what its line # and filename are. The $(warning) function will
include them in its output, but I don't see any way to trigger that
based on the success or failure of a command without completely
changing how the makefile operates.
Hmm.
So, what's needed is for a future version of GNU make to provide some
way to get the current filename and line number. Now, that could mean
a number of things. The *obvious* answer would be to provide
$(filename) and $(linenumber) functions that expand to the line number
and filename where they are expanded. I'm 80% sure that that's the
right choice. Consider the following sort of makefile:
------
define rules
echo "build $@ at $(filename):$(linenumber)"
@touch $@
endef
foo:
$(rules)
------
Should the reported line number be that of the use of $(rules), or
should it be where $(linenumber) was writen? I'm mostly convinced
that the answer is the former, but I have slight misgivings and I
suspect there are places where someone would want immediate expansion.
Philip Guenther
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make