gasche / manual-ocamlbuild

A new reference manual for the ocamlbuild tool
Other
67 stars 15 forks source link

Is it possible to control where ocamlbuild outputs the binary symlink? #10

Closed rgrinberg closed 9 years ago

rgrinberg commented 9 years ago

For example, $ ocamlbuild program.native will output program.native in the cwd. Is it possible to tell ocamlbuild to create that symlink elsewhere? E.g. suppose that I have a binaries dir where I want the symlinks to be outputted.

gasche commented 9 years ago

Not to my knowledge. Furthermore, the symlinking is rather fragile in the current implementation (there are bugs were sometimes simlink are not done; I would support reporting them and fixing them, but for now one cannot rely on symlinks always being present). I would recommend you to use -no-links and then create the links or copies manually (either in the Makefile or as an ocamlbuild rule; for example you could create a rule for a target foo.link that statically depends on foo and copies it wherever you prefer).

rgrinberg commented 9 years ago

Thankfully, I've never encountered a bug in ocamlbuild's symlinking feature.

Thanks for letting me know that I'll have to do this manually. It's really not difficult anyway, I just wanted to avoid the possibility of duplicating an already existing feature.