Makefile for installing the OCaml library

What do I need in my target install and uninstall in the Makefile for the OCaml library to make the game work well with the rest of the installation, work with ocamlfind without problems, and so on? Basically being a "good citizen." I'm not currently interested in GODI. Thanks!

+4
source share
2 answers

META files for ocamlfind are easy to write (basically, look for META in another ocaml project that you know¹, copy and make the appropriate changes), and they will provide you with ocamlfind integration, in particular build and uninstall (using ocamlfind install and ocamlfind remove ) . You should start with this.

¹: for example, I draw inspiration from META batteries .

The construction part of the Makefile is more complex, their numerous solutions (OCamlMakefile, OMake, ocamlbuild, simple Makefile, etc.) with various strengths and weaknesses. If you project quite simply, I would recommend ocamlbuild, which in itself takes care of a lot of dependency tracking.

You can also use Oasis , which is a relatively new tool that relies on ocamlbuild and ocamlfind and aims to provide a single configuration file for pre-assembly and various build and deployment (your program, your program libraries, if any, related data or documentation .. .). This is not a mature project (and his younger brother Oasis-DB has not yet been released), but I recommend that you try if you have time. This is a bit more complicated than META, as it does more in the end, so first creating a META is still a good step.

Finally, you said that you are not interested in Godi (Godi is a very good system, and in some cases (e.g. BSD, etc.) it is a great choice to have a good OCaml installation), but if you may still be interested in Godiva , a tool to help you create GODI packages. However, I never used it myself.

+6
source

I do not use make files, but the ocamlbuild and shell script for installing the software I distribute . The Debian people made packages for my software with these scripts without any problems. Therefore, you can check them, since they correspond to some of their requirements (for example, separate targets for a byte and native code).

You can also look at their packaging policies , although I do not know if this document is updated.

Remember to add the META file for ocamlfind. And you can also include the _oasis file for the upcoming oasis-db project (not yet done in the software I distribute).

+4
source

All Articles