On Mon, 2010-10-25 at 15:33 +0300, Angel Tsankov wrote:
> >>>> ./a.out: a.o
> >>>> @echo $@ # Prints a.out instead of ./a.out
I believe there is a bug about this already reported in Savannah
somewhere, asking that $@ always contain the exact string for the target
that was used in the makefile. Make has to turn this into a canonical
name so that if you write two different rules for the same target, but
one with "./" and one without, the prerequisites etc. are hooked up
properly.
We need to read the manual carefully regarding canonical paths, etc. to
see what the manual guarantees before we can make changes to the default
behavior. There are times where this will make a difference, as you've
described.
For now you can always add the path back, with something like:
$(if $(findstring /,$@),$@,./$@)
so if no "/" appears in $@ then you get "./$@" otherwise you get "$@".
--
-------------------------------------------------------------------------------
Paul D. Smith <[email protected]> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.net
"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