automake
[Top][All Lists]
Advanced

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

order of variables and rules in output


From: Ben Pfaff
Subject: order of variables and rules in output
Date: Wed, 25 Aug 2010 10:22:58 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

In a Makefile, the relative order of variable and rule
definitions matters, because variables used in targets are
expanded when rules are read.  If a variable is used in a target
before the variable is changed, the variable's former expansion
is used in the target, not the latter expansion.

Current Automake appears to reorder the Makefile.am so that all
variable assignments precede all rules, so in a Makefile.am the
relative order of variable and rule definitions does not matter.

Is this behavior documented?  Is it guaranteed to remain in the
future?  I could not easily find mention of it in the manual, but
it is sometimes convenient.

Thanks,

Ben.
-- 
Ben Pfaff 
http://benpfaff.org



reply via email to

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