Problems with SKIP in makemaker
authorIlya Zakharevich <ilya@math.ohio-state.edu>
Fri, 21 Mar 1997 04:13:31 +0000 (23:13 -0500)
committerChip Salzenberg <chip@atlantic.net>
Sat, 8 Mar 1997 23:57:19 +0000 (11:57 +1200)
The example in perlxstut (which I created with a lot of pain) works by
coincidence only:

It has

WriteMakefile(
    NAME      => 'Mytest2::mylib',
    SKIP      => [qw(all static static_lib dynamic dynamic_lib)],
    clean     => {'FILES' => 'libmylib$(LIB_EXT)'},
);

sub MY::top_targets {
'
all :: static

static ::       libmylib$(LIB_EXT)

libmylib$(LIB_EXT): $(O_FILES)
$(AR) cr libmylib$(LIB_EXT) $(O_FILES)
$(RANLIB) libmylib$(LIB_EXT)

';
}

and work only because $self->MM::top_targets is not called. The reason is
that 'all' chunk is written anyway not depending on the value of SKIPHASH.

In my eText package I do $self->MM::top_targets inside
MY::top_targets, and this bombs.

Patch follows (only for 'all', I did not check any other target):

(The alternative is to patch perlxstut, but this may break some other
programs, not only mine...)

Enjoy,

p5p-msgid: 199703210413.XAA21601@monk.mps.ohio-state.edu

lib/ExtUtils/MM_Unix.pm

index 465a075..0b54a7e 100644 (file)
@@ -3110,10 +3110,15 @@ sub top_targets {
     my(@m);
     push @m, '
 #all ::        config $(INST_PM) subdirs linkext manifypods
+';
 
+    push @m, '
 all :: pure_all manifypods
        '.$self->{NOECHO}.'$(NOOP)
-
+' 
+         unless $self->{SKIPHASH}{'all'};
+    
+    push @m, '
 pure_all :: config pm_to_blib subdirs linkext
        '.$self->{NOECHO}.'$(NOOP)