help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Diagramming a makefile?


From: Reinier Post
Subject: Re: Diagramming a makefile?
Date: Mon, 14 Apr 2014 12:14:42 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun Apr 13 22:44:58 2014, address@hidden (Rakesh Sharma) wrote:
> Hello GNU makers,
> 
> Is there any tool/utility which can diagram the DAG of the
> rules/targets by going thru the makefile? And I don't mean this in
> a generic way, that all sorts of complex $(eval-ed) rules need to
> be diagrammed.

MAKAO:

  http://mcis.polymtl.ca/~bram/makao/

I haven't used it in a while, but there is a recent release.

I have a simple Perl script that takes make -p output
and outputs it in a CSV format that I can filter or convert
to Graphviz format with other scripts.

  http://www.win.tue.nl/~rp/bin/make2csv

It doesn't do a perfect job, and other Perl scripts exist with
the same purpose.  However, all of these attempts appear incomplete.
No doubt there are efforts in other languages, too.

It would be helpful to have an official, exact description
of makefile syntax, telling exactly how to parse make -p's output,
where to find the targets, dependencies, and recipes,
and what differences exist between versions.
The source code is the ultimate specification, of course,
and the info files more or less contain the information,
but it would be nice to have it isolated in a single place.

> What I feel is that if we have a picture of the DAG of a makefile,
> then we can better understand the behavior of make.  And vice versa
> too, we can start off writing a makefile by drawing the DAG first &
> then convert that into a makefile (the rules portion).
> 
> Considering that make is nearing 4 decades, it's hard to believe
> that such utilities are not already available.

Some are, but it's hard for them to guarantee 100% accuracy
(leaving aside the issue of dynamic rule generation),
as makefile syntax may slightly change from version to version.

> Thanks, Rakesh

-- 
Reinier Post
TU Eindhoven



reply via email to

[Prev in Thread] Current Thread [Next in Thread]