1 # Copyright (C) 2003-2018 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2, or (at your option)
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 package Automake
::RuleDef
;
21 use Automake
::ChannelDefs
;
22 use Automake
::ItemDef
;
25 use vars
'@ISA', '@EXPORT';
26 @ISA = qw
/Automake::ItemDef Exporter/;
27 @EXPORT = qw
(&RULE_AUTOMAKE
&RULE_USER
);
31 Automake::RuleDef - a class for rule definitions
35 use Automake::RuleDef;
36 use Automake::Location;
40 This class gathers data related to one Makefile-rule definition.
41 It shouldn't be needed outside of F<Rule.pm>.
47 =item C<RULE_AUTOMAKE>, C<RULE_USER>
49 Possible owners for rules.
53 use constant RULE_AUTOMAKE
=> 0; # Rule defined by Automake.
54 use constant RULE_USER
=> 1; # Rule defined in the user's Makefile.am.
62 =item C<new Automake::RuleDef ($name, $comment, $location, $owner, $source)>
64 Create a new rule definition with target C<$name>, with associated comment
65 C<$comment>, Location C<$location> and owner C<$owner>, defined in file
72 my ($class, $name, $comment, $location, $owner, $source) = @_;
74 my $self = Automake
::ItemDef
::new
($class, $comment, $location, $owner);
75 $self->{'source'} = $source;
76 $self->{'name'} = $name;
80 =item C<$source = $rule-E<gt>source>
82 Return the source of the rule.
89 return $self->{'source'};
92 =item C<$name = $rule-E<gt>name>
94 Return the name of the rule.
101 return $self->{'name'};
108 L<Automake::Rule>, L<Automake::ItemDef>.