Re: [Module-build-general] Module::Build 0.18_02 FAIL on Windows nmake
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2003-06-09 16:24:15
|
Hi Andrew, nice to hear from you again. On Sunday, June 8, 2003, at 09:15 PM, Andrew Savige wrote: > I tried installing Module::Build 0.18_02 on Windows XP, via: > perl Makefile.PL > nmake > nmake test > nmake install > but, alas, the "nmake test" step failed with: > "Don't know how to to make test" > It seems that Windows NMAKE does not like .DEFAULT very much (?). > Please bear in mind that I am a bit of a make ignoramus. I am too, unfortunately. It might just be that the $@ variable needs to be written as $(@) though - does that help? (See below.) > > There is another problem: the Module::Build distribution contains a > file INSTALL, yet Windows is case insensitive, so a target of > install : > says, annoyingly, "'install' is up-to-date" when you try a > 'nmake install'. Curiously, using a target of: > install :: > seems to fix this, but I don't understand why (explanations and > alternative workarounds welcome). One workaround is just to move the INSTALL file to INSTALL.txt. I've just done that in CVS. It should probably be addressed in the code too though, to help other people with files called 'INSTALL'. > > Anyway, I was able to get it to work on both Windows and Linux by > adding the following 4 lines to sub fake_makefile in Compat.pm, > right after the 'all' target: > > test :: > $^X $build test > install :: > $^X $build install Hmm, this was supposed to be addressed by the .PHONY line. According to http://www.bell-labs.com/project/nmake/faq/gmake.html , maybe we can just use .VIRTUAL when $Config{make} eq 'nmake'. Unfortunately that URL doesn't say anything about .DEFAULT, but it does say that all variables need parentheses in nmake Makefiles. What if you apply the patch below? -Ken --- lib/Module/Build/Compat.pm 15 May 2003 21:28:32 -0000 1.23 +++ lib/Module/Build/Compat.pm 9 Jun 2003 16:12:39 -0000 @@ -115,6 +115,7 @@ sub fake_makefile { my $makefile = $_[1]; my $build = File::Spec->catfile( '.', 'Build' ); + my $phony = $Config{make} =~ /nmake/ ? '.VIRTUAL' : '.PHONY'; return <<"EOF"; all : @@ -123,8 +124,8 @@ $^X $build realclean $^X -e unlink -e shift $makefile .DEFAULT : - $^X $build \$@ -.PHONY : install manifest + $^X $build \$(\@) +$phony : install manifest EOF } |