-
Notifications
You must be signed in to change notification settings - Fork 138
/
makefiles.pm
92 lines (69 loc) · 2.01 KB
/
makefiles.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Copyright (C) 2001-2010, Parrot Foundation.
=head1 NAME
config/gen/makefiles.pm - Build various Makefiles
=head1 DESCRIPTION
Generates the various F<Makefile>s and other files needed to build Parrot.
=cut
package gen::makefiles;
use strict;
use warnings;
use base qw(Parrot::Configure::Step);
use Parrot::Configure::Utils ':gen';
sub _init {
my $self = shift;
my %data;
$data{description} = q{Generate makefiles and other build files};
$data{result} = q{};
$data{makefiles} = {
'Makefile' => {
SOURCE => 'config/gen/makefiles/root.in',
},
'compilers/imcc/Rules.mak' => {
SOURCE => 'compilers/imcc/Rules.in',
},
'src/dynoplibs/Rules.mak' => {
SOURCE => 'src/dynoplibs/Rules.in',
},
'src/dynoplibs/Defines.mak' => {
SOURCE => 'src/dynoplibs/Defines.in',
},
'src/dynpmc/Rules.mak' => {
SOURCE => 'src/dynpmc/Rules.in',
},
'src/dynpmc/Defines.mak' => {
SOURCE => 'src/dynpmc/Defines.in',
},
'editor/Makefile' =>
{ SOURCE => 'config/gen/makefiles/editor.in' },
'docs/Makefile' => { SOURCE => 'config/gen/makefiles/docs.in' },
};
return \%data;
}
sub runstep {
my ( $self, $conf ) = @_;
$self->makefiles($conf);
$conf->shebang_mod( 'tools/dev/mk_language_shell.in'
=> 'tools/dev/mk_language_shell.pl', );
return 1;
}
sub makefiles {
my ( $self, $conf ) = @_;
my $targets = $conf->options->get('target');
my @targets =
defined $targets
? split ' ', $targets
: keys %{ $self->{makefiles} };
foreach my $target (@targets) {
my $args = $self->{makefiles}->{$target};
my $source = delete $args->{SOURCE};
$conf->genfile($source => $target, %$args );
}
return;
}
1;
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: