File: | /tmp/automake/lib/Automake/RuleDef.pm |
Coverage: | 100.0% |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | # Copyright (C) 2003, 2009 Free Software Foundation, Inc. | ||||||
2 | |||||||
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. | ||||||
7 | |||||||
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. | ||||||
12 | |||||||
13 | # You should have received a copy of the GNU General Public License | ||||||
14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||||
15 | |||||||
16 | package Automake::RuleDef; | ||||||
17 | 1159 1159 1159 | 3221 1167 3044 | use strict; | ||||
18 | 1159 1159 1159 | 4305 1322 2776 | use Carp; | ||||
19 | 1159 1159 1159 | 4650 1235 3604 | use Automake::ChannelDefs; | ||||
20 | 1159 1159 1159 | 4573 1281 3436 | use Automake::ItemDef; | ||||
21 | |||||||
22 | require Exporter; | ||||||
23 | 1159 1159 1159 | 3922 1285 4254 | use vars '@ISA', '@EXPORT'; | ||||
24 | @ISA = qw/Automake::ItemDef Exporter/; | ||||||
25 | @EXPORT = qw (&RULE_AUTOMAKE &RULE_USER); | ||||||
26 | |||||||
27 - 49 | =head1 NAME Automake::RuleDef - a class for rule definitions =head1 SYNOPSIS use Automake::RuleDef; use Automake::Location; =head1 DESCRIPTION This class gathers data related to one Makefile-rule definition. It shouldn't be needed outside of F<Rule.pm>. =head2 Constants =over 4 =item C<RULE_AUTOMAKE>, C<RULE_USER> Possible owners for rules. =cut | ||||||
50 | |||||||
51 | 1159 1159 1159 | 4614 1486 4649 | use constant RULE_AUTOMAKE => 0; # Rule defined by Automake. | ||||
52 | 1159 1159 1159 | 4511 2320 4129 | use constant RULE_USER => 1; # Rule defined in the user's Makefile.am. | ||||
53 | |||||||
54 | =back | ||||||
55 | |||||||
56 - 66 | =head2 Methods =over 4 =item C<new Automake::RuleDef ($name, $comment, $location, $owner, $source)> Create a new rule definition with target C<$name>, with associated comment C<$comment>, Location C<$location> and owner C<$owner>, defined in file C<$source>. =cut | ||||||
67 | |||||||
68 | sub new ($$$$$) | ||||||
69 | { | ||||||
70 | 104224 | 1 | 230053 | my ($class, $name, $comment, $location, $owner, $source) = @_; | |||
71 | |||||||
72 | 104224 | 240379 | my $self = Automake::ItemDef::new ($class, $comment, $location, $owner); | ||||
73 | 104224 | 182597 | $self->{'source'} = $source; | ||||
74 | 104224 | 167076 | $self->{'name'} = $name; | ||||
75 | 104224 | 213478 | return $self; | ||||
76 | } | ||||||
77 | |||||||
78 - 82 | =item C<$source = $rule-E<gt>source> Return the source of the rule. =cut | ||||||
83 | |||||||
84 | sub source ($) | ||||||
85 | { | ||||||
86 | 92 | 1 | 126 | my ($self) = @_; | |||
87 | 92 | 252 | return $self->{'source'}; | ||||
88 | } | ||||||
89 | |||||||
90 - 94 | =item C<$name = $rule-E<gt>name> Return the name of the rule. =cut | ||||||
95 | |||||||
96 | sub name ($) | ||||||
97 | { | ||||||
98 | 122 | 1 | 211 | my ($self) = @_; | |||
99 | 122 | 354 | return $self->{'name'}; | ||||
100 | } | ||||||
101 | |||||||
102 | =back | ||||||
103 | |||||||
104 - 108 | =head1 SEE ALSO L<Automake::Rule>, L<Automake::ItemDef>. =cut | ||||||
109 | |||||||
110 | 1; | ||||||
111 | |||||||
112 | ### Setup "GNU" style for perl-mode and cperl-mode. | ||||||
113 | ## Local Variables: | ||||||
114 | ## perl-indent-level: 2 | ||||||
115 | ## perl-continued-statement-offset: 2 | ||||||
116 | ## perl-continued-brace-offset: 0 | ||||||
117 | ## perl-brace-offset: 0 | ||||||
118 | ## perl-brace-imaginary-offset: 0 | ||||||
119 | ## perl-label-offset: -2 | ||||||
120 | ## cperl-indent-level: 2 | ||||||
121 | ## cperl-brace-offset: 0 | ||||||
122 | ## cperl-continued-brace-offset: 0 | ||||||
123 | ## cperl-label-offset: -2 | ||||||
124 | ## cperl-extra-newline-before-brace: t | ||||||
125 | ## cperl-merge-trailing-else: nil | ||||||
126 | ## cperl-continued-statement-offset: 2 | ||||||
127 | ## End: |