This is brilliant - 
All I had to do was create a sub directory for each module and make sure the MANIFEST 
file in the root directory knew about the Makefile.PL in each subdirectory.
./testa
./testa/MANIFEST
./testa/testa.pm <- actually test::testa
./testa/Makefile.PL
./testa/test.pl
./testb
./testb/testb.pm <- actually test::testb
./testb/Makefile.PL
./testb/MANIFEST
./testb/test.pl
./Makefile.PL
./MANIFEST <- knows about all the  files in the subdirectories
./test.pl
./test.pm <- actually test::test and has reference to test::testa, and test ::testb

they all get built into the same lib directory, and can then "test" together too.

The actual name of the sub-directories don't have to have anything to do with the 
module hierarchy that is held within.

This is probably exactly what you meant below - thanks!

Great!.

Cheers.


On Mon, Sep 03, 2001 at 12:54:05PM -0700, Brian Ingerson wrote:
> On 03/09/01 18:30 +0100, Piers Harding wrote:
> > Hi,
> > 
> > I'm trying to publish an Inline based suite that contains several
> > modules in the same directory that have a C++ component, but I can't
> > seem to figure out how to get them into the single Makefile.PL ( and
> > hence Makefile ) to be built. Could someone please tell me how to do
> > this? I have looked through the Inline mail archives and noticed
> > someone else asking this question, but I don't seem to be able to find
> > the answer. Also, it doesn't appear to be mentioned in Inline.pod
> > which does talk about Inline::MakeMaker.
> 
> Piers,
> 
> At this point, Inline::MakeMaker assumes that you will have one
> Makefile.PL and one (Inline-based) module per directory. So the best way
> to set things up is to have a hierarchy of directories, with one module
> per. You can build everything from the top level directory.
> Makefile.PL-s work recursively and Inline::MakeMaker plays along fine.
> 
> Perl, for better or worse, allows you to create module distributions in
> many different combinations of ways. You can put many modules in the
> same directory, you can put hierarchies under a lib/ directory, you can
> create subdirectories with their own Makefile.PL-s, you can mix these
> all together. One other way that many people are not aware of is to just
> define the last node of the module name, and then specify the entire
> name in the NAME parameter of WriteMakefile. For instance is you wanted
> to create the module Your::Brain::For::Once::Dude, you could just create
> a file called Dude.pm at the top level and specify the full name in the
> Makefile.PL. No need to create all the intervening directories under a
> lib/ directory.
> 
> My point is that Inline doesn't support several modules in the same
> directory, and it doesn't support the lib/ thing yet. But you
> shouldn't need them. One big advantage to putting each module in a
> separate subdirectory is that you can have README, Changes, etc files
> for that module.
> 
> Hope that helps. Let me know if you get stuck. If so, be sure to forward
> all details.
> 
> Cheers, Brian  

Reply via email to