Create a graphviz graph of a Makefile.
Project description
Visualize Makefile Dependency Graphs
makefile2dot
produces a Graphviz dot
graph from a Makefile. To run it,
install graphviz
and python
. This version runs on python 3.
# apt-get install graphviz python
$ pip install makefile2dot
Usage
makefile2dot
reads the Makefile
in the current working directory using the
same lookup rules that make
does (it actually uses make
to parse the
Makefile
). By default, it writes the resulting dot
graph to stdout
, which
can be read in by graphviz
. So a nice trick is to pipe output from
makefile2dot
directly in to dot
.
For example:
$ makefile2dot | dot -Tpng > out.png
If you just want to see the graph without saving it, you can provide the
--view
flag:
$ makefile2dot -v
You can select the graph orientation so that it is drawn from top to bottom
(TB
), bottom to top (BT
), left to right (LR
) or right to left (RL
). For
example:
$ makefile2dot -v --direction LR
draws the graph from left to right, rather than the default bottom to top.
Normal targets are drawn as rectangles, and .PHONY
targets are drawn as
circles.
Tips
To test this project in the source directory, add the source directory to the python path:
$ export PYTHONPATH=$(pwd)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file makefile2dot-1.0.2.tar.gz
.
File metadata
- Download URL: makefile2dot-1.0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b789ef27cf1de994dd6b8afa62fb9829c9b1fa105ee39fc328fd23a048b20d41 |
|
MD5 | 2a8a9ca38e44ff1404788b1a3261ec97 |
|
BLAKE2b-256 | 6ab4c0ae210800ccbae698ab1746125f27726e62ec9552500b1372c084f518bf |
File details
Details for the file makefile2dot-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: makefile2dot-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 414f57270e62425642885af6f96d0bbe4f425dec0f50e4c5eeb81520d3aaac3b |
|
MD5 | 64a6b47e099ab3602ba960e9d91c04cf |
|
BLAKE2b-256 | cf96676fbebe8a7df2697a6c8208295d76da90d83bc80d0182e853341dfc8888 |