1 # Copyright (C) 2003, 2009 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 <http://www.gnu.org/licenses/>.
16 package Automake::RuleDef;
19 use Automake::ChannelDefs;
20 use Automake::ItemDef;
23 use vars '@ISA', '@EXPORT';
24 @ISA = qw/Automake::ItemDef Exporter/;
25 @EXPORT = qw (&RULE_AUTOMAKE &RULE_USER);
29 Automake::RuleDef - a class for rule definitions
33 use Automake::RuleDef;
34 use Automake::Location;
38 This class gathers data related to one Makefile-rule definition.
39 It shouldn't be needed outside of F<Rule.pm>.
45 =item C<RULE_AUTOMAKE>, C<RULE_USER>
47 Possible owners for rules.
51 use constant RULE_AUTOMAKE => 0; # Rule defined by Automake.
52 use constant RULE_USER => 1; # Rule defined in the user's Makefile.am.
60 =item C<new Automake::RuleDef ($name, $comment, $location, $owner, $source)>
62 Create a new rule definition with target C<$name>, with associated comment
63 C<$comment>, Location C<$location> and owner C<$owner>, defined in file
70 my ($class, $name, $comment, $location, $owner, $source) = @_;
72 my $self = Automake::ItemDef::new ($class, $comment, $location, $owner);
73 $self->{'source'} = $source;
74 $self->{'name'} = $name;
78 =item C<$source = $rule-E<gt>source>
80 Return the source of the rule.
87 return $self->{'source'};
90 =item C<$name = $rule-E<gt>name>
92 Return the name of the rule.
99 return $self->{'name'};
106 L<Automake::Rule>, L<Automake::ItemDef>.
112 ### Setup "GNU" style for perl-mode and cperl-mode.
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