Skip to main content

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)

Release files for makefile2dot 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for makefile2dot 1.0.2
File Size Uploaded
makefile2dot-1.0.2.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for makefile2dot 1.0.2
File Interpreter ABI Platform
makefile2dot-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / makefile2dot-1.0.2.tar.gz

Download URL makefile2dot-1.0.2.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b789ef27cf1de994dd6b8afa62fb9829c9b1fa105ee39fc328fd23a048b20d41
BLAKE2b-256 checksum
How to use checksums
6ab4c0ae210800ccbae698ab1746125f27726e62ec9552500b1372c084f518bf
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / makefile2dot-1.0.2-py3-none-any.whl

Download URL makefile2dot-1.0.2-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
414f57270e62425642885af6f96d0bbe4f425dec0f50e4c5eeb81520d3aaac3b
BLAKE2b-256 checksum
How to use checksums
cf96676fbebe8a7df2697a6c8208295d76da90d83bc80d0182e853341dfc8888
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

0.1.3

1 release file

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page