How do I disable a make target with the perl MakeMaker module?

163 Views Asked by At

I'm using ExtUtils::MakeMaker to package my perl module but I don't want the makefile to copy files anywhere on the system. I need to disable the "install" target and instead tell the user that this makefile only supports "make dist" when he types "make install".

1

There are 1 best solutions below

2
mob On

Define MY::install in your Makefile.PL file:

sub MY::install {
    "install ::\n\techo You should run \\'make dist\\', not \\'make install\\'"
}

The function should return the text you want to use to replace the install section of the Makefile.

You could make make install a synonym for make dist with:

sub MY::install [ "install :: dist\n" }

Doc: Overriding MakeMaker methods