[m-users.] [Beginner] How to prevent Mercury from generating files other than the final binary

Julien Fischer jfischer at opturion.com
Fri Oct 14 14:15:16 AEDT 2022


On Fri, 14 Oct 2022, Razetime wrote:

> When I compile my mercury program, I get a lot of files that clutter
> the directory. As of now I am deleting them with the help of a script.
> Is there a builtin way to keep the compiled binary only?
>
> $ mmc a01.m
> $ ls
> a01  a01.c  a01.c_date  a01.d  a01_init.c  a01_init.o  a01.m  a01.mh  a01.o  inp

Invoke the compiler with the --use-subdirs option, eg.

    $ mmc --use-subdirs a01.m

This will place most of the generated files in a subdirectory named
"Mercury".

Alternatively, use the compiler's --make option to build your program,
e.g.

    $ mmc --make a01

(--make will enable --use-subdirs automatically)

Julien.


More information about the users mailing list