[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: interface to make?
From: |
Glenn Fowler |
Subject: |
Re: interface to make? |
Date: |
Fri, 21 May 2004 02:23:22 -0400 (EDT) |
this web paper from 1994
http://www.research.att.com/~gsf/mam/
describes the MAM (make abstract machine) language for instrumenting
make for static, runtime, and regression analysis
MAM is strictly readonly; there is no control channel back to make
MAM output is written to a file and there are no other signals or events
the paper provides details, with examples, and also a link to a
patch that adds MAM to make-3.81beta1
a popular MAM application renders makefile dependency graphs
check out the AST nmake dependency graph for make-3.81beta1
http://www.research.att.com/~gsf/mam/gmake-nmake.ps.gz
most MAM output is the result of "walking the graph":
pattern metarule application,
variable assignments (listed on first use)
per-target variable assignments,
action success or failure,
concurrent action execution
although MAM is similar to -d output, MAM syntax and semantics
provide a stable base for makefile analysis
-- Glenn Fowler -- AT&T Labs Research, Florham Park NJ --
%% maman yonatan <address@hidden> writes:
my> is there any mechanism for subscribing make events,
my> like new rule was found, new variable was set, a
my> pattern stem was matched etc. ?
> Paul Smith wrote:
> I don't quite understand what you're asking. To whom would make send
> any events, signals, etc.? There is no "make library" that could be
> linked with another program, if that's what you're asking.
>
> Also, note that make proceeds in two distinct steps: in the first step
> it reads in all the makefiles and constructs an internal graph of all
> the dependency relationships, etc. In the second step it walks the
> graph and actually invokes the rules. So, your events such as setting a
> variable and "finding" a new rule, which would happen in the first step,
> are very different from matching a pattern, which would happen in the
> second step.