diff options
author | Alexandre Duret-Lutz <adl@gnu.org> | 2003-08-12 17:52:09 +0000 |
---|---|---|
committer | Alexandre Duret-Lutz <adl@gnu.org> | 2003-08-12 17:52:09 +0000 |
commit | 9a7923144d3e06fb9f6176f888044483ab79fdc1 (patch) | |
tree | 16e671367b1e6f128208e17d77fb62dd2bbf32b0 /lib/Automake/VarDef.pm | |
parent | 90793a7453fcf7768e179a13a95926c539ae408e (diff) | |
download | automake-9a7923144d3e06fb9f6176f888044483ab79fdc1.tar.gz |
* lib/Automake/Item.pm, lib/Automake/ItemDef.pm: New files.
* lib/Automake/Rule.pm, lib/Automake/RuleDef.pm: New files.
* lib/Automake/Makefile.am (dist_perllib_DATA): Add them.
* lib/Automake/VarDef.pm: Make this a subclass of Automake::ItemDef.
(new): Adjust to call Automake::ItemDef::new.
(comment, location, owner): Delete. Now inherited from ItemDef.
* lib/Automake/Variable.pm: Make this a subclass of Automake::Item.
(_new): Adjust to call Automake::Item::new.
(name, def, rdef, _set, conditions, not_always_defined_in_cond):
Delete. How inherited from Item, where `_set' is called `set'.
* automake.in (SUFFIX_RULE_PATTERN): Delete. Now in Automake::Rule.
(suffix_rules_default): Delete. Now
Automake::Rule::_suffix_rules_default
(suffixes): Delete. Now Automake::Rule::suffixes.
(TARGET_AUTOMAKE, TARGET_USER): Delete. Now
Automake::RuleDef::RULE_AUTOMAKE and Automake::RuleDef::RULE_USER.
(%targets, %target_source, %target_name, %target_owner): Delete,
replaced by the Rule and RuleDef classes.
(dependencies, depend, actions): Delete. Now in Automake::Rule.
(suffix_rules, register_suffix_rule): Likewise.
(KNOWN_EXTENSIONS_PATTERN, accept_extensions): Likewise.
(known_extensions_list): Delete. Now
Automake::Rule::_known_extensions_list.
(target_conditions): Delete. Now inherited by Automake::Rule
from Automake::Item::conditions.
(rule_define): Delete. Now Automake::Rule::define. Adjust all
callers.
(target_defined): Delete. Now Automake::Rule::rule. Adjust all
callers.
(initialize_per_input): Adjust to call Automake::Rule::reset.
(err_target, err_cond_target, msg_cond_target, msg_target,
reject_target): Delete. Now defined in Automake::Rule as
err_rule, err_cond_rule, msg_cond_rule, msg_rule and reject_target.
Adjust all callers.
(handle_languages): Call suffix_rules_count.
* tests/location.test: Adjust expected diagnostics. We now display
$(EXEEXT) accurately.
Diffstat (limited to 'lib/Automake/VarDef.pm')
-rw-r--r-- | lib/Automake/VarDef.pm | 50 |
1 files changed, 12 insertions, 38 deletions
diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm index 7fb53e613..dde29c42f 100644 --- a/lib/Automake/VarDef.pm +++ b/lib/Automake/VarDef.pm @@ -19,10 +19,11 @@ package Automake::VarDef; use strict; use Carp; use Automake::ChannelDefs; +use Automake::ItemDef; require Exporter; use vars '@ISA', '@EXPORT'; -@ISA = qw/Exporter/; +@ISA = qw/Automake::ItemDef Exporter/; @EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE &VAR_ASIS &VAR_PRETTY &VAR_SILENT &VAR_SORTED); @@ -112,9 +113,12 @@ use constant VAR_SORTED => 3; # Sorted and pretty-printed. =head2 Methods +C<VarDef> defines the following methods in addition to those inherited +from L<Automake::ItemDef>. + =over 4 -=item C<my $def = Automake::new ($varname, $value, $comment, $location, $type, $owner, $pretty)> +=item C<my $def = new Automake::VarDef ($varname, $value, $comment, $location, $type, $owner, $pretty)> Create a new Makefile-variable definition. C<$varname> is the name of the variable being defined and C<$value> its value. @@ -150,17 +154,11 @@ sub new ($$$$$$$$) error $location, "$var must be set with `=' before using `+='"; } - my $self = { - value => $value, - comment => $comment, - location => $location, - type => $type, - owner => $owner, - pretty => $pretty, - seen => 0, - }; - bless $self, $class; - + my $self = Automake::ItemDef::new ($class, $comment, $location, $owner); + $self->{'value'} = $value; + $self->{'type'} = $type; + $self->{'pretty'} = $pretty; + $self->{'seen'} = 0; return $self; } @@ -192,14 +190,8 @@ sub append ($$$) =item C<$def-E<gt>value> -=item C<$def-E<gt>comment> - -=item C<$def-E<gt>location> - =item C<$def-E<gt>type> -=item C<$def-E<gt>owner> - =item C<$def-E<gt>pretty> Accessors to the various constituents of a C<VarDef>. See the @@ -213,30 +205,12 @@ sub value ($) return $self->{'value'}; } -sub comment ($) -{ - my ($self) = @_; - return $self->{'comment'}; -} - -sub location ($) -{ - my ($self) = @_; - return $self->{'location'}; -} - sub type ($) { my ($self) = @_; return $self->{'type'}; } -sub owner ($) -{ - my ($self) = @_; - return $self->{'owner'}; -} - sub pretty ($) { my ($self) = @_; @@ -330,7 +304,7 @@ sub dump ($) =head1 SEE ALSO -L<Automake::Variable>. +L<Automake::Variable>, L<Automake::ItemDef>. =cut |