doc: modernize version control doc
[automake.git] / lib / Automake / ItemDef.pm
blob8bb5abb3b7cb4c28e4bb722c527ad03d613b30bd
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::ItemDef;
18 use 5.006;
19 use strict;
20 use warnings FATAL => 'all';
22 use Carp;
24 =head1 NAME
26 Automake::ItemDef - base class for Automake::VarDef and Automake::RuleDef
28 =head1 DESCRIPTION
30 =head2 Methods
32 =over 4
34 =item C<my $def = Automake::new ($comment, $location, $owner)>
36 Create a new Makefile-item definition.
38 C<$comment> is any comment preceding the definition. (Because
39 Automake reorders items in the output, it also tries to carry comments
40 around.)
42 C<$location> is the place where the definition occurred, it should be
43 an instance of L<Automake::Location>.
45 C<$owner> specifies who owns the rule.
47 =cut
49 sub new ($$$$)
51 my ($class, $comment, $location, $owner) = @_;
53 my $self = {
54 comment => $comment,
55 location => $location,
56 owner => $owner,
58 bless $self, $class;
60 return $self;
63 =item C<$def-E<gt>comment>
65 =item C<$def-E<gt>location>
67 =item C<$def-E<gt>owner>
69 Accessors to the various constituents of an C<ItemDef>. See the
70 documentation of C<new>'s arguments for a description of these.
72 =cut
74 sub comment ($)
76 my ($self) = @_;
77 return $self->{'comment'};
80 sub location ($)
82 my ($self) = @_;
83 return $self->{'location'};
86 sub owner ($)
88 my ($self) = @_;
89 return $self->{'owner'};
92 =head1 SEE ALSO
94 L<Automake::VarDef>, and L<Automake::RuleDef>.
96 =cut