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);
21 use vars qw(%make_data);
23 my $Mac_FS = eval { require Mac::FileSpec::Unixish };
25 use ExtUtils::MakeMaker qw($Verbose &neatvalue);
29 ExtUtils::MM_MacOS - methods to override UN*X behaviour in ExtUtils::MakeMaker
33 use ExtUtils::MM_MacOS; # Done internally by ExtUtils::MakeMaker if needed
37 MM_MacOS currently only produces an approximation to the correct Makefile.
44 my($class,$self) = @_;
48 print STDOUT "Mac MakeMaker (v$ExtUtils::MakeMaker::VERSION)\n" if $Verbose;
49 if (-f "MANIFEST" && ! -f "Makefile.mk"){
50 ExtUtils::MakeMaker::check_manifest();
53 mkdir("Obj", 0777) unless -d "Obj";
55 $self = {} unless defined $self;
59 my(%initial_att) = %$self; # record initial attributes
61 if (defined $self->{CONFIGURE}) {
62 if (ref $self->{CONFIGURE} eq 'CODE') {
63 $self = { %$self, %{&{$self->{CONFIGURE}}}};
66 Carp::croak("Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n");
70 my $newclass = ++$ExtUtils::MakeMaker::PACKNAME;
71 local @ExtUtils::MakeMaker::Parent = @ExtUtils::MakeMaker::Parent; # Protect against non-local exits
74 print "Blessing Object into class [$newclass]\n" if $Verbose>=2;
75 ExtUtils::MakeMaker::mv_all_methods("MY",$newclass);
76 bless $self, $newclass;
79 @{"$newclass\:\:ISA"} = 'MM';
82 $ExtUtils::MakeMaker::Recognized_Att_Keys{$_} = 1
83 for map { $_ . 'Optimize' } qw(MWC MWCPPC MWC68K MPW MRC MRC SC);
85 if (defined $ExtUtils::MakeMaker::Parent[-2]){
86 $self->{PARENT} = $ExtUtils::MakeMaker::Parent[-2];
88 for $key (@ExtUtils::MakeMaker::Prepend_parent) {
89 next unless defined $self->{PARENT}{$key};
90 $self->{$key} = $self->{PARENT}{$key};
91 if ($key !~ /PERL$/) {
92 $self->{$key} = $self->catdir("..",$self->{$key})
93 unless $self->file_name_is_absolute($self->{$key});
95 # PERL or FULLPERL will be a command verb or even a
96 # command with an argument instead of a full file
97 # specification under VMS. So, don't turn the command
98 # into a filespec, but do add a level to the path of
99 # the argument if not already absolute.
100 my @cmd = split /\s+/, $self->{$key};
101 $cmd[1] = $self->catfile('[-]',$cmd[1])
102 unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]);
103 $self->{$key} = join(' ', @cmd);
106 if ($self->{PARENT}) {
107 $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
108 foreach my $opt (qw(POLLUTE PERL_CORE)) {
109 if (exists $self->{PARENT}->{$opt}
110 and not exists $self->{$opt})
112 # inherit, but only if already unspecified
113 $self->{$opt} = $self->{PARENT}->{$opt};
117 my @fm = grep /^FIRST_MAKEFILE=/, @ARGV;
118 $self->parse_args(@fm) if @fm;
120 $self->parse_args(split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV);
123 $self->{NAME} ||= $self->guess_name;
125 ($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g;
128 $self->init_dirscan();
129 $self->init_others();
131 push @{$self->{RESULT}}, <<END;
132 # This Makefile is for the $self->{NAME} extension to perl.
134 # It was generated automatically by MakeMaker version
135 # $ExtUtils::MakeMaker::VERSION (Revision: $ExtUtils::MakeMaker::Revision) from the contents of
136 # Makefile.PL. Don't edit this file, edit Makefile.PL instead.
138 # ANY CHANGES MADE HERE WILL BE LOST!
140 # MakeMaker Parameters:
143 foreach $key (sort keys %initial_att){
144 my($v) = neatvalue($initial_att{$key});
145 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
147 push @{$self->{RESULT}}, "# $key => $v";
150 # turn the SKIP array into a SKIPHASH hash
152 for $skip (@{$self->{SKIP} || []}) {
153 $self->{SKIPHASH}{$skip} = 1;
155 delete $self->{SKIP}; # free memory
157 # We skip many sections for MacOS, but we don't say anything about it in the Makefile
158 for (qw/ const_config tool_autosplit
159 tool_xsubpp tools_other dist macro depend post_constants
160 pasthru c_o xs_c xs_o top_targets linkext
161 dynamic_bs dynamic_lib static_lib manifypods
162 installbin subdirs dist_basics dist_core
163 distdir dist_test dist_ci install force perldepend makefile
164 staticmake test pm_to_blib selfdocument
165 const_loadlibs const_cccmd
168 $self->{SKIPHASH}{$_} = 2;
170 push @ExtUtils::MakeMaker::MM_Sections, "rulez"
171 unless grep /rulez/, @ExtUtils::MakeMaker::MM_Sections;
173 if ($self->{PARENT}) {
174 for (qw/install dist dist_basics dist_core distdir dist_test dist_ci/) {
175 $self->{SKIPHASH}{$_} = 1;
179 # We run all the subdirectories now. They don't have much to query
180 # from the parent, but the parent has to query them: if they need linking!
181 unless ($self->{NORECURS}) {
182 $self->eval_in_subdirs if @{$self->{DIR}};
186 foreach $section ( @ExtUtils::MakeMaker::MM_Sections ){
187 next if defined $self->{SKIPHASH}{$section} &&
188 $self->{SKIPHASH}{$section} == 2;
189 print "Processing Makefile '$section' section\n" if ($Verbose >= 2);
190 $self->{ABSTRACT_FROM} = macify($self->{ABSTRACT_FROM})
191 if $self->{ABSTRACT_FROM};
192 my($skipit) = $self->skipcheck($section);
194 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section $skipit.";
196 my(%a) = %{$self->{$section} || {}};
197 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section:";
198 push @{$self->{RESULT}}, "# " . join ", ", %a if $Verbose && %a;
199 push @{$self->{RESULT}}, $self->nicetext($self->$section( %a ));
203 push @{$self->{RESULT}}, "\n# End.";
206 $ExtUtils::MM_MacOS::make_data{$cwd} = $self;
213 return 'skipped' if $self->{SKIPHASH}{$section};
219 Returns true, if the argument is likely to be a command.
224 my($self,$file) = @_;
225 return $file if ! -d $file;
231 Guess the name of this package by examining the working directory's
232 name. MakeMaker calls this only if the developer has not supplied a
240 $name =~ s/.*:// unless ($name =~ s/^.*:ext://);
242 $name =~ s#[\-_][\d.\-]+$##; # this is new with MM 5.00
248 Translate relative Unix filepaths into Mac names.
256 foreach (split(/[ \t\n]+/, $unix)) {
258 if ($Mac_FS) { # should always be true
259 $_ = Mac::FileSpec::Unixish::nativize($_);
274 Translate Unix filepaths and shell globs to Mac style.
282 foreach (split(/[ \t\n]+/, $unix)) {
287 $_ = "'$_'" if /[?Å]/;
297 Initializes some of NAME, FULLEXT, BASEEXT, DLBASE, PERL_SRC,
298 PERL_LIB, PERL_ARCHLIB, PERL_INC, INSTALLDIRS, INST_*, INSTALL*,
299 PREFIX, CONFIG, AR, AR_STATIC_ARGS, LD, OBJ_EXT, LIB_EXT, MAP_TARGET,
300 LIBPERL_A, VERSION_FROM, VERSION, DISTNAME, VERSION_SYM.
307 # --- Initialize Module Name and Paths
309 # NAME = The perl module name for this extension (eg DBD::Oracle).
310 # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
311 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
313 $self->{NAME}) =~ s!::!:!g ; #eg. BSD:Foo:Socket
315 $self->{NAME}) =~ s!.*::!! ; #eg. Socket
317 # --- Initialize PERL_LIB, INST_LIB, PERL_SRC
319 # *Real* information: where did we get these two from? ...
320 my $inc_config_dir = dirname($INC{'Config.pm'});
321 my $inc_carp_dir = dirname($INC{'Carp.pm'});
323 unless ($self->{PERL_SRC}){
325 foreach $dir (qw(:: ::: :::: ::::: ::::::)){
326 if (-f "${dir}perl.h") {
327 $self->{PERL_SRC}=$dir ;
331 if (!$self->{PERL_SRC} && -f "$ENV{MACPERL}CORE:perl:perl.h") {
332 # Mac pathnames may be very nasty, so we'll install symlinks
333 unlink(":PerlCore", ":PerlLib");
334 symlink("$ENV{MACPERL}CORE:", "PerlCore");
335 symlink("$ENV{MACPERL}lib:", "PerlLib");
336 $self->{PERL_SRC} = ":PerlCore:perl:" ;
337 $self->{PERL_LIB} = ":PerlLib:";
340 if ($self->{PERL_SRC}){
341 $self->{PERL_LIB} ||= $self->catdir("$self->{PERL_SRC}","lib");
342 $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
343 $self->{PERL_INC} = $self->{PERL_SRC};
346 $self->{PERL_LIB} ||= "$ENV{MACPERL}site_perl";
347 $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
348 $self->{PERL_INC} = $ENV{MACPERL};
349 $self->{PERL_SRC} = '';
352 $self->{INSTALLDIRS} = "perl";
353 $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB};
354 $self->{INST_MAN1DIR} = $self->{INSTALLMAN1DIR} = "none";
355 $self->{MAN1EXT} ||= $Config::Config{man1ext};
356 $self->{INST_MAN3DIR} = $self->{INSTALLMAN3DIR} = "none";
357 $self->{MAN3EXT} ||= $Config::Config{man3ext};
358 $self->{MAP_TARGET} ||= "perl";
360 # make a simple check if we find Exporter
361 # hm ... do we really care? at all?
362 # warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory
363 # (Exporter.pm not found)"
364 # unless -f $self->catfile("$self->{PERL_LIB}","Exporter.pm") ||
365 # $self->{NAME} eq "ExtUtils::MakeMaker";
367 # Determine VERSION and VERSION_FROM
368 ($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME};
369 if ($self->{VERSION_FROM}){
370 # XXX replace with parse_version() override
372 open(FH,macify($self->{VERSION_FROM})) or
373 die "Could not open '$self->{VERSION_FROM}' (attribute VERSION_FROM): $!";
376 next unless /\$([\w:]*\bVERSION)\b.*=/;
377 local $ExtUtils::MakeMaker::module_version_variable = $1;
380 die "Could not eval '$eval': $@" if $@;
381 if ($self->{VERSION} = $ {$ExtUtils::MakeMaker::module_version_variable}){
382 print "$self->{NAME} VERSION is $self->{VERSION} (from $self->{VERSION_FROM})\n" if $Verbose;
384 # XXX this should probably croak
385 print "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n";
392 if ($self->{VERSION}) {
393 $self->{VERSION} =~ s/^\s+//;
394 $self->{VERSION} =~ s/\s+$//;
397 $self->{VERSION} = "0.10" unless $self->{VERSION};
398 ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g;
401 # Graham Barr and Paul Marquess had some ideas how to ensure
402 # version compatibility between the *.pm file and the
403 # corresponding *.xs file. The bottomline was, that we need an
404 # XS_VERSION macro that defaults to VERSION:
405 $self->{XS_VERSION} ||= $self->{VERSION};
408 $self->{DEFINE} .= " \$(XS_DEFINE_VERSION) \$(DEFINE_VERSION)";
410 # Preprocessor definitions may be useful
411 $self->{DEFINE} =~ s/-D/-d /g;
413 # UN*X includes probably are not useful
414 $self->{DEFINE} =~ s/-I\S+/_include($1)/eg;
418 # UN*X includes probably are not useful
419 $self->{INC} =~ s/-I(\S+)/_include($1)/eg;
423 # --- Initialize Perl Binary Locations
425 # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
426 # will be working versions of perl 5. miniperl has priority over perl
427 # for PERL to ensure that $(PERL) is usable while building ./ext/*
428 my ($component,@defpath);
429 foreach $component ($self->{PERL_SRC}, $self->path(), $Config::Config{binexp}) {
430 push @defpath, $component if defined $component;
432 $self->{PERL} = "$self->{PERL_SRC}miniperl";
437 Initializes LDLOADLIBS, LIBS
441 sub init_others { # --- Initialize Other Attributes
444 if ( !$self->{OBJECT} ) {
445 # init_dirscan should have found out, if we have C files
446 $self->{OBJECT} = "";
447 $self->{OBJECT} = "$self->{BASEEXT}.c" if @{$self->{C}||[]};
449 $self->{OBJECT} =~ s/\$\(O_FILES\)/@{$self->{C}||[]}/;
452 foreach (split(/[ \t\n]+/, $self->{OBJECT})) {
453 if (/^$self->{BASEEXT}\.o(bj)?$/) {
454 $src .= " $self->{BASEEXT}.c";
455 } elsif (/^(.*\..*)\.o$/) {
457 } elsif (/^(.*)(\.o(bj)?|\$\(OBJ_EXT\))$/) {
467 $self->{SOURCE} = $src;
468 $self->{FULLPERL} = "$self->{PERL_SRC}perl";
469 $self->{MAKEFILE} = "Makefile.mk";
470 $self->{FIRST_MAKEFILE} = $self->{MAKEFILE};
471 $self->{MAKEFILE_OLD} = $self->{MAKEFILE}.'.old';
473 $self->{'DEV_NULL'} ||= ' \xB3 Dev:Null';
480 Add MACPERL_SRC MACPERL_LIB
482 =item platform_constants
484 Add MACPERL_SRC MACPERL_LIB MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC
485 MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED
487 XXX Few are initialized. How many of these are ever used?
494 $self->{MACPERL_SRC} = $self->catdir("$self->{PERL_SRC}","macos:");
495 $self->{MACPERL_LIB} ||= $self->catdir("$self->{MACPERL_SRC}","lib");
496 $self->{MACPERL_INC} = $self->{MACPERL_SRC};
501 sub platform_constants {
504 foreach my $macro (qw(MACPERL_SRC MACPERL_LIB MACLIBS_68K MACLIBS_PPC
505 MACLIBS_SC MACLIBS_MRC MACLIBS_ALL_68K
506 MACLIBS_ALL_PPC MACLIBS_SHARED))
508 next unless defined $self->{$macro};
509 $make_frag .= "$macro = $self->{$macro}\n";
518 Initializes DIR, XS, PM, C, O_FILES, H, PL_FILES, MAN*PODS, EXE_FILES.
522 sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
524 my($name, %dir, %xs, %c, %h, %ignore, %pl_files, %manifypods);
525 local(%pm); #the sub in find() has to see this hash
527 # in case we don't find it below!
528 if ($self->{VERSION_FROM}) {
529 my $version_from = macify($self->{VERSION_FROM});
530 $pm{$version_from} = $self->catfile('$(INST_LIBDIR)',
534 $ignore{'test.pl'} = 1;
535 foreach $name ($self->lsdir(":")){
536 next if ($name =~ /^\./ or $ignore{$name});
537 next unless $self->libscan($name);
539 $dir{$name} = $name if (-f ":$name:Makefile.PL");
540 } elsif ($name =~ /\.xs$/){
541 my($c); ($c = $name) =~ s/\.xs$/.c/;
544 } elsif ($name =~ /\.c(p|pp|xx|c)?$/i){ # .c .C .cpp .cxx .cc .cp
546 unless $name =~ m/perlmain\.c/; # See MAP_TARGET
547 } elsif ($name =~ /\.h$/i){
549 } elsif ($name =~ /\.(p[ml]|pod)$/){
550 $pm{$name} = $self->catfile('$(INST_LIBDIR)',$name);
551 } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
552 ($pl_files{$name} = $name) =~ s/\.PL$// ;
556 # Some larger extensions often wish to install a number of *.pm/pl
557 # files into the library in various locations.
559 # The attribute PMLIBDIRS holds an array reference which lists
560 # subdirectories which we should search for library files to
561 # install. PMLIBDIRS defaults to [ 'lib', $self->{BASEEXT} ]. We
562 # recursively search through the named directories (skipping any
563 # which don't exist or contain Makefile.PL files).
565 # For each *.pm or *.pl file found $self->libscan() is called with
566 # the default installation path in $_[1]. The return value of
567 # libscan defines the actual installation location. The default
568 # libscan function simply returns the path. The file is skipped
569 # if libscan returns false.
571 # The default installation location passed to libscan in $_[1] is:
573 # ./*.pm => $(INST_LIBDIR)/*.pm
574 # ./xyz/... => $(INST_LIBDIR)/xyz/...
575 # ./lib/... => $(INST_LIB)/...
577 # In this way the 'lib' directory is seen as the root of the actual
578 # perl library whereas the others are relative to INST_LIBDIR
579 # This is a subtle distinction but one that's important for nested
582 $self->{PMLIBDIRS} = ['lib', $self->{BASEEXT}]
583 unless $self->{PMLIBDIRS};
585 #only existing directories that aren't in $dir are allowed
587 my (@pmlibdirs) = map { macify ($_) } @{$self->{PMLIBDIRS}};
589 @{$self->{PMLIBDIRS}} = ();
590 foreach $pmlibdir (@pmlibdirs) {
591 -d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir;
594 if (@{$self->{PMLIBDIRS}}){
595 print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
598 File::Find::find(sub {
600 unless ($self->libscan($_)){
601 $File::Find::prune = 1;
605 my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)');
606 my($striplibpath,$striplibname);
607 $prefix = '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:);
608 ($striplibname,$striplibpath) = fileparse($striplibpath);
609 my($inst) = $self->catfile($prefix,$striplibpath,$striplibname);
610 local($_) = $inst; # for backwards compatibility
611 $inst = $self->libscan($inst);
612 print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
615 }, @{$self->{PMLIBDIRS}});
618 $self->{DIR} = [sort keys %dir] unless $self->{DIR};
619 $self->{XS} = \%xs unless $self->{XS};
620 $self->{PM} = \%pm unless $self->{PM};
621 $self->{C} = [sort keys %c] unless $self->{C};
622 $self->{H} = [sort keys %h] unless $self->{H};
623 $self->{PL_FILES} = \%pl_files unless $self->{PL_FILES};
625 # Set up names of manual pages to generate from pods
626 unless ($self->{MAN1PODS}) {
627 $self->{MAN1PODS} = {};
629 unless ($self->{MAN3PODS}) {
630 $self->{MAN3PODS} = {};
635 =item init_VERSION (o)
637 Change DEFINE_VERSION and XS_DEFINE_VERSION
644 $self->SUPER::init_VERSION;
646 $self->{DEFINE_VERSION} = '-d $(VERSION_MACRO)="¶"$(VERSION)¶""';
647 $self->{XS_DEFINE_VERSION} = '-d $(XS_VERSION_MACRO)="¶"$(XS_VERSION)¶""';
651 =item special_targets (o)
657 sub special_targets {
660 my $make_frag = $self->SUPER::special_targets;
662 return $make_frag . <<'MAKE_FRAG';
663 .INCLUDE : $(MACPERL_SRC)BuildRules.mk $(MACPERL_SRC)ExtBuildRules.mk
671 Defines the static target.
676 # --- Static Loading Sections ---
679 my($extlib) = $self->{MYEXTLIB} ? "\nstatic :: myextlib\n" : "";
683 install :: do_install_static
685 install_static :: do_install_static
691 Used by MacOS to define DL_FUNCS and DL_VARS and write the *.exp
697 my($self,%attribs) = @_;
699 return '' unless !$self->{SKIPHASH}{'dynamic'};
701 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
702 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
706 dynamic :: $self->{BASEEXT}.exp
708 ") unless $self->{SKIPHASH}{'dynamic'};
710 my($extlib) = $self->{MYEXTLIB} ? " myextlib" : "";
713 $self->{BASEEXT}.exp: Makefile.PL$extlib
714 ", qq[\t\$(PERL) "-I\$(PERL_LIB)" -e 'use ExtUtils::Mksymlists; ],
715 'Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ',
716 neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\'
724 Defines the dynamic target.
729 # --- dynamic Loading Sections ---
735 install :: do_install_dynamic
737 install_dynamic :: do_install_dynamic
744 Defines the clean target.
749 # --- Cleanup and Distribution Sections ---
751 my($self, %attribs) = @_;
754 # Delete temporary files but do not touch installed files. We don\'t delete
755 # the Makefile here so a later make realclean still has a makefile to use.
757 clean :: clean_subdirs
760 my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files
761 push(@otherfiles, patternify($attribs{FILES})) if $attribs{FILES};
762 push @m, "\t\$(RM_RF) @otherfiles\n";
763 # See realclean and ext/utils/make_ext for usage of Makefile.old
765 "\t\$(MV) \$(FIRST_MAKEFILE) \$(MAKEFILE_OLD)\n");
767 "\t$attribs{POSTOP}\n") if $attribs{POSTOP};
771 =item clean_subdirs_target
773 MacOS semantics for changing directories and checking for existence
774 very different than everyone else.
778 sub clean_subdirs_target {
781 # No subdirectories, no cleaning.
782 return <<'NOOP_FRAG' unless @{$self->{DIR}};
788 my $clean = "clean_subdirs :\n";
790 for my $dir (@{$self->{DIR}}) {
791 $clean .= sprintf <<'MAKE_FRAG', $dir;
795 If "`Exists -f $(FIRST_MAKEFILE)`" != ""
809 Defines the realclean target.
814 my($self, %attribs) = @_;
817 # Delete temporary files (via clean) and also delete installed files
818 realclean purge :: clean
821 my(@otherfiles) = ('$(FIRST_MAKEFILE)', '$(MAKEFILE_OLD)'); # Makefiles last
822 push(@otherfiles, patternify($attribs{FILES})) if $attribs{FILES};
823 push(@m, "\t\$(RM_RF) @otherfiles\n") if @otherfiles;
824 push(@m, "\t$attribs{POSTOP}\n") if $attribs{POSTOP};
829 =item realclean_subdirs_target
831 MacOS semantics for changing directories and checking for existence
832 very different than everyone else.
836 sub realclean_subdirs_target {
839 return <<'NOOP_FRAG' unless @{$self->{DIR}};
844 my $rclean = "realclean_subdirs :\n";
846 foreach my $dir (@{$self->{DIR}}){
847 $rclean .= sprintf <<'RCLEAN', $dir,
851 If \"\`Exists -f $(FIRST_MAKEFILE)\`\" != \"\"
871 install install_static install_dynamic ::
872 \t\$(MACPERL_SRC)PerlInstall -l \$(PERL_LIB)
874 .INCLUDE : \$(MACPERL_SRC)BulkBuildRules.mk
880 return $ExtUtils::MakeMaker::Version;
886 Defines targets to run *.PL files.
892 return "" unless $self->{PL_FILES};
894 foreach $plfile (sort keys %{$self->{PL_FILES}}) {
895 my $list = ref($self->{PL_FILES}->{$plfile})
896 ? $self->{PL_FILES}->{$plfile}
897 : [$self->{PL_FILES}->{$plfile}];
898 foreach $target (@$list) {
904 \t\$(PERL) -I\$(MACPERL_LIB) -I\$(PERL_LIB) $plfile $target
912 my($self,$libperl) = @_;
915 for (map { $_ . "Optimize" } qw(MWC MWCPPC MWC68K MPW MRC MRC SC)) {
916 $optimize .= "$_ = $self->{$_}" if exists $self->{$_};
919 return $self->{CFLAGS} = $optimize;
923 sub _include { # for Unix-style includes, with -I instead of -i
925 require File::Spec::Unix;
927 # allow only relative paths
928 if (File::Spec::Unix->file_name_is_absolute($inc)) {
931 return '-i ' . macify($inc);
937 MacOS Classic is MacOS and MacOS Classic.
942 return('MacOS', 'MacOS Classic');