[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug] (un)escaping problem in the makefile database output
From: |
Agent Zhang |
Subject: |
[bug] (un)escaping problem in the makefile database output |
Date: |
Mon, 4 Jun 2007 11:19:26 +0800 |
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] (un)escaping problem in the makefile database output,
Agent Zhang <=