Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
renaming pdlpp_genpm to pdlpp_mkgen
  • Loading branch information
kmx committed Feb 9, 2015
1 parent 4cbbd74 commit 0762095
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions Basic/Core/Dev.pm
Expand Up @@ -34,7 +34,7 @@ use English; require Exporter;
pdlpp_postamble_int pdlpp_stdargs_int
pdlpp_postamble pdlpp_stdargs write_dummy_make
unsupported getcyglib trylink
pdlpp_genpm
pdlpp_mkgen
);

# Installation locations
Expand Down Expand Up @@ -454,25 +454,25 @@ sub pdlpp_stdargs {
'INC' => &PDL_INST_INCLUDE()." $inc",
'LIBS' => $libs ? ["$libs "] : [],
'clean' => {'FILES' => "$pref.xs $pref.pm $pref\$(OBJ_EXT) $pref.c"},
'dist' => {'PREOP' => '$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -MPDL::Core::Dev -e pdlpp_genpm $(DISTVNAME)' },
'dist' => {'PREOP' => '$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -MPDL::Core::Dev -e pdlpp_mkgen $(DISTVNAME)' },
(eval ($ExtUtils::MakeMaker::VERSION) >= 6.57_02 ? ('NO_MYMETA' => 1) : ()),
);
}

# pdlpp_genpm($dir)
# pdlpp_mkgen($dir)
# - scans $dir/MANIFEST for all *.pd files and creates corresponding *.pm files
# in $dir/GENERATED/ subdir; needed for proper doc rendering at metacpan.org
# - it is used in Makefile.PL like:
# dist => { PREOP=>'$(PERL) -MPDL::Core::Dev -e pdlpp_genpm $(DISTVNAME)' }
# dist => { PREOP=>'$(PERL) -MPDL::Core::Dev -e pdlpp_mkgen $(DISTVNAME)' }
# so all the magic *.pm generation happens during "make dist"
# - it is intended to be called as a one-liner:
# perl -MPDL::Core::Dev -e pdlpp_genpm DirName
# perl -MPDL::Core::Dev -e pdlpp_mkgen DirName
#
sub pdlpp_genpm {
sub pdlpp_mkgen {
my $dir = @_ > 0 ? $_[0] : $ARGV[0];
die "pdlpp_genpm: unspecified directory" unless defined $dir && -d $dir;
die "pdlpp_mkgen: unspecified directory" unless defined $dir && -d $dir;
my $file = "$dir/MANIFEST";
die "pdlpp_genpm: non-existing '$dir/MANIFEST'" unless -f $file;
die "pdlpp_mkgen: non-existing '$dir/MANIFEST'" unless -f $file;

my @pairs = ();
my $manifest = ExtUtils::Manifest::maniread($file);
Expand All @@ -485,7 +485,7 @@ sub pdlpp_genpm {
push @pairs, [$_, $1];
}
else {
warn "pdlpp_genpm: unknown module name for '$_' (use proper '=head1 NAME' section)\n";
warn "pdlpp_mkgen: unknown module name for '$_' (use proper '=head1 NAME' section)\n";
}
}

Expand All @@ -500,11 +500,11 @@ sub pdlpp_genpm {
my @in = map { "-I$_" } @INC;
my $rv = system($^X, @in, "-MPDL::PP qw[$mod $mod $prefix]", $pd);
if ($rv == 0 && -f "$prefix.pm") {
$added{$manifestpm} = "mod=$mod pd=$pd (added by pdlpp_genpm)";
$added{$manifestpm} = "mod=$mod pd=$pd (added by pdlpp_mkgen)";
unlink "$prefix.xs"; #we need only .pm
}
else {
warn "pdlpp_genpm: cannot convert '$pd'\n";
warn "pdlpp_mkgen: cannot convert '$pd'\n";
}
}

Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Expand Up @@ -484,7 +484,7 @@ if($Config{archname}=~m/x86_64/) {
}

# create GENERATED subdir with *.pm files during 'make dist' (to make metacpan.org happy)
my $preop = '$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -MPDL::Core::Dev -e pdlpp_genpm $(DISTVNAME)';
my $preop = '$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -MPDL::Core::Dev -e pdlpp_mkgen $(DISTVNAME)';
$preop .= q[ && git log --stat --since='29 Apr 2009' > Changes.new && $(MV) Changes.new $(DISTVNAME)/Changes] if $^O ne 'MSWin32';

if (-f 'pdl.c') {
Expand Down

0 comments on commit 0762095

Please sign in to comment.