OMake bin directory

112 views Asked by At

I am trying to have omake build stuff in my bin directory. I tried

LIB = ../bin/mylib
.DEFAULT: $(OCamlLibrary $(LIB), $(FILES))

But only the .a and .cmxa end up in bin, all the .cmx .cmi and .o end up in src. What am I doing wrong?

1

There are 1 answers

1
camlspotter On BEST ANSWER

Nothing wrong. OMake's built-in OCaml related rules compile each module and produce its objects (.cmo, .cmi, .cmx and .o) in the same directory of the source code.

$(OCamlLibrary $(LIB), $(FILES)) function link these module objects and produce library files $(LIB).cma, $(LIB).cmxa and $(LIB).a, just like you have seen.

If you want to change the destination directory of object files, you have to fix the build rules for OCaml. They are defined in OCaml.om found in OMake's library directory, but I have to say that this is very challenging.