From: Nick Ing-Simmons Date: Sun, 14 Dec 1997 15:04:36 +0000 (+0000) Subject: Ilya's MakeMaker (empty makefile) patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b171b8dc5d8ea8bdfc47634b7dd4589627bd142;p=p5sagit%2Fp5-mst-13.2.git Ilya's MakeMaker (empty makefile) patch p4raw-id: //depot/ansiperl@364 --- diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 5511e3d..64f493a 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -537,6 +537,29 @@ END $self; } +sub WriteEmptyMakefile { + if (-f 'Makefile.old') { + chmod 0666, 'Makefile.old'; + unlink 'Makefile.old' or warn "unlink Makefile.old: $!"; + } + rename 'Makefile', 'Makefile.old' or warn "rename Makefile Makefile.old: $!" + if -f 'Makefile'; + open MF, '> Makefile' or die "open Makefile for write: $!"; + print MF, <<'EOP'; +all: + +clean: + +install: + +makemakerdflt: + +test: + +EOP + close MF or die "close Makefile for write: $!"; +} + sub check_manifest { print STDOUT "Checking if your kit is complete...\n"; require ExtUtils::Manifest; @@ -1858,6 +1881,23 @@ An example: WriteMakefile( 'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" }) +=head2 Disabling an extension + +If some events detected in F imply that there is no way +to create the Module, but this is a normal state of things, then you +can create a F which does nothing, but succeeds on all the +"usual" build targets. To do so, use + + ExtUtils::MakeMaker::WriteEmptyMakefile(); + +instead of WriteMakefile(). + +This may be useful if other modules expect this module to be I +OK, as opposed to I OK (say, this system-dependent module builds +in a subdirectory of some other distribution, or is listed as a +dependency in a CPAN::Bundle, but the functionality is supported by +different means on the current architecture). + =head1 SEE ALSO ExtUtils::MM_Unix, ExtUtils::Manifest, ExtUtils::testlib,