Support more C++ file extensions for MSVC in the compile script.
[platform/upstream/automake.git] / lib / Automake / RuleDef.pm
1 # Copyright (C) 2003  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 use strict;
18 use Carp;
19 use Automake::ChannelDefs;
20 use Automake::ItemDef;
21
22 require Exporter;
23 use vars '@ISA', '@EXPORT';
24 @ISA = qw/Automake::ItemDef Exporter/;
25 @EXPORT = qw (&RULE_AUTOMAKE &RULE_USER);
26
27 =head1 NAME
28
29 Automake::RuleDef - a class for rule definitions
30
31 =head1 SYNOPSIS
32
33   use Automake::RuleDef;
34   use Automake::Location;
35
36 =head1 DESCRIPTION
37
38 This class gathers data related to one Makefile-rule definition.
39
40 =head2 Constants
41
42 =over 4
43
44 =item C<RULE_AUTOMAKE>, C<RULE_USER>
45
46 Possible owners for rules.
47
48 =cut
49
50 use constant RULE_AUTOMAKE => 0; # Rule defined by Automake.
51 use constant RULE_USER => 1;     # Rule defined in the user's Makefile.am.
52
53 sub new ($$$$$)
54 {
55   my ($class, $name, $comment, $location, $owner, $source) = @_;
56
57   my $self = Automake::ItemDef::new ($class, $comment, $location, $owner);
58   $self->{'source'} = $source;
59   $self->{'name'} = $name;
60   return $self;
61 }
62
63 sub source ($)
64 {
65   my ($self) = @_;
66   return $self->{'source'};
67 }
68
69 sub name ($)
70 {
71   my ($self) = @_;
72   return $self->{'name'};
73 }
74
75 =back
76
77 =head1 SEE ALSO
78
79 L<Automake::Rule>, L<Automake::ItemDef>.
80
81 =cut
82
83 1;
84
85 ### Setup "GNU" style for perl-mode and cperl-mode.
86 ## Local Variables:
87 ## perl-indent-level: 2
88 ## perl-continued-statement-offset: 2
89 ## perl-continued-brace-offset: 0
90 ## perl-brace-offset: 0
91 ## perl-brace-imaginary-offset: 0
92 ## perl-label-offset: -2
93 ## cperl-indent-level: 2
94 ## cperl-brace-offset: 0
95 ## cperl-continued-brace-offset: 0
96 ## cperl-label-offset: -2
97 ## cperl-extra-newline-before-brace: t
98 ## cperl-merge-trailing-else: nil
99 ## cperl-continued-statement-offset: 2
100 ## End: