4

In my root XS file, I have an include of other XS file which I have to do in order to maintain a clean project structure:

MODULE = MyModule       PACKAGE = MyPackage
# ...
INCLUDE: xs/MySubpackage.xs

Everything is working fine, except that I have to manually delete 'MyPackage.c' each time when I edit MySubpackage.xs - as otherwise the changes are not getting reflected.

Is there an easy way to make ExtUtils::MakeMaker to automatically rebuild MyModule.c each time when MySubpackage.xs is getting changed?

vdudouyt
  • 843
  • 7
  • 14
  • 1
    Looks like there's a `depend` attribute that could be useful. – ikegami Nov 01 '17 at 05:39
  • The `XS` directive may be of help as well, but I've never used it so I'm a little unsure. – stevieb Nov 01 '17 at 14:26
  • I found that dealing with multiple XS files is much easier when using Module::Build instead of MakeMaker. You just plop your XS files into `lib/` as if they were a normal module, and write a corresponding `.pm` module to load each. The drawback is that you now have multiple dynamic libraries that need to be loaded. If the project is sufficiently small, it may also be sufficient to do a clean build each time – amon Nov 01 '17 at 16:35

0 Answers0