tj_thompson has asked for the wisdom of the Perl Monks concerning the following question:
First off, I'm a make/build newbie with only basic experience in the area, so if some of this is obvious I apologize. I have tried to search here prior to asking and have read into MakeMaker and Module::Build documentation.
I have a project made of multiple modules. I'd like them all to be build from the upper most make/build file, but I haven't been able to figure out how to do that.
I've used ExtUtils::ModuleMaker to create the initial project skeleton. I've also checked out h2xs. I've noticed they create the base directory structure differently.
For example, assume I'm working on a module Foo, and a module Foo::Bar required by Foo all located in my 'project' directory. If I use h2xs to start both modules, I end up with a project/Foo/ directory and a project/Foo-Bar/ directory that are independent of each other. Modulemaker on the other hand creates a project/Foo/ directory (containing Changes, MANIFEST, t, lib, etc) and then a project/Foo/Bar directory (also with its own t, lib, etc.)for the second module, tying the second module into the first. Is one of these preferred over the other? The modules are being co-developed and Foo must have Foo::Bar to work.
Next question: I would like to build both modules from the uppermost Foo build file as Foo::Bar is really just a sub part of that module. I've checked out MakeMaker and Module::Build documentation, and I can see how to declare the Foo::Bar module as a prereq, but not how to actually tell it to go build the other module.
So from a methodology standpoint, should I have one make file for Foo that handles both modules; two make files with the Foo makefile executing the Foo::Bar makefile; or two completely independent files that must both be make, test, installed? The second seems like the right way to do it.
Finally, how do you ensure the Foo::Bar makefile is executed from the Foo makefile? I'd be interested in how this is done from a Makefile.PL as well as a Build.PL file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Building a multi module project
by Corion (Patriarch) on Jan 21, 2011 at 19:25 UTC | |
by tj_thompson (Monk) on Jan 21, 2011 at 20:04 UTC | |
|
Re: Building a multi module project
by tj_thompson (Monk) on Jan 21, 2011 at 19:27 UTC |