Skip to content

Commit

Permalink
Doc: fix documentation on separate compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Jul 14, 2020
1 parent f8de6da commit d89e856
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions examples/separate_compilation/dune
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@
(targets stdlib.js)
(action (run %{bin:js_of_ocaml} --pretty --source-map %{lib:stdlib:stdlib.cma} -o %{targets})))

(rule
(targets std_exit.js)
(action (run %{bin:js_of_ocaml} --pretty --source-map %{lib:stdlib:std_exit.cmo} -o %{targets})))

(rule
(targets myruntime.js)
(action (run %{bin:js_of_ocaml} build-runtime --pretty --source-map -o %{targets})))

(rule
(targets bin.js)
(action (run %{bin:js_of_ocaml} link %{dep:myruntime.js} %{dep:stdlib.js} %{dep:module1.js} %{dep:module2.js} -o %{targets})))
(action (run %{bin:js_of_ocaml} link %{dep:myruntime.js} %{dep:stdlib.js} %{dep:module1.js} %{dep:module2.js} %{dep:std_exit.js} -o %{targets})))

(alias
(name default)
(deps myruntime.js stdlib.js module1.js module2.js bin.js index.html))
(deps myruntime.js stdlib.js std_exit.js module1.js module2.js bin.js index.html))
8 changes: 4 additions & 4 deletions manual/separate-compilation.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ a list of JavaScript filename as input and concatenates them all
(merging source-maps together if needed).

{{{
js_of_ocaml link my-runtime.js stdlib.js libname.js modname.js -o myexe.js
js_of_ocaml link my-runtime.js stdlib.js libname.js modname.js std_exit.js-o myexe.js
}}}

Note that, unlike the ocaml compiler, the ocaml stdlib need to be
passed explicitly (here, {stdlib.js} is the result of compiling
{stdlib.cma}).
Note that, unlike the ocaml compiler, the ocaml stdlib and std_exit need to be
passed explicitly (here, {stdlib.js} and {std_exit.js} are the result of compiling
{stdlib.cma} and {std_exit.cma}).

== Support in dune

Expand Down

0 comments on commit d89e856

Please sign in to comment.