help-make
[Top][All Lists]
Advanced

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

Re: Command producing several targets at once


From: Paul Smith
Subject: Re: Command producing several targets at once
Date: Wed, 26 Jul 2017 13:31:35 -0400

On Wed, 2017-07-26 at 09:17 -0800, Britton Kerin wrote:
> Another option if you don't like non-static pattern rules or the
> special-case stuff involved, is to use a stamp file:
> 
> yaccouts.stamp: parser.mly
>         ocamlyacc $<

I expect you want to add a "touch $@" to this recipe.

And, this will only work if you have only on .mly file you need to
build; if you have more than one you'll need to ensure the stamp file
name is based on the .mly file name rather than "yaccouts.stamp".

> Since .ml and .mli files are always produced together by the
> sameprogram, they don't need individual nodes in your dependency
> graph so you arrange yaccouts.stamp to represent them (and depend on
> the stampfile in turn where needed).

This works if you can ensure that all other references to parser.ml and
parser.mli in the prerequisites lists in your makefile can be replaced
with a reference to the .stamp file.

But, it's not so simple if you have auto-generated prerequisites etc.
where it's harder to control this.

Also, this method doesn't take into account someone deleting either or
both of the .ml or .mli files by hand but not touching the .stamp file.



reply via email to

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