(executables
  (names        js_of_ocaml jsoo_minify jsoo_link jsoo_fs)
  (public_names js_of_ocaml jsoo_minify jsoo_link jsoo_fs)
  (package js_of_ocaml-compiler)
  (libraries
    js_of_ocaml-compiler
    cmdliner
    compiler-libs.common
    (select empty-findlib.ml from
     ;; Only link js_of_ocaml-compiler.findlib-support if it exists
     (js_of_ocaml-compiler.findlib-support -> empty-findlib.ml.in)
     (                                     -> empty-findlib.ml.in))
    )
  (flags (:standard -safe-string))
  )

(rule
  (targets js_of_ocaml.1)
  (action (with-stdout-to %{targets} (run %{bin:js_of_ocaml} --help=groff))))

(rule
 (targets jsoo_link.1)
 (action (with-stdout-to %{targets} (run %{bin:jsoo_link} --help=groff))))

(rule
 (targets jsoo_fs.1)
 (action (with-stdout-to %{targets} (run %{bin:jsoo_fs} --help=groff))))

(rule
 (targets jsoo_minify.1)
 (action (with-stdout-to %{targets} (run %{bin:jsoo_minify} --help=groff))))

(install
  (section man)
  (package js_of_ocaml-compiler)
  (files js_of_ocaml.1
         jsoo_link.1
         jsoo_minify.1
         jsoo_fs.1
         ))
