[mercury-users] Either a documentation request or a feature request. I'm not sure which.

Ian MacLarty maclarty at csse.unimelb.edu.au
Mon Apr 16 22:28:00 AEST 2012


On Mon, Apr 16, 2012 at 10:09 PM, Michael Richter <ttmrichter at gmail.com> wrote:
> In general when I build packages I like to keep my build offal (intermediate
> forms, etc.) separate from my source files.  This makes cleaning up
> afterwards simpler (rm -fR build) and avoids errors like missing which files
> need to be deleted or, worse, deleting files that are actually needed.
>
> I can't figure out how to do this in Mercury.
>
> The User's Guide recommends against using mmc raw and instead recommends the
> use of mmc --make.  The latter, however, only works (it seems) from the
> source directory itself.  I can't find any way to tell mmc --make "go to
> directory X for source files" and I can't find a way to tell it "dump all
> your output into directory Y".
>
> Is there any way to do what I want to do short of doing everything by hand
> in a Makefile (and making me try to figure out how to link .o files, etc. by
> hand)?

Yes.  From your build directory do:

mmc -f X/*.m

(where X contains your source files)

This will generate a Mercury.modules file that tells mmc where to find
each module.
Then you can do (still from your build directory):

mmc --make myprogram

Ian.

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list