[build2] Pointers for module

Boris Kolpackov boris at codesynthesis.com
Tue Jan 2 15:14:46 UTC 2018


Kalle Møller <kalle at k-moeller.dk> writes:

> To learn more about the project, I would like to try and make my own module
> / pure academic purpose. Maybe a latex build system. I would just love to
> get a few pointeres, so that I don't have to debug step my way through.
> 
> Where should I look for the hook to generate a configuration?
> 
> When the user runs b update, where does that hook to cxx? As in is it the
> cxx module that knows that a target should be rebuild or does the build
> system tell cxx to rebuild the target?

I think the best way forward is to study a similar module and see how
it works. cxx is very complex so I would recommend, perhaps, cli. It
implements generation of command line interface parsing code (source
code generation) using the cli compiler[1]. It is still probably a bit
more complex than what you need, but I think it's the closest we've got.

Overall, a latex module would need to do the following:

1. Register input/output target types, say latex{} and ps{}.

2. Implement and register a rule that translates input to output.

3. Configure itself on load.

Also note that currently build2 does not support building external
modules so you will have to add yours directly into the build2
executable. But this is something that we are planning to address
in the very near future.

[1] https://codesynthesis.com/projects/cli/

Boris



More information about the users mailing list