Subject: | subdirs Makefile section not generated properly |
In my WriteMakefile section I have a DIR instruction like this:
'DIR' => [ 'lib/SAPNW' ],
Generated subdirs Makefile section looks like this:
subdirs ::
$(NOECHO) cd lib/SAPNW
$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)
cd ..
cd lib/SAPNW is balanced by cd ..
for the build to work it should be ../..
In fact the build works, but it crashes in the test (tests failed for an
unknown reason)
I solved this adding the following to my Makefile.PL but that's not clean:
sub MY::subdirs {
my $self = shift;
my $section = $self->MM::subdirs;
if ($^O =~ /MSWin32/i) {
$section =~ s|(cd \.\.)(\s*$)|$1/..$2|m;
}
return $section;
}
On Linux this problem is not present as there is no cd instruction.
Cheers,
Olivier.