diff --git a/pages/common/ocaml.md b/pages/common/ocaml.md index e4d3a68979..311aef7d76 100644 --- a/pages/common/ocaml.md +++ b/pages/common/ocaml.md @@ -2,6 +2,7 @@ > The OCaml repl (read-evaluate-print-loop). > Interprets Ocaml commands. +> More information: . - Read OCaml commands from the user and execute them: diff --git a/pages/common/ocamlc.md b/pages/common/ocamlc.md index 07774f6869..295fb488c7 100644 --- a/pages/common/ocamlc.md +++ b/pages/common/ocamlc.md @@ -2,6 +2,7 @@ > The OCaml bytecode compiler. > Produces executables runnable by the OCaml interpreter. +> More information: . - Create a binary from a source file: @@ -10,3 +11,7 @@ - Create a named binary from a source file: `ocamlc -o {{path/to/binary}} {{path/to/source_file.ml}}` + +- Automatically generate a module signature (interface) file: + +`ocamlc -i {{path/to/source_file.ml}}` diff --git a/pages/common/ocamlfind.md b/pages/common/ocamlfind.md new file mode 100644 index 0000000000..cbed8c1944 --- /dev/null +++ b/pages/common/ocamlfind.md @@ -0,0 +1,17 @@ +# ocamlfind + +> The findlib package manager for OCaml. +> Simplifies linking executables with external libraries. +> More information: . + +- 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}}` diff --git a/pages/common/ocamlopt.md b/pages/common/ocamlopt.md new file mode 100644 index 0000000000..138bb74782 --- /dev/null +++ b/pages/common/ocamlopt.md @@ -0,0 +1,13 @@ +# ocamlopt + +> The OCaml native code compiler. +> Produces native executables, e.g. ELF on Linux. +> More information: . + +- Compile a source file: + +`ocamlopt -o {{path/to/binary}} {{path/to/source_file.ml}}` + +- Compile with debugging enabled: + +`ocamlopt -g -o {{path/to/binary}} {{path/to/source_file.ml}}`