diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-12-14 15:04:36 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-12-14 15:04:36 +0000 |
commit | 1b171b8dc5d8ea8bdfc47634b7dd4589627bd142 (patch) | |
tree | a144e57ede6e68f695e444243682263a9f4fcfce /lib | |
parent | 66b137745032b6c5be24e280869baaa693e4c556 (diff) | |
download | perl-1b171b8dc5d8ea8bdfc47634b7dd4589627bd142.tar.gz |
Ilya's MakeMaker (empty makefile) patch
p4raw-id: //depot/ansiperl@364
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ExtUtils/MakeMaker.pm | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 5511e3d1e4..64f493a851 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<Makefile.PL> imply that there is no way +to create the Module, but this is a normal state of things, then you +can create a F<Makefile> 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<built> +OK, as opposed to I<work> 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, |