line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Build::Plugin::Build::Make; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1383
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
61
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
45
|
|
5
|
2
|
|
|
2
|
|
30
|
use 5.008004; |
|
2
|
|
|
|
|
7
|
|
6
|
2
|
|
|
2
|
|
12
|
use Carp (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
36
|
|
7
|
2
|
|
|
2
|
|
21
|
use Capture::Tiny qw( capture ); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
128
|
|
8
|
2
|
|
|
2
|
|
437
|
use Alien::Build::Plugin; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
11
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Make plugin for Alien::Build |
11
|
|
|
|
|
|
|
our $VERSION = '2.46'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has '+make_type' => undef; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub init |
17
|
|
|
|
|
|
|
{ |
18
|
5
|
|
|
5
|
1
|
13
|
my($self, $meta) = @_; |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
|
|
23
|
$meta->add_requires('configure', 'Alien::Build::Plugin::Build::Make', '0.99'); |
21
|
|
|
|
|
|
|
|
22
|
5
|
|
|
|
|
24
|
my $type = $self->make_type; |
23
|
|
|
|
|
|
|
|
24
|
5
|
50
|
|
|
|
16
|
return unless defined $type; |
25
|
|
|
|
|
|
|
|
26
|
5
|
50
|
33
|
|
|
23
|
$type = 'gmake' if $^O eq 'MSWin32' && $type eq 'umake'; |
27
|
|
|
|
|
|
|
|
28
|
5
|
100
|
|
|
|
34
|
if($type eq 'nmake') |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
29
|
|
|
|
|
|
|
{ |
30
|
1
|
|
|
1
|
|
5
|
$meta->interpolator->replace_helper( make => sub { 'nmake' } ); |
|
1
|
|
|
|
|
4
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
elsif($type eq 'dmake') |
34
|
|
|
|
|
|
|
{ |
35
|
1
|
|
|
1
|
|
5
|
$meta->interpolator->replace_helper( make => sub { 'dmake' } ); |
|
1
|
|
|
|
|
5
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
elsif($type eq 'gmake') |
39
|
|
|
|
|
|
|
{ |
40
|
2
|
|
|
|
|
6
|
my $found = 0; |
41
|
2
|
|
|
|
|
6
|
foreach my $make (qw( gmake make mingw32-make )) |
42
|
|
|
|
|
|
|
{ |
43
|
6
|
|
|
6
|
|
428
|
my($out, $err) = capture { system $make, '--version' }; |
|
6
|
|
|
|
|
29997
|
|
44
|
6
|
100
|
|
|
|
8748
|
if($out =~ /GNU Make/) |
45
|
|
|
|
|
|
|
{ |
46
|
2
|
|
|
0
|
|
56
|
$meta->interpolator->replace_helper( make => sub { $make } ); |
|
0
|
|
|
|
|
0
|
|
47
|
2
|
|
|
|
|
20
|
$found = 1; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
2
|
50
|
|
|
|
62
|
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__ |