1 # Copyright (C) 2003-2024 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
;
20 use warnings FATAL
=> 'all';
25 use Automake
::ChannelDefs
;
26 use Automake
::ItemDef
;
28 our @ISA = qw
(Automake
::ItemDef Exporter
);
29 our @EXPORT = qw
(&RULE_AUTOMAKE
&RULE_USER
);
33 Automake::RuleDef - a class for rule definitions
37 use Automake::RuleDef;
38 use Automake::Location;
42 This class gathers data related to one Makefile-rule definition.
43 It shouldn't be needed outside of F<Rule.pm>.
49 =item C<RULE_AUTOMAKE>, C<RULE_USER>
51 Possible owners for rules.
55 use constant RULE_AUTOMAKE
=> 0; # Rule defined by Automake.
56 use constant RULE_USER
=> 1; # Rule defined in the user's Makefile.am.
64 =item C<new Automake::RuleDef ($name, $comment, $location, $owner, $source)>
66 Create a new rule definition with target C<$name>, with associated comment
67 C<$comment>, Location C<$location> and owner C<$owner>, defined in file
74 my ($class, $name, $comment, $location, $owner, $source) = @_;
76 my $self = Automake
::ItemDef
::new
($class, $comment, $location, $owner);
77 $self->{'source'} = $source;
78 $self->{'name'} = $name;
82 =item C<$source = $rule-E<gt>source>
84 Return the source of the rule.
91 return $self->{'source'};
94 =item C<$name = $rule-E<gt>name>
96 Return the name of the rule.
103 return $self->{'name'};
110 L<Automake::Rule>, L<Automake::ItemDef>.