Re: [bug] (un)escaping problem in the makefile database output

2007-06-04 Thread Paul Smith
On Mon, 2007-06-04 at 11:19 +0800, Agent Zhang wrote:
 Or is it indeed intentional by design and the database is not supposed
 to be in strictly-valid makefile notation anyway? I'm not sure, so I
 think it may be wise to ask here first before firing off a bug report
 to Savannah.

It's certainly not intentionally one way or the other: the output from
-p is intended as a debugging tool for users.  I don't believe it was
ever intended to be used as valid makefile input into another program
(or even back into GNU make itself).  And there's certainly no intent to
make it an _invalid_ makefile either.  I expect the lack of quoting for
the # is nothing more or less than oversight or laziness (and I mean
laziness in the good, Larry Wall way :-)).

Feel free to file an enhancement request on Savannah to have this
addressed.

-- 
---
 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


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: [bug] (un)escaping problem in the makefile database output

2007-06-04 Thread Agent Zhang

On 6/4/07, Paul Smith [EMAIL PROTECTED] wrote:


Feel free to file an enhancement request on Savannah to have this
addressed.



Already done in bug #20067 :)

But I marked it as a bug instead of an enhancement. Sorry about that.

Cheers, agentz


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug] (un)escaping problem in the makefile database output

2007-06-03 Thread Agent Zhang

Hi, there~

I've been fiddling about with the Makefile databases generated by
'make -pq' since I'm writing a gnu make runtime in pure Perl (in order
to bootstrap my complete Perl rewrite of gmake easily). I've been
assuming that the stuff generated by 'make -pg' is in valid gmake
syntax and my hybrid child has already succeeded in passing a lot of
tests in gmake's test suite (yay!) until got stuck by features/escape.

The problem is that 'make -pg' generates the following stuff for the
rule  foo\#bar.ext: ; @echo foo\#bar.ext = '$@' :

 foo#bar.ext:
 #  Implicit rule search has not been done.
 #  Modification time never checked.
 #  File has not been updated.
 #  commands to execute (from `./Makefile_qCzal', line 6):
@echo foo\#bar.ext = '$@'

where the first # character should have been escaped by \ but
doesn't. :( You know, I'm using a Makefile parser to parse the
database output so as to maximize code reuse. Unfortunately the
unescaped # stuff fools my parser horribly :(

Yes, it would be possible to patch or preprocess the database output
before actually feeding it to the parser on my side, but it's fragile
and ugly. I believe the fix should be straight-forward on the gmake
side.

Or is it indeed intentional by design and the database is not supposed
to be in strictly-valid makefile notation anyway? I'm not sure, so I
think it may be wise to ask here first before firing off a bug report
to Savannah. :)

Thanks for taking time to read this!

Cheers, agentz

P.S. the make I'm using: GNU Make 3.81  i486-pc-linux-gnu


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make