2 # MakeMaker default methods for MacOS
3 # This package is inserted into @ISA of MakeMaker's MM before the
4 # built-in ExtUtils::MM_Unix methods if MakeMaker.pm is run under MacOS.
6 # Author: Matthias Neeracher <neeracher@mac.com>
7 # Maintainer: Chris Nandor <pudge@pobox.com>
9 package ExtUtils::MM_MacOS;
10 require ExtUtils::MM_Any;
11 require ExtUtils::MM_Unix;
12 @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
14 use vars qw($VERSION);
22 use vars qw(%make_data);
24 my $Mac_FS = eval { require Mac::FileSpec::Unixish };
26 use ExtUtils::MakeMaker qw($Verbose &neatvalue);
30 ExtUtils::MM_MacOS - methods to override UN*X behaviour in ExtUtils::MakeMaker
34 use ExtUtils::MM_MacOS; # Done internally by ExtUtils::MakeMaker if needed
38 MM_MacOS currently only produces an approximation to the correct Makefile.
43 my($class,$self) = @_;
47 print STDOUT "Mac MakeMaker (v$ExtUtils::MakeMaker::VERSION)\n" if $Verbose;
48 if (-f "MANIFEST" && ! -f "Makefile.mk"){
49 ExtUtils::MakeMaker::check_manifest();
52 mkdir("Obj", 0777) unless -d "Obj";
54 $self = {} unless (defined $self);
56 my(%initial_att) = %$self; # record initial attributes
58 if (defined $self->{CONFIGURE}) {
59 if (ref $self->{CONFIGURE} eq 'CODE') {
60 $self = { %$self, %{&{$self->{CONFIGURE}}}};
62 Carp::croak "Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n";
66 my $newclass = ++$ExtUtils::MakeMaker::PACKNAME;
67 local @ExtUtils::MakeMaker::Parent = @ExtUtils::MakeMaker::Parent; # Protect against non-local exits
70 print "Blessing Object into class [$newclass]\n" if $Verbose>=2;
71 ExtUtils::MakeMaker::mv_all_methods("MY",$newclass);
72 bless $self, $newclass;
75 @{"$newclass\:\:ISA"} = 'MM';
78 if (defined $ExtUtils::MakeMaker::Parent[-2]){
79 $self->{PARENT} = $ExtUtils::MakeMaker::Parent[-2];
81 for $key (@ExtUtils::MakeMaker::Prepend_parent) {
82 next unless defined $self->{PARENT}{$key};
83 $self->{$key} = $self->{PARENT}{$key};
84 unless ($^O eq 'VMS' && $key =~ /PERL$/) {
85 $self->{$key} = $self->catdir("..",$self->{$key})
86 unless $self->file_name_is_absolute($self->{$key});
88 # PERL or FULLPERL will be a command verb or even a
89 # command with an argument instead of a full file
90 # specification under VMS. So, don't turn the command
91 # into a filespec, but do add a level to the path of
92 # the argument if not already absolute.
93 my @cmd = split /\s+/, $self->{$key};
94 $cmd[1] = $self->catfile('[-]',$cmd[1])
95 unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]);
96 $self->{$key} = join(' ', @cmd);
99 if ($self->{PARENT}) {
100 $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
101 foreach my $opt (qw(POLLUTE PERL_CORE)) {
102 if (exists $self->{PARENT}->{$opt}
103 and not exists $self->{$opt})
105 # inherit, but only if already unspecified
106 $self->{$opt} = $self->{PARENT}->{$opt};
110 my @fm = grep /^FIRST_MAKEFILE=/, @ARGV;
111 $self->parse_args(@fm) if @fm;
113 $self->parse_args(split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV);
116 $self->{NAME} ||= $self->guess_name;
118 ($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g;
121 $self->init_dirscan();
122 $self->init_others();
124 push @{$self->{RESULT}}, <<END;
125 # This Makefile is for the $self->{NAME} extension to perl.
127 # It was generated automatically by MakeMaker version
128 # $VERSION (Revision: $Revision) from the contents of
129 # Makefile.PL. Don't edit this file, edit Makefile.PL instead.
131 # ANY CHANGES MADE HERE WILL BE LOST!
133 # MakeMaker Parameters:
136 foreach $key (sort keys %initial_att){
137 my($v) = neatvalue($initial_att{$key});
138 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
140 push @{$self->{RESULT}}, "# $key => $v";
143 # turn the SKIP array into a SKIPHASH hash
145 for $skip (@{$self->{SKIP} || []}) {
146 $self->{SKIPHASH}{$skip} = 1;
148 delete $self->{SKIP}; # free memory
150 # We skip many sections for MacOS, but we don't say anything about it in the Makefile
151 for (qw/ const_config tool_autosplit
152 tool_xsubpp tools_other dist macro depend post_constants
153 pasthru c_o xs_c xs_o top_targets linkext
154 dynamic_bs dynamic_lib static_lib manifypods
155 installbin subdirs dist_basics dist_core
156 dist_dir dist_test dist_ci install force perldepend makefile
157 staticmake test pm_to_blib selfdocument cflags
158 const_loadlibs const_cccmd
161 $self->{SKIPHASH}{$_} = 2;
163 push @ExtUtils::MakeMaker::MM_Sections, "rulez"
164 unless grep /rulez/, @ExtUtils::MakeMaker::MM_Sections;
166 if ($self->{PARENT}) {
167 for (qw/install dist dist_basics dist_core dist_dir dist_test dist_ci/) {
168 $self->{SKIPHASH}{$_} = 1;
172 # We run all the subdirectories now. They don't have much to query
173 # from the parent, but the parent has to query them: if they need linking!
174 unless ($self->{NORECURS}) {
175 $self->eval_in_subdirs if @{$self->{DIR}};
179 foreach $section ( @ExtUtils::MakeMaker::MM_Sections ){
180 next if ($self->{SKIPHASH}{$section} == 2);
181 print "Processing Makefile '$section' section\n" if ($Verbose >= 2);
182 $self->{ABSTRACT_FROM} = macify($self->{ABSTRACT_FROM})
183 if $self->{ABSTRACT_FROM};
184 my($skipit) = $self->skipcheck($section);
186 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section $skipit.";
188 my(%a) = %{$self->{$section} || {}};
189 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section:";
190 push @{$self->{RESULT}}, "# " . join ", ", %a if $Verbose && %a;
191 push @{$self->{RESULT}}, $self->nicetext($self->$section( %a ));
195 push @{$self->{RESULT}}, "\n# End.";
198 $ExtUtils::MM_MacOS::make_data{$cwd} = $self;
205 return 'skipped' if $self->{SKIPHASH}{$section};
211 Returns true, if the argument is likely to be a command.
216 my($self,$file) = @_;
217 return $file if ! -d $file;
223 Guess the name of this package by examining the working directory's
224 name. MakeMaker calls this only if the developer has not supplied a
232 $name =~ s/.*:// unless ($name =~ s/^.*:ext://);
234 $name =~ s#[\-_][\d.\-]+$##; # this is new with MM 5.00
240 Translate relative path names into Mac names.
248 foreach (split(/[ \t\n]+/, $unix)) {
250 if ($Mac_FS) { # should always be true
251 $_ = Mac::FileSpec::Unixish::nativize($_);
266 Translate to Mac names & patterns
274 foreach (split(/[ \t\n]+/, $unix)) {
279 $_ = "'$_'" if /[?Å]/;
289 Initializes some of NAME, FULLEXT, BASEEXT, ROOTEXT, DLBASE, PERL_SRC,
290 PERL_LIB, PERL_ARCHLIB, PERL_INC, INSTALLDIRS, INST_*, INSTALL*,
291 PREFIX, CONFIG, AR, AR_STATIC_ARGS, LD, OBJ_EXT, LIB_EXT, MAP_TARGET,
292 LIBPERL_A, VERSION_FROM, VERSION, DISTNAME, VERSION_SYM.
299 # --- Initialize Module Name and Paths
301 # NAME = The perl module name for this extension (eg DBD::Oracle).
302 # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
303 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
304 # ROOTEXT = Directory part of FULLEXT with trailing :.
306 $self->{NAME}) =~ s!::!:!g ; #eg. BSD:Foo:Socket
308 $self->{NAME}) =~ s!.*::!! ; #eg. Socket
310 $self->{FULLEXT}) =~ s#:?\Q$self->{BASEEXT}\E$## ; #eg. BSD:Foo
311 $self->{ROOTEXT} .= ":" if ($self->{ROOTEXT});
313 # --- Initialize PERL_LIB, INST_LIB, PERL_SRC
315 # *Real* information: where did we get these two from? ...
316 my $inc_config_dir = dirname($INC{'Config.pm'});
317 my $inc_carp_dir = dirname($INC{'Carp.pm'});
319 unless ($self->{PERL_SRC}){
321 foreach $dir (qw(:: ::: :::: ::::: ::::::)){
322 if (-f "${dir}perl.h") {
323 $self->{PERL_SRC}=$dir ;
327 if (!$self->{PERL_SRC} && -f "$ENV{MACPERL}CORE:perl:perl.h") {
328 # Mac pathnames may be very nasty, so we'll install symlinks
329 unlink(":PerlCore", ":PerlLib");
330 symlink("$ENV{MACPERL}CORE:", "PerlCore");
331 symlink("$ENV{MACPERL}lib:", "PerlLib");
332 $self->{PERL_SRC} = ":PerlCore:perl:" ;
333 $self->{PERL_LIB} = ":PerlLib:";
336 if ($self->{PERL_SRC}){
337 $self->{MACPERL_SRC} = File::Spec->catdir("$self->{PERL_SRC}","macos:");
338 $self->{MACPERL_LIB} ||= File::Spec->catdir("$self->{MACPERL_SRC}","lib");
339 $self->{PERL_LIB} ||= File::Spec->catdir("$self->{PERL_SRC}","lib");
340 $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
341 $self->{PERL_INC} = $self->{PERL_SRC};
342 $self->{MACPERL_INC} = $self->{MACPERL_SRC};
345 $self->{PERL_LIB} ||= "$ENV{MACPERL}site_perl";
346 $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
347 $self->{PERL_INC} = $ENV{MACPERL};
349 #On MacOS, we need to build under the Perl source directory or have the MacPerl SDK
350 #installed in the MacPerl folder.
354 $self->{INSTALLDIRS} = "perl";
355 $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB};
356 $self->{INST_MAN1DIR} = $self->{INSTALLMAN1DIR} = "none";
357 $self->{MAN1EXT} ||= $Config::Config{man1ext};
358 $self->{INST_MAN3DIR} = $self->{INSTALLMAN3DIR} = "none";
359 $self->{MAN3EXT} ||= $Config::Config{man3ext};
360 $self->{MAP_TARGET} ||= "perl";
362 # make a simple check if we find Exporter
363 # hm ... do we really care? at all?
364 # warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory
365 # (Exporter.pm not found)"
366 # unless -f File::Spec->catfile("$self->{PERL_LIB}","Exporter.pm") ||
367 # $self->{NAME} eq "ExtUtils::MakeMaker";
369 # Determine VERSION and VERSION_FROM
370 ($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME};
371 if ($self->{VERSION_FROM}){
373 open(FH,macify($self->{VERSION_FROM})) or
374 die "Could not open '$self->{VERSION_FROM}' (attribute VERSION_FROM): $!";
377 next unless /\$([\w:]*\bVERSION)\b.*=/;
378 local $ExtUtils::MakeMaker::module_version_variable = $1;
381 die "Could not eval '$eval': $@" if $@;
382 if ($self->{VERSION} = $ {$ExtUtils::MakeMaker::module_version_variable}){
383 print "$self->{NAME} VERSION is $self->{VERSION} (from $self->{VERSION_FROM})\n" if $Verbose;
385 # XXX this should probably croak
386 print "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n";
393 if ($self->{VERSION}) {
394 $self->{VERSION} =~ s/^\s+//;
395 $self->{VERSION} =~ s/\s+$//;
398 $self->{VERSION} = "0.10" unless $self->{VERSION};
399 ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g;
402 # Graham Barr and Paul Marquess had some ideas how to ensure
403 # version compatibility between the *.pm file and the
404 # corresponding *.xs file. The bottomline was, that we need an
405 # XS_VERSION macro that defaults to VERSION:
406 $self->{XS_VERSION} ||= $self->{VERSION};
408 # --- Initialize Perl Binary Locations
410 # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
411 # will be working versions of perl 5. miniperl has priority over perl
412 # for PERL to ensure that $(PERL) is usable while building ./ext/*
413 my ($component,@defpath);
414 foreach $component ($self->{PERL_SRC}, File::Spec->path(), $Config::Config{binexp}) {
415 push @defpath, $component if defined $component;
417 $self->{PERL} = "$self->{PERL_SRC}miniperl";
418 $self->{FULLPERL} = "$self->{PERL_SRC}perl";
419 $self->{MAKEFILE} = "Makefile.mk";
424 Initializes LDLOADLIBS, LIBS
428 sub init_others { # --- Initialize Other Attributes
431 if ( !$self->{OBJECT} ) {
432 # init_dirscan should have found out, if we have C files
433 $self->{OBJECT} = "";
434 $self->{OBJECT} = "$self->{BASEEXT}.c" if @{$self->{C}||[]};
436 $self->{OBJECT} =~ s/\$\(O_FILES\)/@{$self->{C}||[]}/;
439 foreach (split(/[ \t\n]+/, $self->{OBJECT})) {
440 if (/^$self->{BASEEXT}\.o(bj)?$/) {
441 $src .= " $self->{BASEEXT}.c";
442 } elsif (/^(.*\..*)\.o$/) {
444 } elsif (/^(.*)(\.o(bj)?|\$\(OBJ_EXT\))$/) {
454 $self->{SOURCE} = $src;
460 Initializes DIR, XS, PM, C, O_FILES, H, PL_FILES, MAN*PODS, EXE_FILES.
464 sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
466 my($name, %dir, %xs, %c, %h, %ignore, %pl_files, %manifypods);
467 local(%pm); #the sub in find() has to see this hash
469 # in case we don't find it below!
470 if ($self->{VERSION_FROM}) {
471 my $version_from = macify($self->{VERSION_FROM});
472 $pm{$version_from} = File::Spec->catfile('$(INST_LIBDIR)',
476 $ignore{'test.pl'} = 1;
477 foreach $name ($self->lsdir(":")){
478 next if ($name =~ /^\./ or $ignore{$name});
479 next unless $self->libscan($name);
481 $dir{$name} = $name if (-f ":$name:Makefile.PL");
482 } elsif ($name =~ /\.xs$/){
483 my($c); ($c = $name) =~ s/\.xs$/.c/;
486 } elsif ($name =~ /\.c(p|pp|xx|c)?$/i){ # .c .C .cpp .cxx .cc .cp
488 unless $name =~ m/perlmain\.c/; # See MAP_TARGET
489 } elsif ($name =~ /\.h$/i){
491 } elsif ($name =~ /\.(p[ml]|pod)$/){
492 $pm{$name} = File::Spec->catfile('$(INST_LIBDIR)',$name);
493 } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
494 ($pl_files{$name} = $name) =~ s/\.PL$// ;
498 # Some larger extensions often wish to install a number of *.pm/pl
499 # files into the library in various locations.
501 # The attribute PMLIBDIRS holds an array reference which lists
502 # subdirectories which we should search for library files to
503 # install. PMLIBDIRS defaults to [ 'lib', $self->{BASEEXT} ]. We
504 # recursively search through the named directories (skipping any
505 # which don't exist or contain Makefile.PL files).
507 # For each *.pm or *.pl file found $self->libscan() is called with
508 # the default installation path in $_[1]. The return value of
509 # libscan defines the actual installation location. The default
510 # libscan function simply returns the path. The file is skipped
511 # if libscan returns false.
513 # The default installation location passed to libscan in $_[1] is:
515 # ./*.pm => $(INST_LIBDIR)/*.pm
516 # ./xyz/... => $(INST_LIBDIR)/xyz/...
517 # ./lib/... => $(INST_LIB)/...
519 # In this way the 'lib' directory is seen as the root of the actual
520 # perl library whereas the others are relative to INST_LIBDIR
521 # (which includes ROOTEXT). This is a subtle distinction but one
522 # that's important for nested modules.
524 $self->{PMLIBDIRS} = ['lib', $self->{BASEEXT}]
525 unless $self->{PMLIBDIRS};
527 #only existing directories that aren't in $dir are allowed
529 my (@pmlibdirs) = map { macify ($_) } @{$self->{PMLIBDIRS}};
531 @{$self->{PMLIBDIRS}} = ();
532 foreach $pmlibdir (@pmlibdirs) {
533 -d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir;
536 if (@{$self->{PMLIBDIRS}}){
537 print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
540 File::Find::find(sub {
542 if ($_ eq "CVS" || $_ eq "RCS"){
543 $File::Find::prune = 1;
547 my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)');
548 my($striplibpath,$striplibname);
549 $prefix = '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:);
550 ($striplibname,$striplibpath) = fileparse($striplibpath);
551 my($inst) = File::Spec->catfile($prefix,$striplibpath,$striplibname);
552 local($_) = $inst; # for backwards compatibility
553 $inst = $self->libscan($inst);
554 print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
557 }, @{$self->{PMLIBDIRS}});
560 $self->{DIR} = [sort keys %dir] unless $self->{DIR};
561 $self->{XS} = \%xs unless $self->{XS};
562 $self->{PM} = \%pm unless $self->{PM};
563 $self->{C} = [sort keys %c] unless $self->{C};
564 $self->{H} = [sort keys %h] unless $self->{H};
565 $self->{PL_FILES} = \%pl_files unless $self->{PL_FILES};
567 # Set up names of manual pages to generate from pods
568 unless ($self->{MAN1PODS}) {
569 $self->{MAN1PODS} = {};
571 unless ($self->{MAN3PODS}) {
572 $self->{MAN3PODS} = {};
578 Takes a path to a file that is found by init_dirscan and returns false
579 if we don't want to include this file in the library. Mainly used to
580 exclude RCS, CVS, and SCCS directories from installation.
587 my($self,$path) = @_;
588 return '' if $path =~ m/:(RCS|CVS|SCCS):/ ;
594 Initializes lots of constants and .SUFFIXES and .PHONY
603 NAME DISTNAME NAME_SYM VERSION VERSION_SYM XS_VERSION
604 INST_LIB INST_ARCHLIB PERL_LIB PERL_SRC MACPERL_SRC MACPERL_LIB PERL FULLPERL
605 XSPROTOARG MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED SOURCE TYPEMAPS
607 next unless defined $self->{$tmp};
608 if ($tmp eq 'TYPEMAPS' && ref $self->{$tmp}) {
609 push @m, sprintf "$tmp = %s\n", join " ", @{$self->{$tmp}};
611 push @m, "$tmp = $self->{$tmp}\n";
616 MODULES = }.join(" \\\n\t", sort keys %{$self->{PM}})."\n";
617 push @m, "PMLIBDIRS = @{$self->{PMLIBDIRS}}\n" if @{$self->{PMLIBDIRS}};
621 .INCLUDE : $(MACPERL_SRC)BuildRules.mk
626 VERSION_MACRO = VERSION
627 DEFINE_VERSION = -d \$(VERSION_MACRO)="¶"\$(VERSION)¶""
628 XS_VERSION_MACRO = XS_VERSION
629 XS_DEFINE_VERSION = -d \$(XS_VERSION_MACRO)="¶"\$(XS_VERSION)¶""
632 $self->{DEFINE} .= " \$(XS_DEFINE_VERSION) \$(DEFINE_VERSION)";
635 MAKEMAKER = $INC{'ExtUtils/MakeMaker.pm'}
636 MM_VERSION = $ExtUtils::MakeMaker::VERSION
640 # FULLEXT = Pathname for extension directory (eg DBD:Oracle).
641 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
642 # ROOTEXT = Directory part of FULLEXT (eg DBD)
643 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
646 if ($self->{DEFINE}) {
647 $self->{DEFINE} =~ s/-D/-d /g; # Preprocessor definitions may be useful
648 $self->{DEFINE} =~ s/-I\S+/_include($1)/eg; # UN*X includes probably are not useful
651 $self->{INC} =~ s/-I(\S+)/_include($1)/eg; # UN*X includes probably are not useful
654 FULLEXT BASEEXT ROOTEXT DEFINE INC
656 next unless defined $self->{$tmp};
657 push @m, "$tmp = $self->{$tmp}\n";
661 # Handy lists of source code files:
662 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
663 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
664 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
669 .INCLUDE : $(MACPERL_SRC)ExtBuildRules.mk
677 Defines the static target.
682 # --- Static Loading Sections ---
685 my($extlib) = $self->{MYEXTLIB} ? "\nstatic :: myextlib\n" : "";
689 install :: do_install_static
691 install_static :: do_install_static
697 Used by MacOS to define DL_FUNCS and DL_VARS and write the *.exp
703 my($self,%attribs) = @_;
705 return '' unless !$self->{SKIPHASH}{'dynamic'};
707 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
708 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
712 dynamic :: $self->{BASEEXT}.exp
714 ") unless $self->{SKIPHASH}{'dynamic'};
716 my($extlib) = $self->{MYEXTLIB} ? " myextlib" : "";
719 $self->{BASEEXT}.exp: Makefile.PL$extlib
720 ", qq[\t\$(PERL) "-I\$(PERL_LIB)" -e 'use ExtUtils::Mksymlists; ],
721 'Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ',
722 neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\'
730 Defines the dynamic target.
735 # --- dynamic Loading Sections ---
741 install :: do_install_dynamic
743 install_dynamic :: do_install_dynamic
750 Defines the clean target.
755 # --- Cleanup and Distribution Sections ---
757 my($self, %attribs) = @_;
760 # Delete temporary files but do not touch installed files. We don\'t delete
761 # the Makefile here so a later make realclean still has a makefile to use.
765 # clean subdirectories first
766 for $dir (@{$self->{DIR}}) {
768 " Set OldEcho \{Echo\}
771 If \"\`Exists -f $self->{MAKEFILE}\`\" != \"\"
778 my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files
779 push(@otherfiles, patternify($attribs{FILES})) if $attribs{FILES};
780 push @m, "\t\$(RM_RF) @otherfiles\n";
781 # See realclean and ext/utils/make_ext for usage of Makefile.old
783 "\t\$(MV) $self->{MAKEFILE} $self->{MAKEFILE}.old\n");
785 "\t$attribs{POSTOP}\n") if $attribs{POSTOP};
791 Defines the realclean target.
796 my($self, %attribs) = @_;
799 # Delete temporary files (via clean) and also delete installed files
800 realclean purge :: clean
802 # realclean subdirectories first (already cleaned)
804 " Set OldEcho \{Echo\}
807 If \"\`Exists -f %s\`\" != \"\"
812 foreach(@{$self->{DIR}}){
813 push(@m, sprintf($sub,$_,"$self->{MAKEFILE}.old","-f $self->{MAKEFILE}.old"));
814 push(@m, sprintf($sub,$_,"$self->{MAKEFILE}",''));
816 my(@otherfiles) = ($self->{MAKEFILE},
817 "$self->{MAKEFILE}.old"); # Makefiles last
818 push(@otherfiles, patternify($attribs{FILES})) if $attribs{FILES};
819 push(@m, "\t\$(RM_RF) @otherfiles\n") if @otherfiles;
820 push(@m, "\t$attribs{POSTOP}\n") if $attribs{POSTOP};
831 install install_static install_dynamic ::
832 \t\$(MACPERL_SRC)PerlInstall -l \$(PERL_LIB)
834 .INCLUDE : \$(MACPERL_SRC)BulkBuildRules.mk
840 return $ExtUtils::MakeMaker::Version;
846 Defines targets to run *.PL files.
852 return "" unless $self->{PL_FILES};
854 foreach $plfile (sort keys %{$self->{PL_FILES}}) {
855 my $list = ref($self->{PL_FILES}->{$plfile})
856 ? $self->{PL_FILES}->{$plfile}
857 : [$self->{PL_FILES}->{$plfile}];
858 foreach $target (@$list) {
861 \t$self->{NOECHO}\$(NOOP)
864 \t\$(PERL) -I\$(MACPERL_LIB) -I\$(PERL_LIB) $plfile $target
871 sub _include { # for Unix-style includes, with -I instead of -i
873 require File::Spec::Unix;
875 # allow only relative paths
876 if (File::Spec::Unix->file_name_is_absolute($inc)) {
879 return '-i ' . macify($inc);