48 lines
845 B
Plaintext
48 lines
845 B
Plaintext
(* -*- tuareg -*- *)
|
|
|
|
open StdLabels
|
|
|
|
let commands =
|
|
[ "build"
|
|
; "build-package"
|
|
; "external-lib-deps"
|
|
; "install"
|
|
; "installed-libraries"
|
|
; "runtest"
|
|
; "uninstall"
|
|
]
|
|
|
|
let jbuild =
|
|
String.concat ~sep:""
|
|
({|
|
|
(jbuild_version 1)
|
|
|
|
(install
|
|
((section doc)
|
|
(files (manual.org))))
|
|
|
|
(rule
|
|
((targets (jbuilder.1))
|
|
(action (with-stdout-to ${@}
|
|
(run ${bin:jbuilder} --help=groff)))))
|
|
|} :: List.map commands ~f:(fun cmd ->
|
|
Printf.sprintf {|
|
|
(rule
|
|
((targets (jbuilder-%s.1))
|
|
(action (with-stdout-to ${@}
|
|
(run ${bin:jbuilder} %s --help=groff)))))
|
|
|} cmd cmd)
|
|
@ [ Printf.sprintf {|
|
|
(install
|
|
((section man)
|
|
(files (
|
|
jbuilder.1
|
|
%s
|
|
))))
|
|
|} (String.concat ~sep:"\n "
|
|
(List.map commands ~f:(Printf.sprintf "jbuilder-%s.1")))
|
|
])
|
|
|
|
let () =
|
|
Jbuild_plugin.V1.send jbuild
|