2
votes

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
Just curious: Why not let the user run make install if they want to? Otherwise, how would they use your modules you're producing? - David W.
Because the application is dependent on several system administration choices like "Which database backend am I going to use", etc. and just copying the modules to any directory on the system makes no real sense. I'm just offering the Makefile.PL as a helper module for Linux distributions modules packagers. - Michal T

1 Answers

1
votes

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