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 use ExtUtils::MakeMaker qw($Verbose &neatvalue);
28 ExtUtils::MM_MacOS - methods to override UN*X behaviour in ExtUtils::MakeMaker
32 use ExtUtils::MM_MacOS; # Done internally by ExtUtils::MakeMaker if needed
36 MM_MacOS currently only produces an approximation to the correct Makefile.
41 my($class,$self) = @_;
45 print STDOUT "Mac MakeMaker (v$ExtUtils::MakeMaker::VERSION)\n" if $Verbose;
46 if (-f "MANIFEST" && ! -f "Makefile.mk"){
47 ExtUtils::MakeMaker::check_manifest();
50 mkdir("Obj", 0777) unless -d "Obj";
52 $self = {} unless (defined $self);
54 my(%initial_att) = %$self; # record initial attributes
56 if (defined $self->{CONFIGURE}) {
57 if (ref $self->{CONFIGURE} eq 'CODE') {
58 $self = { %$self, %{&{$self->{CONFIGURE}}}};
60 Carp::croak "Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n";
64 my $newclass = ++$ExtUtils::MakeMaker::PACKNAME;
65 local @ExtUtils::MakeMaker::Parent = @ExtUtils::MakeMaker::Parent; # Protect against non-local exits
68 print "Blessing Object into class [$newclass]\n" if $Verbose>=2;
69 ExtUtils::MakeMaker::mv_all_methods("MY",$newclass);
70 bless $self, $newclass;
73 @{"$newclass\:\:ISA"} = 'MM';
76 if (defined $ExtUtils::MakeMaker::Parent[-2]){
77 $self->{PARENT} = $ExtUtils::MakeMaker::Parent[-2];
79 for $key (@ExtUtils::MakeMaker::Prepend_parent) {
80 next unless defined $self->{PARENT}{$key};
81 $self->{$key} = $self->{PARENT}{$key};
82 unless ($^O eq 'VMS' && $key =~ /PERL$/) {
83 $self->{$key} = $self->catdir("..",$self->{$key})
84 unless $self->file_name_is_absolute($self->{$key});
86 # PERL or FULLPERL will be a command verb or even a
87 # command with an argument instead of a full file
88 # specification under VMS. So, don't turn the command
89 # into a filespec, but do add a level to the path of
90 # the argument if not already absolute.
91 my @cmd = split /\s+/, $self->{$key};
92 $cmd[1] = $self->catfile('[-]',$cmd[1])
93 unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]);
94 $self->{$key} = join(' ', @cmd);
97 if ($self->{PARENT}) {
98 $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
99 foreach my $opt (qw(POLLUTE PERL_CORE)) {
100 if (exists $self->{PARENT}->{$opt}
101 and not exists $self->{$opt})
103 # inherit, but only if already unspecified
104 $self->{$opt} = $self->{PARENT}->{$opt};
108 my @fm = grep /^FIRST_MAKEFILE=/, @ARGV;
109 $self->parse_args(@fm) if @fm;
111 $self->parse_args(split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV);
114 $self->{NAME} ||= $self->guess_name;
116 ($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g;
119 $self->init_dirscan();
120 $self->init_others();
122 push @{$self->{RESULT}}, <<END;
123 # This Makefile is for the $self->{NAME} extension to perl.
125 # It was generated automatically by MakeMaker version
126 # $VERSION (Revision: $Revision) from the contents of
127 # Makefile.PL. Don't edit this file, edit Makefile.PL instead.
129 # ANY CHANGES MADE HERE WILL BE LOST!
131 # MakeMaker Parameters:
134 foreach $key (sort keys %initial_att){
135 my($v) = neatvalue($initial_att{$key});
136 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
138 push @{$self->{RESULT}}, "# $key => $v";
141 # turn the SKIP array into a SKIPHASH hash
143 for $skip (@{$self->{SKIP} || []}) {
144 $self->{SKIPHASH}{$skip} = 1;
146 delete $self->{SKIP}; # free memory
148 # We skip many sections for MacOS, but we don't say anything about it in the Makefile
149 for (qw/ const_config tool_autosplit
150 tool_xsubpp tools_other dist macro depend post_constants
151 pasthru c_o xs_c xs_o top_targets linkext
152 dynamic_bs dynamic_lib static_lib manifypods
153 installbin subdirs dist_basics dist_core
154 dist_dir dist_test dist_ci install force perldepend makefile
155 staticmake test pm_to_blib selfdocument cflags
156 const_loadlibs const_cccmd
159 $self->{SKIPHASH}{$_} = 2;
161 push @ExtUtils::MakeMaker::MM_Sections, "rulez"
162 unless grep /rulez/, @ExtUtils::MakeMaker::MM_Sections;
164 if ($self->{PARENT}) {
165 for (qw/install dist dist_basics dist_core dist_dir dist_test dist_ci/) {
166 $self->{SKIPHASH}{$_} = 1;
170 # We run all the subdirectories now. They don't have much to query
171 # from the parent, but the parent has to query them: if they need linking!
172 unless ($self->{NORECURS}) {
173 $self->eval_in_subdirs if @{$self->{DIR}};
177 foreach $section ( @ExtUtils::MakeMaker::MM_Sections ){
178 next if ($self->{SKIPHASH}{$section} == 2);
179 print "Processing Makefile '$section' section\n" if ($Verbose >= 2);
180 $self->{ABSTRACT_FROM} = macify($self->{ABSTRACT_FROM})
181 if $self->{ABSTRACT_FROM};
182 my($skipit) = $self->skipcheck($section);
184 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section $skipit.";
186 my(%a) = %{$self->{$section} || {}};
187 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section:";
188 push @{$self->{RESULT}}, "# " . join ", ", %a if $Verbose && %a;
189 push @{$self->{RESULT}}, $self->nicetext($self->$section( %a ));
193 push @{$self->{RESULT}}, "\n# End.";
196 $ExtUtils::MM_MacOS::make_data{$cwd} = $self;
203 return 'skipped' if $self->{SKIPHASH}{$section};
209 Returns true, if the argument is likely to be a command.
214 my($self,$file) = @_;
215 return $file if ! -d $file;
221 Guess the name of this package by examining the working directory's
222 name. MakeMaker calls this only if the developer has not supplied a
230 $name =~ s/.*:// unless ($name =~ s/^.*:ext://);
232 $name =~ s#[\-_][\d.\-]+$##; # this is new with MM 5.00
238 Translate relative path names into Mac names.
243 # mmm, better ... and this condition should always be satisified,
244 # as the module is now distributed with MacPerl, but leave in anyway
245 if (do 'Mac/FileSpec/Unixish.pm') {
246 return Mac::FileSpec::Unixish::nativize($_[0]);
254 foreach (split(/[ \t\n]+/, $unix)) {
267 Translate to Mac names & patterns
275 foreach (split(/[ \t\n]+/, $unix)) {
280 $_ = "'$_'" if /[?Å]/;
290 Initializes some of NAME, FULLEXT, BASEEXT, ROOTEXT, DLBASE, PERL_SRC,
291 PERL_LIB, PERL_ARCHLIB, PERL_INC, INSTALLDIRS, INST_*, INSTALL*,
292 PREFIX, CONFIG, AR, AR_STATIC_ARGS, LD, OBJ_EXT, LIB_EXT, MAP_TARGET,
293 LIBPERL_A, VERSION_FROM, VERSION, DISTNAME, VERSION_SYM.
300 # --- Initialize Module Name and Paths
302 # NAME = The perl module name for this extension (eg DBD::Oracle).
303 # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
304 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
305 # ROOTEXT = Directory part of FULLEXT with trailing :.
307 $self->{NAME}) =~ s!::!:!g ; #eg. BSD:Foo:Socket
309 $self->{NAME}) =~ s!.*::!! ; #eg. Socket
311 $self->{FULLEXT}) =~ s#:?\Q$self->{BASEEXT}\E$## ; #eg. BSD:Foo
312 $self->{ROOTEXT} .= ":" if ($self->{ROOTEXT});
314 # --- Initialize PERL_LIB, INST_LIB, PERL_SRC
316 # *Real* information: where did we get these two from? ...
317 my $inc_config_dir = dirname($INC{'Config.pm'});
318 my $inc_carp_dir = dirname($INC{'Carp.pm'});
320 unless ($self->{PERL_SRC}){
322 foreach $dir (qw(:: ::: :::: ::::: ::::::)){
323 if (-f "${dir}perl.h") {
324 $self->{PERL_SRC}=$dir ;
328 if (!$self->{PERL_SRC} && -f "$ENV{MACPERL}CORE:perl:perl.h") {
329 # Mac pathnames may be very nasty, so we'll install symlinks
330 unlink(":PerlCore", ":PerlLib");
331 symlink("$ENV{MACPERL}CORE:", "PerlCore");
332 symlink("$ENV{MACPERL}lib:", "PerlLib");
333 $self->{PERL_SRC} = ":PerlCore:perl:" ;
334 $self->{PERL_LIB} = ":PerlLib:";
337 if ($self->{PERL_SRC}){
338 $self->{MACPERL_SRC} = File::Spec->catdir("$self->{PERL_SRC}","macos:");
339 $self->{MACPERL_LIB} ||= File::Spec->catdir("$self->{MACPERL_SRC}","lib");
340 $self->{PERL_LIB} ||= File::Spec->catdir("$self->{PERL_SRC}","lib");
341 $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
342 $self->{PERL_INC} = $self->{PERL_SRC};
343 $self->{MACPERL_INC} = $self->{MACPERL_SRC};
346 $self->{PERL_LIB} ||= "$ENV{MACPERL}site_perl";
347 $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
348 $self->{PERL_INC} = $ENV{MACPERL};
350 #On MacOS, we need to build under the Perl source directory or have the MacPerl SDK
351 #installed in the MacPerl folder.
355 $self->{INSTALLDIRS} = "perl";
356 $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB};
357 $self->{INST_MAN1DIR} = $self->{INSTALLMAN1DIR} = "none";
358 $self->{MAN1EXT} ||= $Config::Config{man1ext};
359 $self->{INST_MAN3DIR} = $self->{INSTALLMAN3DIR} = "none";
360 $self->{MAN3EXT} ||= $Config::Config{man3ext};
361 $self->{MAP_TARGET} ||= "perl";
363 # make a simple check if we find Exporter
364 # hm ... do we really care? at all?
365 # warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory
366 # (Exporter.pm not found)"
367 # unless -f File::Spec->catfile("$self->{PERL_LIB}","Exporter.pm") ||
368 # $self->{NAME} eq "ExtUtils::MakeMaker";
370 # Determine VERSION and VERSION_FROM
371 ($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME};
372 if ($self->{VERSION_FROM}){
374 open(FH,macify($self->{VERSION_FROM})) or
375 die "Could not open '$self->{VERSION_FROM}' (attribute VERSION_FROM): $!";
378 next unless /\$([\w:]*\bVERSION)\b.*=/;
379 local $ExtUtils::MakeMaker::module_version_variable = $1;
382 die "Could not eval '$eval': $@" if $@;
383 if ($self->{VERSION} = $ {$ExtUtils::MakeMaker::module_version_variable}){
384 print "$self->{NAME} VERSION is $self->{VERSION} (from $self->{VERSION_FROM})\n" if $Verbose;
386 # XXX this should probably croak
387 print "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n";
394 if ($self->{VERSION}) {
395 $self->{VERSION} =~ s/^\s+//;
396 $self->{VERSION} =~ s/\s+$//;
399 $self->{VERSION} = "0.10" unless $self->{VERSION};
400 ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g;
403 # Graham Barr and Paul Marquess had some ideas how to ensure
404 # version compatibility between the *.pm file and the
405 # corresponding *.xs file. The bottomline was, that we need an
406 # XS_VERSION macro that defaults to VERSION:
407 $self->{XS_VERSION} ||= $self->{VERSION};
409 # --- Initialize Perl Binary Locations
411 # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
412 # will be working versions of perl 5. miniperl has priority over perl
413 # for PERL to ensure that $(PERL) is usable while building ./ext/*
414 my ($component,@defpath);
415 foreach $component ($self->{PERL_SRC}, File::Spec->path(), $Config::Config{binexp}) {
416 push @defpath, $component if defined $component;
418 $self->{PERL} = "$self->{PERL_SRC}miniperl";
419 $self->{FULLPERL} = "$self->{PERL_SRC}perl";
420 $self->{MAKEFILE} = "Makefile.mk";
425 Initializes LDLOADLIBS, LIBS
429 sub init_others { # --- Initialize Other Attributes
432 if ( !$self->{OBJECT} ) {
433 # init_dirscan should have found out, if we have C files
434 $self->{OBJECT} = "";
435 $self->{OBJECT} = "$self->{BASEEXT}.c" if @{$self->{C}||[]};
437 $self->{OBJECT} =~ s/\$\(O_FILES\)/@{$self->{C}||[]}/;
440 foreach (split(/[ \t\n]+/, $self->{OBJECT})) {
441 if (/^$self->{BASEEXT}\.o(bj)?$/) {
442 $src .= " $self->{BASEEXT}.c";
443 } elsif (/^(.*\..*)\.o$/) {
445 } elsif (/^(.*)(\.o(bj)?|\$\(OBJ_EXT\))$/) {
455 $self->{SOURCE} = $src;
461 Initializes DIR, XS, PM, C, O_FILES, H, PL_FILES, MAN*PODS, EXE_FILES.
465 sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
467 my($name, %dir, %xs, %c, %h, %ignore, %pl_files, %manifypods);
468 local(%pm); #the sub in find() has to see this hash
470 # in case we don't find it below!
471 if ($self->{VERSION_FROM}) {
472 my $version_from = macify($self->{VERSION_FROM});
473 $pm{$version_from} = File::Spec->catfile('$(INST_LIBDIR)',
477 $ignore{'test.pl'} = 1;
478 foreach $name ($self->lsdir(":")){
479 next if ($name =~ /^\./ or $ignore{$name});
480 next unless $self->libscan($name);
482 $dir{$name} = $name if (-f ":$name:Makefile.PL");
483 } elsif ($name =~ /\.xs$/){
484 my($c); ($c = $name) =~ s/\.xs$/.c/;
487 } elsif ($name =~ /\.c(p|pp|xx|c)?$/i){ # .c .C .cpp .cxx .cc .cp
489 unless $name =~ m/perlmain\.c/; # See MAP_TARGET
490 } elsif ($name =~ /\.h$/i){
492 } elsif ($name =~ /\.(p[ml]|pod)$/){
493 $pm{$name} = File::Spec->catfile('$(INST_LIBDIR)',$name);
494 } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
495 ($pl_files{$name} = $name) =~ s/\.PL$// ;
499 # Some larger extensions often wish to install a number of *.pm/pl
500 # files into the library in various locations.
502 # The attribute PMLIBDIRS holds an array reference which lists
503 # subdirectories which we should search for library files to
504 # install. PMLIBDIRS defaults to [ 'lib', $self->{BASEEXT} ]. We
505 # recursively search through the named directories (skipping any
506 # which don't exist or contain Makefile.PL files).
508 # For each *.pm or *.pl file found $self->libscan() is called with
509 # the default installation path in $_[1]. The return value of
510 # libscan defines the actual installation location. The default
511 # libscan function simply returns the path. The file is skipped
512 # if libscan returns false.
514 # The default installation location passed to libscan in $_[1] is:
516 # ./*.pm => $(INST_LIBDIR)/*.pm
517 # ./xyz/... => $(INST_LIBDIR)/xyz/...
518 # ./lib/... => $(INST_LIB)/...
520 # In this way the 'lib' directory is seen as the root of the actual
521 # perl library whereas the others are relative to INST_LIBDIR
522 # (which includes ROOTEXT). This is a subtle distinction but one
523 # that's important for nested modules.
525 $self->{PMLIBDIRS} = ['lib', $self->{BASEEXT}]
526 unless $self->{PMLIBDIRS};
528 #only existing directories that aren't in $dir are allowed
530 my (@pmlibdirs) = map { macify ($_) } @{$self->{PMLIBDIRS}};
532 @{$self->{PMLIBDIRS}} = ();
533 foreach $pmlibdir (@pmlibdirs) {
534 -d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir;
537 if (@{$self->{PMLIBDIRS}}){
538 print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
541 File::Find::find(sub {
543 if ($_ eq "CVS" || $_ eq "RCS"){
544 $File::Find::prune = 1;
548 my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)');
549 my($striplibpath,$striplibname);
550 $prefix = '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:);
551 ($striplibname,$striplibpath) = fileparse($striplibpath);
552 my($inst) = File::Spec->catfile($prefix,$striplibpath,$striplibname);
553 local($_) = $inst; # for backwards compatibility
554 $inst = $self->libscan($inst);
555 print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
558 }, @{$self->{PMLIBDIRS}});
561 $self->{DIR} = [sort keys %dir] unless $self->{DIR};
562 $self->{XS} = \%xs unless $self->{XS};
563 $self->{PM} = \%pm unless $self->{PM};
564 $self->{C} = [sort keys %c] unless $self->{C};
565 $self->{H} = [sort keys %h] unless $self->{H};
566 $self->{PL_FILES} = \%pl_files unless $self->{PL_FILES};
568 # Set up names of manual pages to generate from pods
569 unless ($self->{MAN1PODS}) {
570 $self->{MAN1PODS} = {};
572 unless ($self->{MAN3PODS}) {
573 $self->{MAN3PODS} = {};
579 Takes a path to a file that is found by init_dirscan and returns false
580 if we don't want to include this file in the library. Mainly used to
581 exclude RCS, CVS, and SCCS directories from installation.
588 my($self,$path) = @_;
589 return '' if $path =~ m/:(RCS|CVS|SCCS):/ ;
595 Initializes lots of constants and .SUFFIXES and .PHONY
604 NAME DISTNAME NAME_SYM VERSION VERSION_SYM XS_VERSION
605 INST_LIB INST_ARCHLIB PERL_LIB PERL_SRC MACPERL_SRC MACPERL_LIB PERL FULLPERL
606 XSPROTOARG MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED SOURCE TYPEMAPS
608 next unless defined $self->{$tmp};
609 push @m, "$tmp = $self->{$tmp}\n";
613 MODULES = }.join(" \\\n\t", sort keys %{$self->{PM}})."\n";
614 push @m, "PMLIBDIRS = @{$self->{PMLIBDIRS}}\n" if @{$self->{PMLIBDIRS}};
618 .INCLUDE : $(MACPERL_SRC)BuildRules.mk
623 VERSION_MACRO = VERSION
624 DEFINE_VERSION = -d \$(VERSION_MACRO)="¶"\$(VERSION)¶""
625 XS_VERSION_MACRO = XS_VERSION
626 XS_DEFINE_VERSION = -d \$(XS_VERSION_MACRO)="¶"\$(XS_VERSION)¶""
629 $self->{DEFINE} .= " \$(XS_DEFINE_VERSION) \$(DEFINE_VERSION)";
632 MAKEMAKER = $INC{'ExtUtils/MakeMaker.pm'}
633 MM_VERSION = $ExtUtils::MakeMaker::VERSION
637 # FULLEXT = Pathname for extension directory (eg DBD:Oracle).
638 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
639 # ROOTEXT = Directory part of FULLEXT (eg DBD)
640 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
643 if ($self->{DEFINE}) {
644 $self->{DEFINE} =~ s/-D/-d /g; # Preprocessor definitions may be useful
645 $self->{DEFINE} =~ s/-I\S+/_include($1)/eg; # UN*X includes probably are not useful
648 $self->{INC} =~ s/-I(\S+)/_include($1)/eg; # UN*X includes probably are not useful
651 FULLEXT BASEEXT ROOTEXT DEFINE INC
653 next unless defined $self->{$tmp};
654 push @m, "$tmp = $self->{$tmp}\n";
658 # Handy lists of source code files:
659 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
660 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
661 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
666 .INCLUDE : $(MACPERL_SRC)ExtBuildRules.mk
674 Defines the static target.
679 # --- Static Loading Sections ---
682 my($extlib) = $self->{MYEXTLIB} ? "\nstatic :: myextlib\n" : "";
686 install :: do_install_static
688 install_static :: do_install_static
694 Used by MacOS to define DL_FUNCS and DL_VARS and write the *.exp
700 my($self,%attribs) = @_;
702 return '' unless !$self->{SKIPHASH}{'dynamic'};
704 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
705 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
709 dynamic :: $self->{BASEEXT}.exp
711 ") unless $self->{SKIPHASH}{'dynamic'};
713 my($extlib) = $self->{MYEXTLIB} ? " myextlib" : "";
716 $self->{BASEEXT}.exp: Makefile.PL$extlib
717 ", qq[\t\$(PERL) "-I\$(PERL_LIB)" -e 'use ExtUtils::Mksymlists; ],
718 'Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ',
719 neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\'
727 Defines the dynamic target.
732 # --- dynamic Loading Sections ---
738 install :: do_install_dynamic
740 install_dynamic :: do_install_dynamic
747 Defines the clean target.
752 # --- Cleanup and Distribution Sections ---
754 my($self, %attribs) = @_;
757 # Delete temporary files but do not touch installed files. We don\'t delete
758 # the Makefile here so a later make realclean still has a makefile to use.
762 # clean subdirectories first
763 for $dir (@{$self->{DIR}}) {
765 " Set OldEcho \{Echo\}
768 If \"\`Exists -f $self->{MAKEFILE}\`\" != \"\"
775 my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files
776 push(@otherfiles, patternify($attribs{FILES})) if $attribs{FILES};
777 push @m, "\t\$(RM_RF) @otherfiles\n";
778 # See realclean and ext/utils/make_ext for usage of Makefile.old
780 "\t\$(MV) $self->{MAKEFILE} $self->{MAKEFILE}.old\n");
782 "\t$attribs{POSTOP}\n") if $attribs{POSTOP};
788 Defines the realclean target.
793 my($self, %attribs) = @_;
796 # Delete temporary files (via clean) and also delete installed files
797 realclean purge :: clean
799 # realclean subdirectories first (already cleaned)
801 " Set OldEcho \{Echo\}
804 If \"\`Exists -f %s\`\" != \"\"
809 foreach(@{$self->{DIR}}){
810 push(@m, sprintf($sub,$_,"$self->{MAKEFILE}.old","-f $self->{MAKEFILE}.old"));
811 push(@m, sprintf($sub,$_,"$self->{MAKEFILE}",''));
813 my(@otherfiles) = ($self->{MAKEFILE},
814 "$self->{MAKEFILE}.old"); # Makefiles last
815 push(@otherfiles, patternify($attribs{FILES})) if $attribs{FILES};
816 push(@m, "\t\$(RM_RF) @otherfiles\n") if @otherfiles;
817 push(@m, "\t$attribs{POSTOP}\n") if $attribs{POSTOP};
828 install install_static install_dynamic ::
829 \t\$(MACPERL_SRC)PerlInstall -l \$(PERL_LIB)
831 .INCLUDE : \$(MACPERL_SRC)BulkBuildRules.mk
837 return $ExtUtils::MakeMaker::Version;
843 Defines targets to run *.PL files.
849 return "" unless $self->{PL_FILES};
851 foreach $plfile (sort keys %{$self->{PL_FILES}}) {
852 my $list = ref($self->{PL_FILES}->{$plfile})
853 ? $self->{PL_FILES}->{$plfile}
854 : [$self->{PL_FILES}->{$plfile}];
855 foreach $target (@$list) {
858 \t$self->{NOECHO}\$(NOOP)
861 \t\$(PERL) -I\$(MACPERL_LIB) -I\$(PERL_LIB) $plfile $target
868 sub _include { # for Unix-style includes, with -I instead of -i
870 require File::Spec::Unix;
872 # allow only relative paths
873 if (File::Spec::Unix->file_name_is_absolute($inc)) {
876 return '-i ' . macify($inc);