Tom
Tom

Reputation: 7223

Makefile.PL: Installing multiple scripts and binaries

Given a Makefile.PL, how can I install two binaries and two scripts in four different locations?

To be more precise, the directory structure is as follows:

The files marked with (*) should be installed in the following paths:

and the contents of my Makefile.PL

use ExtUtils::MakeMaker;

WriteMakefile(
    NAME         => "my_package",
    VERSION_FROM => "lib/my_package/main.pl"
);

What do I tell perl through the Makefile.PL to make it install those four files in their corresponding directories?

Upvotes: 4

Views: 1188

Answers (2)

Lee Goddard
Lee Goddard

Reputation: 11173

Two ideas from the ExtUtils::MakeMaker documentation:

Use the PL_FILES parameter. To paraphrase the documentation: PL_FILES => {'bin/install.PL' => 'an-arg'} would run bin/foobar.PL as perl bin/installPL an-arg

Or have MakeMaker add a new target to the generated makefile using the postamble feature.

Or, yes, Module::Install or Dist::Zilla (there's probably yet another Perl module to do it since I last looked, lively little language that it is).

Upvotes: 1

daxim
daxim

Reputation: 39158

If you switch to Module::Build, you can simply use install_path.

Upvotes: 0

Related Questions