mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-07 17:26:02 +02:00
ocaml*: add ocamlopt and ocamlfind and extend ocamlc (#4436)
This commit is contained in:
parent
ab043776f0
commit
f6e080573a
4 changed files with 36 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
> The OCaml repl (read-evaluate-print-loop).
|
> The OCaml repl (read-evaluate-print-loop).
|
||||||
> Interprets Ocaml commands.
|
> Interprets Ocaml commands.
|
||||||
|
> More information: <https://ocaml.org>.
|
||||||
|
|
||||||
- Read OCaml commands from the user and execute them:
|
- Read OCaml commands from the user and execute them:
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
> The OCaml bytecode compiler.
|
> The OCaml bytecode compiler.
|
||||||
> Produces executables runnable by the OCaml interpreter.
|
> Produces executables runnable by the OCaml interpreter.
|
||||||
|
> More information: <https://ocaml.org>.
|
||||||
|
|
||||||
- Create a binary from a source file:
|
- Create a binary from a source file:
|
||||||
|
|
||||||
|
@ -10,3 +11,7 @@
|
||||||
- Create a named binary from a source file:
|
- Create a named binary from a source file:
|
||||||
|
|
||||||
`ocamlc -o {{path/to/binary}} {{path/to/source_file.ml}}`
|
`ocamlc -o {{path/to/binary}} {{path/to/source_file.ml}}`
|
||||||
|
|
||||||
|
- Automatically generate a module signature (interface) file:
|
||||||
|
|
||||||
|
`ocamlc -i {{path/to/source_file.ml}}`
|
||||||
|
|
17
pages/common/ocamlfind.md
Normal file
17
pages/common/ocamlfind.md
Normal 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}}`
|
13
pages/common/ocamlopt.md
Normal file
13
pages/common/ocamlopt.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# ocamlopt
|
||||||
|
|
||||||
|
> The OCaml native code compiler.
|
||||||
|
> Produces native executables, e.g. ELF on Linux.
|
||||||
|
> More information: <https://ocaml.org>.
|
||||||
|
|
||||||
|
- 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}}`
|
Loading…
Add table
Reference in a new issue