ocaml*: add ocamlopt and ocamlfind and extend ocamlc (#4436)

This commit is contained in:
Daniil Baturin
2020-10-05 21:19:55 +07:00
committed by GitHub
parent ab043776f0
commit f6e080573a
4 changed files with 36 additions and 0 deletions

17
pages/common/ocamlfind.md Normal file
View File

@@ -0,0 +1,17 @@
# ocamlfind
> The findlib package manager for OCaml.
> Simplifies linking executables with external libraries.
> More information: <http://projects.camlcity.org/projects/findlib.html>.
- Compile a source file to a native binary and link with packages:
`ocamlfind ocamlopt -package {{package1}},{{package2}} -linkpkg -o {{executable}} {{source_file.ml}}`
- Compile a source file to a bytecode binary and link with packages:
`ocamlfind ocamlc -package {{package1}},{{package2}} -linkpkg -o {{executable}} {{source_file.ml}}`
- Cross-compile for a different platform:
`ocamlfind -toolchain {{cross-toolchain}} ocamlopt -o {{executable}} {{source_file.ml}}`