[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bugs/Features in handling of continued Makefile rules

From: dpovey
Subject: Bugs/Features in handling of continued Makefile rules
Date: Thu, 20 Sep 2001 12:24:17 +1000

This is a multipart MIME message.
If automake doesn't recognise a line in a, 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.

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 


   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 

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 allow comments in the .am and omit them from the 

The following suggested patch fixes these things and also fixes a couple of
tests.  IMO it also gives a lot better error messages for'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. I have to confess to not adding a
test to make sure the patch now handles 1 and 2 correctly though.

Comments anyone?

Attachment: 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 Communciations |fax: +61 7 3864 1282    |       uASN.1: ASN.1 Compiler
Brisbane, Australia      |www:  | XML Security: XML 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]