doc: update Vala documentation
[automake.git] / lib / Automake / RuleDef.pm
blob5b84dfcbf2cf399ee39eefd3bf180f114eda6d51
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)
6 # any later version.
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;
18 use 5.006;
19 use strict;
20 use warnings FATAL => 'all';
22 use Carp;
23 use Exporter;
25 use Automake::ChannelDefs;
26 use Automake::ItemDef;
28 our @ISA = qw (Automake::ItemDef Exporter);
29 our @EXPORT = qw (&RULE_AUTOMAKE &RULE_USER);
31 =head1 NAME
33 Automake::RuleDef - a class for rule definitions
35 =head1 SYNOPSIS
37 use Automake::RuleDef;
38 use Automake::Location;
40 =head1 DESCRIPTION
42 This class gathers data related to one Makefile-rule definition.
43 It shouldn't be needed outside of F<Rule.pm>.
45 =head2 Constants
47 =over 4
49 =item C<RULE_AUTOMAKE>, C<RULE_USER>
51 Possible owners for rules.
53 =cut
55 use constant RULE_AUTOMAKE => 0; # Rule defined by Automake.
56 use constant RULE_USER => 1; # Rule defined in the user's Makefile.am.
58 =back
60 =head2 Methods
62 =over 4
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
68 C<$source>.
70 =cut
72 sub new ($$$$$)
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;
79 return $self;
82 =item C<$source = $rule-E<gt>source>
84 Return the source of the rule.
86 =cut
88 sub source ($)
90 my ($self) = @_;
91 return $self->{'source'};
94 =item C<$name = $rule-E<gt>name>
96 Return the name of the rule.
98 =cut
100 sub name ($)
102 my ($self) = @_;
103 return $self->{'name'};
106 =back
108 =head1 SEE ALSO
110 L<Automake::Rule>, L<Automake::ItemDef>.
112 =cut