Output option for Moscow ML compiler

98 views Asked by At

I am compiling some .sml files using mosmlc.exe. The problem is that .ui and .uo output files are placed in the same directory of my input .sml files. I would like to do something like this:

mosmlc.exe -o out/ src/file1.sml src/file2.sml

So that output files will be created in out/ folder. But looks like -o option is used for something different (according to the documentation). However, if I run with such an option, output files are created in the same directory as input files anyway.

How can I specify an output folder? There is no documentation on this and the compiler does not have a help option listing compiler options (very very annoying).

From the source code

By inspecting the compiler's entry point's source code I can understand that:

  1. There is no help option listing all the options and usages (terrible, maybe I should consider pulling a change to support this in their repo)
  2. There is no output option

So, looks like I cannot achieve this... Can you confirm that?

1

There are 1 answers

0
IonuČ› G. Stan On

I don't think there's any solution. Maybe just a workaround using symlinks, which I'm not sure Windows provides:

mkdir out && \
cd out && \
ln -s ../*.{sml,sig} . && \
mosmlc -toplevel Hello.sml World.sml main.sml -o main && \
./main

This will create an out directory, cd into it, symlink all .sig or .sml source files into that directory and perform the compilation there.

Sorry that I gave you a Unix command, but I don't have a Windows machine to test.