lib/ASPEER/MakeMaker/MM/Import.pm

filter: Statementstmt 91.5% 184 / 201 Branchbran 44.8% 26 / 58 Conditioncond 26.2% 16 / 61 MC/DCmcdc 0.0% 0 / 36 Subroutinesub 100% 24 / 24 Podpod 66.6% 4 / 6 totaltotal 65.8% 254 / 386 CC 85 SCAR 26.6
CC
85
Cov
71%
post_initialize
27.6
post_initialize
27.6
import
16.1
CRAP 14.2
« lib/ASPEER/MakeMaker.pm ↑ Summary lib/ASPEER/MakeMaker/MM/Util.pm »
1 #
2 # This file is part of ASPEER::MakeMaker.
3 #
4 # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 # Full license text is available at:
10 #
11 # <http://dev.perl.org/licenses/>
12 #
13 package ASPEER::MakeMaker::MM::Import;
14  
15  
16 # Pragma
17 #
18 2 ▶use strict qw(vars);
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22  
23 # Base Packages
24 #
25 1 ▶use ASPEER::MakeMaker::MM;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use ASPEER::MakeMaker::MM::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use ASPEER::MakeMaker::MM::Constant;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29  
30 # External Packages
31 #
32 1 ▶use ExtUtils::MakeMaker;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶use Software::LicenseUtils;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 1 ▶use File::Basename qw(basename);
Subroutine BEGIN: called CC=1 SCAR=0.0
35 2 ▶use Tie::File;
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37  
38 # Version information in a formate suitable for CPAN etc. Must be
39 # all on one line
40 #
41 $VERSION='1.012';
42  
43  
44 # All done, init finished
45 #
46 1;
47  
48  
49 #======================================================================================================================
50  
51  
52 1 ▶sub import {
Subroutine import: called CC=12 SCAR=27.8
53  
54  
55 # Manage activation of various ExtUtils::Makemaker sections for this class.
56 #
57 # use ExtUtils::<This Package> qw(const_config) to just replace the macros section of the Makefile
58 # .. qw(dist_ci) to replace standard MakeMaker targets with our own
59 # .. qw(:all) or no tag (i.e defaults) to all targers
60 #
61 #
62 1 ▶ my ($class, @section)=@_;
Subroutine import: called CC=12 SCAR=27.8
63 1 ▶ return if $_{$class}{'loaded'}++;
Branch: 2 branches
BranchTrueFalseTotal
if $_{$class}{"loaded"}++ 0 1 1
if $_{$class}{"loaded"}++ 0 1 1
64 1 ▶ return unless ($0=~/Makefile\.PL$/);
Branch: 2 branches
BranchTrueFalseTotal
unless $0 =~ /Makefile\.PL$/ 1 0 1
unless $0 =~ /Makefile\.PL$/ 0 1 1
65 1 msg("initializing $class import");
66  
67  
68 # Remember extension activation order for generated PERLRUN commands
69 #
70 {
71 1 ▶ no warnings qw(once);
Subroutine BEGIN: called CC=1 SCAR=0.0
72 push(@MY::ExtUtils_MM_Import_Order, $class)
73 0 ▶ unless grep {$class eq $_} @MY::ExtUtils_MM_Import_Order;
Branch: 2 branches
BranchTrueFalseTotal
unless grep {$class eq $_;} @MY::ExtUtils_MM_Import_Order 0 0 0
unless grep {$class eq $_;} @MY::ExtUtils_MM_Import_Order 1 0 1
74 1 $MY::ExtUtils_MM_Import_Tag{$class}=[@section];
75 }
76  
77  
78 # Get params, bless self ref and remember import tags spec'd for later
79 # re-use
80 #
81 1 my $self=bless (\my %self, $class);
82  
83  
84 # Build chain of MM modules loaded for this OS so we can search for
85 # code ref's associated with various ExtUtils::MakeMaker sections;
86 #
87 1 my @mm_isa=grep {/^ExtUtils::MM/} @ExtUtils::MM::ISA;
88 1 push @mm_isa, map { @{"${_}::ISA"} } @mm_isa;
89 1 ▶ die('no ExtUtils::MM inheritance found in @ISA') unless @mm_isa;
Branch: 2 branches
BranchTrueFalseTotal
unless @mm_isa 0 0 0
unless @mm_isa 0 1 1
90  
91  
92 # Sections to augment with additional targets
93 #
94 1 ▶ { no warnings qw(redefine once);
Subroutine BEGIN: called CC=1 SCAR=0.0
95 1 foreach my $section (qw(const_config depend postamble post_initialize), @section) {
96 1 ▶ next if $self{$section};
Branch: 2 branches
BranchTrueFalseTotal
if $self{$section} 0 0 0
if $self{$section} 2 4 6
97 1 $self{$section} =*{"ExtUtils::MM::${section}"}{CODE}; # unless (*{"ExtUtils::MM::${section}"}{CODE} eq \&{$section});
98 1 ▶ $self{$section} ||= do {
Condition16%1/6
$self{$section} ||= do { my($cr) = grep({$_;} map({$_->can($section);} @mm_isa)); $cr or sub { ""; } }
l!l&&r!l&&!r
000
$self{$section} ||= do { my($cr) = grep({$_;} map({$_->can($section);} @mm_isa)); $cr or sub { ""; } }
l!l&&r!l&&!r
040
MC/DC0%0/2
$self{$section} ||= do { my($cr) = grep({$_;} map({$_->can($section);} @mm_isa)); $cr or sub { ""; } }
$self{$section} do { my($cr) = grep({$_;} map({$_->can($section);} @mm_isa)); $cr or sub { ""; } }
MC/DC0%0/2
$self{$section} ||= do { my($cr) = grep({$_;} map({$_->can($section);} @mm_isa)); $cr or sub { ""; } }
$self{$section} do { my($cr) = grep({$_;} map({$_->can($section);} @mm_isa)); $cr or sub { ""; } }
Truth table0%0/3
A ||= B
A= $self{$section}B= do { my($cr) = grep({$_;} map({$_->can($section);} @mm_isa)); $cr or sub { ""; } }
ABresult
1X1
011
000
Truth table33%1/3
A ||= B
A= $self{$section}B= do { my($cr) = grep({$_;} map({$_->can($section);} @mm_isa)); $cr or sub { ""; } }
ABresult
1X1
011
000
99 1 my ($cr)=grep {$_} (map { $_->can($section) } @mm_isa);
100 1 ▶ $cr || sub {''};
Subroutine __ANON__: called CC=1 SCAR=1.6
Condition16%1/6
$cr || sub { ''; }
l!l&&r!l&&!r
000
$cr || sub { ''; }
l!l&&r!l&&!r
400
MC/DC0%0/2
$cr || sub { ''; }
$cr sub { ''; }
MC/DC0%0/2
$cr || sub { ''; }
$cr sub { ''; }
Truth table0%0/3
A || B
A= $crB= sub { ''; }
ABresult
1X1
011
000
Truth table33%1/3
A || B
A= $crB= sub { ''; }
ABresult
1X1
011
000
101 };
102 1 ▶ $self{$section} ||= ExtUtils::MM_Unix->can($section) || sub {''};
Subroutine __ANON__: called CC=1 SCAR=3.3
Condition8%1/12
$self{$section} ||= "ExtUtils::MM_Unix"->can($section) || sub { ""; }
l!l&&r!l&&!r
000
'ExtUtils::MM_Unix'->can($section) || sub { ''; }
l!l&&r!l&&!r
000
$self{$section} ||= "ExtUtils::MM_Unix"->can($section) || sub { ""; }
l!l&&r!l&&!r
400
'ExtUtils::MM_Unix'->can($section) || sub { ''; }
l!l&&r!l&&!r
000
MC/DC0%0/3
$self{$section} ||= "ExtUtils::MM_Unix"->can($section) || sub { ""; }
$self{$section} 'ExtUtils::MM_Unix'->can($section) sub { ''; }
MC/DC0%0/3
$self{$section} ||= "ExtUtils::MM_Unix"->can($section) || sub { ""; }
$self{$section} 'ExtUtils::MM_Unix'->can($section) sub { ''; }
Truth table0%0/4
A ||= B || C
A= $self{$section}B= 'ExtUtils::MM_Unix'->can($section)C= sub { ''; }
ABCresult
1XX1
01X1
0011
0000
Truth table0%0/4
A ||= B || C
A= $self{$section}B= 'ExtUtils::MM_Unix'->can($section)C= sub { ''; }
ABCresult
1XX1
01X1
0011
0000
103 1 my $sub=sprintf('%s::MM::%s', ref($self), $section);
104 1 ▶ if (my $cr=*{$sub}{CODE}) {
Branch: 2 branches
BranchTrueFalseTotal
if (my $cr = *{$sub;}{'CODE'}) { } 0 0 0
if (my $cr = *{$sub;}{'CODE'}) { } 0 4 4
105 0 msg("import $section from $sub");
106 0 ▶ *{"ExtUtils::MM::${section}"}=sub { $cr->($self, @_) };
Subroutine __ANON__: called CC=1 SCAR=0.6
107 }
108 else {
109 1 msg("import $section from %s", __PACKAGE__);
110 1 ▶ *{"ExtUtils::MM::${section}"}=sub { &{$section}($self, @_) };
Subroutine __ANON__: called CC=1 SCAR=0.0
111 }
112 }
113 }
114 1 msg("initializing $class import complete");
115  
116 }
117  
118  
119 sub const_config {
120  
121  
122 # Get self ref
123 #
124 #
125 1 ▶ my ($self, $mm_or, @param)=@_;
Subroutine const_config: called CC=12 SCAR=26.3
Pod documented
126 1 (my $section = (caller(0))[3]) =~ s/^.*:://;
127 1 msg("generating %s $section", ref($self));
128  
129  
130 # Get original const_config ready for append
131 #
132 1 my $const_config=$self->{$section}($mm_or, @param);
133  
134  
135 # Import Constants into macros
136 #
137 1 my $constant_hr=\%{sprintf('%s::MM::Constant::Constant', ref($self))};
138 1 foreach my $key (keys %{$constant_hr}) {
139  
140 # Update macros with our config
141 #
142 6 ▶ next if $key eq 'MM_PREFIX';
Branch: 1 branch
BranchTrueFalseTotal
if $key eq "MM_PREFIX" 1 5 6
143 5 my $value=$constant_hr->{$key};
144 5 msg("add macro: $key, value: $value");
145 5 $mm_or->{'macro'}{$key}=$value;
146  
147 }
148  
149  
150 # Update license data. Get license type and author
151 #
152 1 my $license=$mm_or->{'LICENSE'};
153 1 ▶ my @author=@{$mm_or->{'AUTHOR'} || []};
Condition50%1/2
$mm_or->{'AUTHOR'} || []
l!l
10
MC/DC0%0/1
$mm_or->{'AUTHOR'} || []
$mm_or->{'AUTHOR'}
Truth table50%1/2
A
A= $mm_or->{'AUTHOR'}
Aresult
11
00
154 1 my $author=shift(@author);
155  
156  
157 # Publish supplied values and enrich complete license metadata
158 #
159 1 ▶ $mm_or->{'macro'}{'LICENSE'}=$license if defined($license) && length($license);
Branch: 1 branch
BranchTrueFalseTotal
if defined $license and length $license 1 0 1
Condition33%1/3
defined $license and length $license
!ll&&!rl&&r
001
MC/DC0%0/2
defined $license and length $license
defined $license length $license
Truth table33%1/3
A and B
A= defined $licenseB= length $license
ABresult
0X0
100
111
160 1 ▶ $mm_or->{'macro'}{'AUTHOR'}=$author if defined($author) && length($author);
Branch: 1 branch
BranchTrueFalseTotal
if defined $author and length $author 1 0 1
Condition33%1/3
defined $author and length $author
!ll&&!rl&&r
001
MC/DC0%0/2
defined $author and length $author
defined $author length $author
Truth table33%1/3
A and B
A= defined $authorB= length $author
ABresult
0X0
100
111
161 1 ▶ if ($license && $author) {
Branch: 1 branch
BranchTrueFalseTotal
if ($license and $author) 1 0 1
Condition33%1/3
$license and $author
!ll&&!rl&&r
001
MC/DC0%0/2
$license and $author
$license $author
Truth table33%1/3
A and B
A= $licenseB= $author
ABresult
0X0
100
111
162 1 my @license_module=Software::LicenseUtils->guess_license_from_meta_key($license);
163 1 ▶ @license_module ||
Branch: 1 branch
BranchTrueFalseTotal
@license_module or return err("unable to determine correct license module from string: $license") 1 0 1
164 return err("unable to determine correct license module from string: $license");
165 1 ▶ (@license_module > 1) &&
Branch: 1 branch
BranchTrueFalseTotal
@license_module > 1 and return err("ambiguous license string: $license, resolves to %s", join(",", @license_module)) 0 1 1
166 return err("ambiguous license string: $license, resolves to %s", join(',', @license_module));
167 1 my $license_or=(shift @license_module)->new({holder => $author});
168 1 $mm_or->{'META_MERGE'}{'resources'}{'license'}=$license_or->url();
169 }
170  
171  
172 # Now construct final PERLRUN string
173 #
174 1 my $perlrun=&perlrun($self, $mm_or);
175 1 $mm_or->{'PERLRUN'}=$perlrun;
176  
177  
178 # Keep copy of DIST_DEFAULT
179 #
180 1 $mm_or->{'macro'}{'DIST_DEFAULT_TARGET'}=$mm_or->{'DIST_DEFAULT'};
181  
182  
183 # Return whatever our parent does
184 #
185 1 return $const_config;
186  
187  
188 }
189  
190  
191  
192 # MakeMaker::MY replacement depend section
193 #
194 sub depend {
195  
196  
197 # Get self ref
198 #
199 1 ▶ my ($self, $mm_or, @param)=@_;
Subroutine depend: called CC=6 SCAR=19.9
Pod documented
200 1 (my $section = (caller(0))[3]) =~ s/^.*:://;
201 1 msg("generating %s $section", ref($self));
202  
203  
204 # Get original and modify
205 #
206 1 my $depend=$self->{$section}($mm_or, @param);
207  
208  
209 # Add VERSION_FROM without replacing existing dependencies
210 #
211 1 ▶ $depend='' unless defined($depend);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $depend 0 1 1
212 1 ▶ if ($mm_or->{'VERSION_FROM'} &&
Branch: 1 branch
BranchTrueFalseTotal
if ($mm_or->{"VERSION_FROM"} and not $depend =~ /^Makefile\s*:[^\n]*\$\(VERSION_FROM\)/m) 1 0 1
Condition33%1/3
$mm_or->{"VERSION_FROM"} and not $depend =~ /^Makefile\s*:[^\n]*\$\(VERSION_FROM\)/m
!ll&&!rl&&r
001
MC/DC0%0/2
$mm_or->{"VERSION_FROM"} and not $depend =~ /^Makefile\s*:[^\n]*\$\(VERSION_FROM\)/m
$mm_or->{"VERSION_FROM"} not $depend =~ /^Makefile\s*:[^\n]*\$\(VERSION_FROM\)/m
Truth table33%1/3
A and not(B)
A= $mm_or->{"VERSION_FROM"}B= not $depend =~ /^Makefile\s*:[^\n]*\$\(VERSION_FROM\)/m
ABresult
0X0
100
111
213 $depend!~/^Makefile\s*:[^\n]*\$\(VERSION_FROM\)/m) {
214 1 ▶ $depend.=$/ if length($depend) && substr($depend, -1) ne $/;
Branch: 1 branch
BranchTrueFalseTotal
if length $depend and substr($depend, -1) ne $/ 0 1 1
Condition33%1/3
length $depend and substr($depend, -1) ne $/
!ll&&!rl&&r
010
MC/DC0%0/2
length $depend and substr($depend, -1) ne $/
length $depend substr($depend, -1) ne $/
Truth table33%1/3
A and B
A= length $dependB= substr($depend, -1) ne $/
ABresult
0X0
100
111
215 1 $depend.='Makefile : $(VERSION_FROM)'.$/;
216 }
217 1 return $depend;
218  
219 }
220  
221  
222 # MakeMaker::MY replacement postamble section
223 #
224 sub postamble {
225  
226  
227 # Get self ref
228 #
229 1 ▶ my ($self, $mm_or, @param)=@_;
Subroutine postamble: called CC=3 SCAR=11.1
Pod documented
230 1 (my $section = (caller(0))[3]) =~ s/^.*:://;
231 1 msg("generating %s $section", ref($self));
232  
233  
234 # Get original postamble ready for append
235 #
236 1 my $postamble=$self->{$section}($mm_or, @param);
237  
238  
239 # Get this extension's postamble template
240 #
241 1 my $constant_hr=\%{sprintf('%s::MM::Constant::Constant', ref($self))};
242 1 ▶ if (my $patch_fn=$constant_hr->{'TEMPLATE_POSTAMBLE_FN'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $patch_fn = $constant_hr->{"TEMPLATE_POSTAMBLE_FN"}) 1 0 1
243  
244  
245 # Yes, exists as var so implement
246 #
247 1 msg('using template: %s', basename($patch_fn));
248  
249  
250 # Generate a platform-safe target command and append the template
251 #
252 1 ▶ my $mm_prefix=$constant_hr->{'MM_PREFIX'} || mm_prefix(ref($self));
Condition33%1/3
$constant_hr->{'MM_PREFIX'} || mm_prefix(ref $self)
l!l&&r!l&&!r
100
MC/DC0%0/2
$constant_hr->{'MM_PREFIX'} || mm_prefix(ref $self)
$constant_hr->{'MM_PREFIX'} mm_prefix(ref $self)
Truth table33%1/3
A || B
A= $constant_hr->{'MM_PREFIX'}B= mm_prefix(ref $self)
ABresult
1X1
011
000
253 1 my $pm_macro="${mm_prefix}_PM";
254 1 my $argv_macro="${mm_prefix}_PM_ARGV";
255 1 my $target_macro="${mm_prefix}_PM_TARGET";
256 1 my $pm_target=$mm_or->oneliner(sprintf(
257 'my $method=shift(@ARGV); $(%s)->$method($(%s), @ARGV)',
258 $pm_macro,
259 $argv_macro
260 ));
261 1 $pm_target=~s/^\$\(ABSPERLRUN\)/\$\(PERLRUN\) -M\$\($pm_macro\)/;
262 1 $postamble.="$target_macro=$pm_target$/";
263 1 $postamble.=slurp($patch_fn);
264  
265  
266 }
267  
268  
269 # All done, return result
270 #
271 1 return $postamble;
272  
273 }
274  
275  
276 sub post_initialize {
277  
278  
279 # Add license file, other support files here
280 #
281 1 ▶ my ($self, $mm_or, @param)=@_;
Subroutine post_initialize: called CC=14 SCAR=33.2
Pod documented
282 1 (my $section = (caller(0))[3]) =~ s/^.*:://;
283 1 msg("generating %s $section", ref($self));
284  
285  
286 # Get original postamble ready for append
287 #
288 1 my $post_initialize=$self->{$section}($mm_or, @param);
289  
290  
291 # Add license file
292 #
293 1 ▶ $mm_or->{'PM'}{'LICENSE'}='$(INST_LIBDIR)/$(BASEEXT)/LICENSE' if -e 'LICENSE';
Branch: 1 branch
BranchTrueFalseTotal
if -e "LICENSE" 1 0 1
294  
295  
296 # Don't install docs/tmp files etc.
297 #
298 1 my %pm=map { $_=>$mm_or->{'PM'}{$_} } grep { !/\.(?:md|xml|pod|bak|tmp|new|old|ref|0|1)$/ } keys %{$mm_or->{'PM'}};
299 1 $mm_or->{'PM'}=\%pm;
300  
301  
302 # Update and install Git ref if needed/available
303 #
304 1 my $devnull=File::Spec->devnull();
305 1 my $version_from_fn=$mm_or->{'VERSION_FROM'};
306 1 ▶ my $git_ref_fn=$version_from_fn && "${version_from_fn}.sha";
Condition50%1/2
$version_from_fn && "$version_from_fn.sha"
!ll
01
MC/DC0%0/1
$version_from_fn && "$version_from_fn.sha"
$version_from_fn
Truth table50%1/2
A
A= $version_from_fn
Aresult
00
11
307 1 ▶ if ($version_from_fn && -f $version_from_fn &&
Branch: 1 branch
BranchTrueFalseTotal
if ($version_from_fn and -f $version_from_fn and my $git_version = `git rev-parse --short HEAD 2>$devnull` and not $?) 1 0 1
Condition33%3/9
$version_from_fn and -f $version_from_fn and my $git_version = `git rev-parse --short HEAD 2>$devnull` and not $?
!ll&&!rl&&r
001
$version_from_fn and -f $version_from_fn and my $git_version = `git rev-parse --short HEAD 2>$devnull`
!ll&&!rl&&r
001
$version_from_fn and -f $version_from_fn
!ll&&!rl&&r
001
MC/DC0%0/4
$version_from_fn and -f $version_from_fn and my $git_version = `git rev-parse --short HEAD 2>$devnull` and not $?
$version_from_fn -f $version_from_fn my $git_version = `git rev-parse --short HEAD 2>$devnull` not $?
Truth table20%1/5
A and B and C and not(D)
A= $version_from_fnB= -f $version_from_fnC= my $git_version = `git rev-parse --short HEAD 2>$devnull`D= not $?
ABCDresult
0XXX0
10XX0
110X0
11100
11111
308 (my $git_version=qx(git rev-parse --short HEAD 2>$devnull)) && !$?) {
309 1 chomp($git_version);
310 1 ▶ tie(my @lines, 'Tie::File', $git_ref_fn) ||
Branch: 1 branch
BranchTrueFalseTotal
tie my @lines, "Tie::File", $git_ref_fn or die "error on Tie::File, $!" 1 0 1
311 die("error on Tie::File, $!");
312 1 ▶ @lines=($git_version)
Branch: 1 branch
BranchTrueFalseTotal
unless @lines == 1 and $lines[0] eq $git_version 0 1 1
Condition33%1/3
@lines == 1 and $lines[0] eq $git_version
!ll&&!rl&&r
001
MC/DC0%0/2
@lines == 1 and $lines[0] eq $git_version
@lines == 1 $lines[0] eq $git_version
Truth table33%1/3
A and B
A= @lines == 1B= $lines[0] eq $git_version
ABresult
0X0
100
111
313 unless @lines==1 && $lines[0] eq $git_version;
314 }
315 1 ▶ if ($git_ref_fn && -f $git_ref_fn) {
Branch: 1 branch
BranchTrueFalseTotal
if ($git_ref_fn and -f $git_ref_fn) 1 0 1
Condition33%1/3
$git_ref_fn and -f $git_ref_fn
!ll&&!rl&&r
001
MC/DC0%0/2
$git_ref_fn and -f $git_ref_fn
$git_ref_fn -f $git_ref_fn
Truth table33%1/3
A and B
A= $git_ref_fnB= -f $git_ref_fn
ABresult
0X0
100
111
316 1 ▶ if ($mm_or->{'PM'}{$version_from_fn}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($mm_or->{'PM'}{$version_from_fn}) { } 1 0 1
elsif (grep {$version_from_fn eq $_;} @{$$mm_or{'EXE_FILES'};}) { } 0 0 0
317 1 $mm_or->{'PM'}{$git_ref_fn}=$mm_or->{'PM'}{$version_from_fn}.'.sha';
318 }
319 0 elsif (grep {$version_from_fn eq $_} @{$mm_or->{'EXE_FILES'}}) {
320 0 (my $git_ref_base_fn=$git_ref_fn)=~s{^.*[/\\]}{};
321 0 $mm_or->{'PM'}{$git_ref_fn}='$(INST_SCRIPT)/'.$git_ref_base_fn;
322 }
323 }
324  
325 # Done
326 #
327 1 return $post_initialize
328  
329 }
330  
331  
332 # Construct a default Makefile macro prefix from an extension class
333 #
334 sub mm_prefix {
335  
336 0 ▶ my $class=shift();
Subroutine mm_prefix: called CC=1 SCAR=6.9
Pod undocumented
337 0 $class=~s/::/_/g;
338 0 return uc($class)
339  
340 }
341  
342  
343 # Not used yet
344 #
345 sub special_targets {
346  
347 0 ▶ my ($self, $mm_or, @param)=@_;
Subroutine special_targets: called CC=1 SCAR=6.9
Pod undocumented
348 0 (my $section = (caller(0))[3]) =~ s/^.*:://;
349 0 msg("generating %s $section", ref($self));
350  
351 0 my $special_targets=$self->{$section}($mm_or, @param);
352 0 $special_targets=~s/\.PHONY:\s+(.*)/\.PHONY: $1 cpanfile/m;
353 0 return $special_targets;
354  
355 }
356  
357  
358  
359 __END__
« lib/ASPEER/MakeMaker.pm ↑ Summary lib/ASPEER/MakeMaker/MM/Util.pm »