This document describes features and solutions using gmake', the GNU
make’ program. Some solutions may also work with other flavors of make
, but are usually not tested (by me).
The first step in understanding whether a Makefile can be parallelized is to view its internal dependencies. This can be done with a tool called make2graph
. The tool itself also requires a build.
Building make2graph
is simple: install the dependencies like dot
and make
and run make
in the project folder.
git clone https://github.com/lindenb/makefile2graph.git
cd makefile2graph
make
This will create the binary tool make2graph
.
To view a dependency tree of itself do:
make all -Bnd | ./make2graph | dot -Tpng -o make2graph.png
This will create the image make2graph.png
in the local directory. If the complexity of a Makefile is too high for dot
instead of .png
, a .svg
can be created. Also, if the resulting png
file cannot be viewed with display
, because the size is to high, another program like eom
can be used.
make all -Bnd | ./make2graph | dot -Tsvg -o make2graph.svg
Version | Date | Notes |
---|---|---|
0.1.0 | 2023-03-02 | Initial release |