[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch to correct handling of continued rules
From: |
dpovey |
Subject: |
Patch to correct handling of continued rules |
Date: |
Tue, 30 Oct 2001 11:40:01 +1000 |
I posted this to the main automake list a while ago, but it got lost in
the noise. I have polished up with current CVS and am resubmitting.
If automake doesn't recognise a line in a Makefile.am, it assumes that it
is the continuation of a Makefile rule.
In having a look at the code, I think there are a few problems with the way
this is handled, particularly with regards to the handling of comments and
whitespace.
1. If an umatched line continues a rule, then the line should start
with a leading tab. If it doesn't, it is probably a good idea to flag
this as an error. The only place where I can see that this is an issue
is if you get something like
@SUBST_ME@
which is then substituted with a valid Makefile line which may or may
not continue a rule. I think this should be handled as a special case.
2. The code as it stands seems to allow the following:
target: dependencies
# A comment here and some whitespace following
<tab>echo do something
While this is fine on GNU make, on BSD make you need to delete the
comment and the blank line from the resulting Makefile to get it to
work.
3. Because of a stupidity in Tru64 make, automake displays
an error message if comments are found immediately after the tab (plus
zero/more whitespace). I think perhaps a nicer approach would be for
automake to print a warning and omit the comments from the Makefile.in
output.
The following suggested patch fixes these things and also fixes a couple of
tests. IMO it also gives a lot better error messages for Makefile.am's
that are bogus. It is quite possible that I have fundamentally
misunderstood how the old code works, and the patch will cause problems, but
it seems to pass the testsuite (at least it doesn't cause any new failures
on the latest CVS on Solaris and FreeBSD). I have to confess to not adding a
test to make sure the patch now handles 1 and 2 correctly though.
patch
Description: patch
Dean Povey, |em: address@hidden| JCSI: Java security toolkit
Senior S/W Developer |ph: +61 7 3864 5120 | uPKI: Embedded/C PKI toolkit
Wedgetail Communications |fax: +61 7 3864 1282 | uASN.1: ASN.1 Compiler
Brisbane, Australia |www: www.wedgetail.com | XML Security: XML
Signatures
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Patch to correct handling of continued rules,
dpovey <=