OCAMLMKTOP(1)
β¨ OCAMLMKTOP β¨
ok so real talk, this is the ocamlmktop(1) page from the General Commands Manual and it's basically the build-your-own-toplevel situation π
like you know how the OCaml toplevel is a thing? this lets you make your own one. obsessed.
π NAME π
ocamlmktop β building custom toplevel systems, bestie. that's the whole vibe.
πΈ SYNOPSIS πΈ
ocamlmktop [ -v|-version|-vnum ] [ -cclib libname ] [ -ccopt option ] [
-custom ] [ -o exec-file ] [ -I lib-dir ] filename ...
like literally that's it, that's the whole incantation β¨
π¦ DESCRIPTION π¦
okay so the ocamlmktop(1) command builds OCaml toplevels that contain user code preloaded at start-up. translation: you walk in, the toplevel already knows your stuff. no cap, it's giving "I brought my own code to the party" π«Ά
the way it works: ocamlmktop(1) takes as argument a set of x.cmo and x.cma files, and links them with the object files that implement the OCaml toplevel. that's the main character energy right there π
and if you pass the -custom flag, C object files and libraries (.o and .a files) can also be given on the command line, and they get linked in the resulting toplevel. highkey fancy π
π OPTIONS π
these are the command-line options recognized by ocamlmktop(1). every single one, we're not skipping, periodt.
-vβ print the version string of the compiler and exit. that's it, that's the whole job π-vnumor-versionβ print the version number of the compiler in short form and exit. short queen behavior β-cclib -llibnameβ pass the-llibnameoption to the C linker when linking in "custom runtime" mode (see the corresponding option forocamlc(1).). yes bestie, go read that page too, iykyk π¦-ccoptβ pass the given option to the C compiler and linker, when linking in "custom runtime" mode. see the corresponding option forocamlc(1).π₯-customβ link in "custom runtime" mode. see the corresponding option forocamlc(1).again!! go look π-I directoryβ add the given directory to the list of directories searched for compiled interface files (.cmoand.cma). it's a whole search path moment π-o exec-fileβ specify the name of the toplevel file produced by the linker. the default isa.out, which isβ¦ the classic. the iconique default. if you don't name it, it'sa.out. no notes π
π§ SEE ALSO π§
ocamlc(1)β like literally go read it, it's the sibling page and it has the deets on the "custom runtime" stuff mentioned above π
ok final vibe check: if you're linking in "custom runtime" mode, remember-cclib,-ccoptand-customall point you back atocamlc(1)for the real explanation. i'm not making up behavior, i'm just the messenger π«Ά
πΈ and that's the page!! brought to you by OCAMLMKTOP(1) β General Commands Manual, same title up top, same title down at the bottom, we're consistent like that π go build a toplevel, bestie, you're gonna slay β¨π
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- nixpkgs unstable: ocaml 5.5.1
- nixpkgs unstable: ocaml-solo5 1.3.5
- Copyright 1999 Institut National de Recherche en Informatique et
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms