line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Build::Plugin::Build::Make; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1560
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
67
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
5
|
2
|
|
|
2
|
|
43
|
use 5.008004; |
|
2
|
|
|
|
|
9
|
|
6
|
2
|
|
|
2
|
|
13
|
use Carp (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
49
|
|
7
|
2
|
|
|
2
|
|
12
|
use Capture::Tiny qw( capture ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
116
|
|
8
|
2
|
|
|
2
|
|
512
|
use Alien::Build::Plugin; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
13
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Make plugin for Alien::Build |
11
|
|
|
|
|
|
|
our $VERSION = '2.45'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has '+make_type' => undef; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub init |
17
|
|
|
|
|
|
|
{ |
18
|
5
|
|
|
5
|
1
|
22
|
my($self, $meta) = @_; |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
|
|
34
|
$meta->add_requires('configure', 'Alien::Build::Plugin::Build::Make', '0.99'); |
21
|
|
|
|
|
|
|
|
22
|
5
|
|
|
|
|
25
|
my $type = $self->make_type; |
23
|
|
|
|
|
|
|
|
24
|
5
|
50
|
|
|
|
16
|
return unless defined $type; |
25
|
|
|
|
|
|
|
|
26
|
5
|
50
|
33
|
|
|
30
|
$type = 'gmake' if $^O eq 'MSWin32' && $type eq 'umake'; |
27
|
|
|
|
|
|
|
|
28
|
5
|
100
|
|
|
|
45
|
if($type eq 'nmake') |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
29
|
|
|
|
|
|
|
{ |
30
|
1
|
|
|
1
|
|
5
|
$meta->interpolator->replace_helper( make => sub { 'nmake' } ); |
|
1
|
|
|
|
|
6
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
elsif($type eq 'dmake') |
34
|
|
|
|
|
|
|
{ |
35
|
1
|
|
|
1
|
|
6
|
$meta->interpolator->replace_helper( make => sub { 'dmake' } ); |
|
1
|
|
|
|
|
6
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
elsif($type eq 'gmake') |
39
|
|
|
|
|
|
|
{ |
40
|
2
|
|
|
|
|
7
|
my $found = 0; |
41
|
2
|
|
|
|
|
6
|
foreach my $make (qw( gmake make mingw32-make )) |
42
|
|
|
|
|
|
|
{ |
43
|
6
|
|
|
6
|
|
605
|
my($out, $err) = capture { system $make, '--version' }; |
|
6
|
|
|
|
|
37779
|
|
44
|
6
|
100
|
|
|
|
9691
|
if($out =~ /GNU Make/) |
45
|
|
|
|
|
|
|
{ |
46
|
2
|
|
|
0
|
|
65
|
$meta->interpolator->replace_helper( make => sub { $make } ); |
|
0
|
|
|
|
|
0
|
|
47
|
2
|
|
|
|
|
17
|
$found = 1; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
2
|
50
|
|
|
|
70
|
unless($found) |
51
|
|
|
|
|
|
|
{ |
52
|
0
|
|
|
|
|
|
$meta->add_requires('share' => 'Alien::gmake' => '0.20'); |
53
|
0
|
|
|
0
|
|
|
$meta->interpolator->replace_helper('make' => sub { require Alien::gmake; Alien::gmake->exe }); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
elsif($type eq 'umake') |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
# nothing |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
else |
63
|
|
|
|
|
|
|
{ |
64
|
0
|
|
|
|
|
|
Carp::croak("unknown make type = ", $self->make_type); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |