Skip to content

Commit

Permalink
Make "core" target be generated by separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 authored and devel-chm committed Jan 14, 2017
1 parent ad3e781 commit 590e235
Showing 1 changed file with 32 additions and 25 deletions.
57 changes: 32 additions & 25 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -609,34 +609,10 @@ ppm : doctest ppd
$(RM_RF) $(DISTWIN32NAME)
EOT

my $basic_pmblib = $self->cd('Basic', "\$(MAKE) pm_to_blib");
my $niceslice_pmblib = $self->cd(File::Spec->catdir(qw(Basic SourceFilter)), "\$(MAKE) pm_to_blib");
# the modules in PDL::LiteF, used in t/core.t
my @buildchunks = $self->cd(File::Spec->catdir(qw(Basic Gen)), "\$(MAKE)");
# this contortion is due to an intermittent failure of "cd;make" to
# actually build the SO in blib with gmake -j4, which doesn't happen if
# give actual path. E.g. in Core it often doesn't build pdlcore.o and
# sometimes not Core.o, then just stops and indicates success
my $up_blib = File::Spec->catdir((File::Spec->updir) x 2, qw(blib arch auto PDL));
push @buildchunks,
map $self->cd(
File::Spec->catdir(qw(Basic), $_),
"\$(MAKE) pm_to_blib " . File::Spec->catfile($up_blib, $_, "$_.\$(DLEXT)")
),
qw(Core Ops Primitive Ufunc Slices Bad Math MatrixOps);
my $basicbuild = join "\n\t", @buildchunks;
$text .= ::coretarget($self);
my $coretest = join ' ', map File::Spec->catfile('t', $_), qw(core.t ops.t);
# looking forward to EUMM better supporting parallel builds in subdirs:
# Core deps on Gen Ops Primitive Ufunc Slices Bad
# Primitive deps on Math
# Math deps on MatrixOps
$text .= <<EOF;
core :
$basic_pmblib
$niceslice_pmblib
$basicbuild
coretest : core
prove -b $coretest
EOF
Expand All @@ -645,6 +621,37 @@ return $text

}

sub coretarget {
my ($self) = @_;
my $basic_pmblib = $self->cd('Basic', "\$(MAKE) pm_to_blib");
my $niceslice_pmblib = $self->cd(File::Spec->catdir(qw(Basic SourceFilter)), "\$(MAKE) pm_to_blib");
# the modules in PDL::LiteF, used in t/core.t
my @buildchunks = $self->cd(File::Spec->catdir(qw(Basic Gen)), "\$(MAKE)");
# this contortion is due to an intermittent failure of "cd;make" to
# actually build the SO in blib with gmake -j4, which doesn't happen if
# give actual path. E.g. in Core it often doesn't build pdlcore.o and
# sometimes not Core.o, then just stops and indicates success
my $up_blib = File::Spec->catdir((File::Spec->updir) x 2, qw(blib arch auto PDL));
push @buildchunks,
map $self->cd(
File::Spec->catdir(qw(Basic), $_),
"\$(MAKE) pm_to_blib " . File::Spec->catfile($up_blib, $_, "$_.\$(DLEXT)")
),
qw(Core Ops Primitive Ufunc Slices Bad Math MatrixOps);
my $basicbuild = join "\n\t", @buildchunks;
# looking forward to EUMM better supporting parallel builds in subdirs:
# Core deps on Gen Ops Primitive Ufunc Slices Bad
# Primitive deps on Math
# Math deps on MatrixOps
<<EOF;
core :
\t$basic_pmblib
\t$niceslice_pmblib
\t$basicbuild
EOF
}

# remove pdl.c from making EUMM think this dir has XS in it
sub MY::init_dirscan {
package MY;
Expand Down

0 comments on commit 590e235

Please sign in to comment.