Create a new Makefile-item definition.
-C<$comment> is any comment preceding the definition. (Because
-Automake reorders items in the output, it also tries to carry comments
-around.)
-
C<$location> is the place where the definition occurred, it should be
an instance of L<Automake::Location>.
=cut
-sub new ($$$$)
+sub new ($$$)
{
- my ($class, $comment, $location, $owner) = @_;
+ my ($class, $location, $owner) = @_;
my $self = {
- comment => $comment,
location => $location,
owner => $owner,
};
return $self;
}
-=item C<$def-E<gt>comment>
-
=item C<$def-E<gt>location>
=item C<$def-E<gt>owner>
=cut
-sub comment ($)
-{
- my ($self) = @_;
- return $self->{'comment'};
-}
-
sub location ($)
{
my ($self) = @_;
# Finally define this rule.
for my $c (@conds)
{
- my $def = new Automake::RuleDef ($target, '', $where->clone,
- $owner, $source);
+ my $def = new Automake::RuleDef ($target, $where->clone, $owner,
+ $source);
$rule->set ($c, $def);
}
=over 4
-=item C<new Automake::RuleDef ($name, $comment, $location, $owner, $source)>
+=item C<new Automake::RuleDef ($name, $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>.
+Create a new rule definition with target C<$name>, Location C<$location>
+and owner C<$owner>, defined in file C<$source>.
=cut
-sub new ($$$$$)
+sub new ($$$$)
{
- my ($class, $name, $comment, $location, $owner, $source) = @_;
+ my ($class, $name, $location, $owner, $source) = @_;
- my $self = Automake::ItemDef::new ($class, $comment, $location, $owner);
+ my $self = Automake::ItemDef::new ($class, $location, $owner);
$self->{'source'} = $source;
$self->{'name'} = $name;
return $self;
error $location, "$var must be set with '=' before using '+='";
}
- my $self = Automake::ItemDef::new ($class, $comment, $location, $owner);
+ my $self = Automake::ItemDef::new ($class, $location, $owner);
+ $self->{'comment'} = $comment;
$self->{'value'} = $value;
$self->{'type'} = $type;
$self->{'pretty'} = $pretty;
return $val;
}
+sub comment ($)
+{
+ my ($self) = @_;
+ return $self->{'comment'};
+}
+
sub raw_value ($)
{
my ($self) = @_;