[m-rev.] diff: fix source distribution builds

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Jan 13 01:20:35 AEDT 2020



On Mon, 13 Jan 2020 00:54:50 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
> The Mercury.modules file not being created and compilation falling over
> because some module names in those directories don't match file names.

I think I know the reason for the phony.

If you don't declare Mercury.modules phony, then, to get it rebuilt when
the mapping changes e.g. because you add a new module, you have to make it
depend on $(wildcard *.m). But if you do that, then it will be rebuilt after
*every* change to *every* module, which is very wasteful.

By marking Mercury.modules phony, and making the "depend" target depend
on it, you tell gmake to rebuild it every time "mmake depend" is run,
which is what we want.

If this is true, then we should mark Mercury.modules phony in ALL the
Mercury directories, not just the two you restored.

Of course, this does not explain the falling over, but then again,
it probably makes it not worth looking into.

Zoltan.


More information about the reviews mailing list