GraphViz software enables users to create building flowcharts directly from Makefiles. This software makes it easy to visualize the dependencies between building components and streamline the building process.
To get started with Makefile::GraphViz, users simply need to use the module in their Perl scripts:
use Makefile::GraphViz;
Once the module has been imported, users can create an instance of the `Makefile::GraphViz` class with:
$parser = Makefile::GraphViz->new;
Users can then parse their Makefile with:
$parser->parse('Makefile');
To visualize the structure of the Makefile, users can plot the tree rooted at a specific goal, such as the 'install' goal:
$gv = $parser->plot('install');
$gv->as_png('install.png');
Alternatively, users can plot the tree rooted at the default goal with:
$gv = $parser->plot;
$gv->as_png('default.png');
For a visual representation of the entire Makefile, users can plot the forest consisting of all the goals in the file:
$gv = $parser->plot_all;
$gv->as_png('default.png');
Additionally, users can use all the methods inherited from the Makefile::Parser class, such as accessing the targets:
@targets = $parser->targets;
It is important to note that before Makefile::GraphViz was created, there was already a CPAN module called GraphViz::Makefile that performed a similar function. However, the images that GraphViz::Makefile generated were oversimplified, leading to the need for a more complex module like this one.
For everyday use, the gvmake utility is more convenient than using this module directly. It is also important to mention that this module is still in its alpha stage and is highly experimental. Therefore, it is strongly advised to avoid using Makefile::GraphViz for production purposes at this time. Despite this, there are plans to improve this module in the future.
Version 0.18: N/A