automake
[Top][All Lists]
Advanced

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

Re: 25-clean-targets.patch


From: Akim Demaille
Subject: Re: 25-clean-targets.patch
Date: 06 Feb 2001 10:23:35 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Crater Lake)

Tom Tromey <address@hidden> writes:

> >>>>> "Akim" == Akim Demaille <address@hidden> writes:
> 
> Akim> so naturally the question is: do we really want to keep this
> Akim> zillions of pseudo targets?  The current automake, indeed, does
> Akim> this instead:
> 
> Akim> ----------
> Akim> clean-am: clean-this-am
> Akim> clean-this-am:
> Akim>         do this
> 
> Akim> clean-am: clean-that-am
> Akim> clean-that-am:
> Akim>         do that
> Akim> ----------
> 
> Akim> which will result in
> 
> Akim> ----------
> Akim> clean-am: clean-this-am clean-that-am
> 
> Akim> clean-this-am:
> Akim>         do this
> 
> Akim> clean-that-am:
> Akim>         do that
> Akim> ----------
> 
> 
> This transformation seems safe enough to me.  I don't have a problem
> with it.
> What you don't want to do is inline the actual rules.  This is
> tempting (and it is what I thought you were talking about at first).
> However, it breaks parallel builds and also `make -k'.

That's indeed what I was referring to.  Well, I think.  What were you
thinking about?  I did not think about parallel builds...  THe
transformation above is what is now implemented.  In fact, what I
presented in the previous, both are implemented, it just depends on
the input you give it.


> Akim> -    my $category;
> Akim> -    foreach $category (sort keys %dependencies)
> Akim> +    foreach (sort target_cmp keys %dependencies)
> 
> I've been moving away from using $_ in any but the most trivial loops.
> I thought $_ wasn't necessarily preserved across function calls.

Good call!  Thanks Pollux (aka Alexandre D.) who lent me a Perl book,
and I found this in it:

--------------------------------------------------
% cat /tmp/foo.plk
#! /usr/bin/perl

sub trash ()
{
  local $_ = "sub3\n";
}

########################################

local $_ = "Yeeehaa!\n";
print;
trash;
print;
% perl -w /tmp/foo.plk
Yeeehaa!
Yeeehaa!
--------------------------------------------------

so how about using $_ with caution?  Just tell me your preference.


> Akim> +                 unless (defined $contents{$targets})
> Akim> +                   {
> 
> Please use `if (! ...)' here.  I find `unless' confusing when used
> like this.

OK!



reply via email to

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