Install all manual pages
This commit is contained in:
parent
ecc3462912
commit
a0ce6a68aa
5
Makefile
5
Makefile
|
@ -17,4 +17,7 @@ reinstall: uninstall reinstall
|
||||||
clean:
|
clean:
|
||||||
rm -rf _build
|
rm -rf _build
|
||||||
|
|
||||||
.PHONY: default install uninstall reinstall clean
|
cinaps:
|
||||||
|
cinaps -i doc/jbuild
|
||||||
|
|
||||||
|
.PHONY: default install uninstall reinstall clean cinaps
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
(libraries (unix jbuilder jbuilder_cmdliner))
|
(libraries (unix jbuilder jbuilder_cmdliner))
|
||||||
(preprocess no_preprocessing)))
|
(preprocess no_preprocessing)))
|
||||||
|
|
||||||
|
(provides (jbuilder (file main.exe)))
|
||||||
|
|
||||||
(install
|
(install
|
||||||
((section bin)
|
((section bin)
|
||||||
(files ((main.exe as jbuilder)))))
|
(files ((main.exe as jbuilder)))))
|
||||||
|
|
93
doc/jbuild
93
doc/jbuild
|
@ -1,3 +1,96 @@
|
||||||
|
;; When adding a command to jbuilder, add it to the [cmds] variable in
|
||||||
|
;; this file and run "make cinaps"
|
||||||
|
|
||||||
(install
|
(install
|
||||||
((section doc)
|
((section doc)
|
||||||
(files (manual.org))))
|
(files (manual.org))))
|
||||||
|
|
||||||
|
#|(*$
|
||||||
|
open StdLabels
|
||||||
|
open Printf
|
||||||
|
|
||||||
|
let cmds =
|
||||||
|
[ "build"
|
||||||
|
; "build-package"
|
||||||
|
; "external-lib-deps"
|
||||||
|
; "install"
|
||||||
|
; "installed-libraries"
|
||||||
|
; "runtest"
|
||||||
|
; "uninstall"
|
||||||
|
]
|
||||||
|
|
||||||
|
let cmds = ("", "") :: List.map cmds ~f:(fun x -> ("-" ^ x, x))
|
||||||
|
|
||||||
|
let () =
|
||||||
|
print_endline ("|"^"#");
|
||||||
|
List.iter cmds ~f:(fun (suffix, cmd) ->
|
||||||
|
printf {|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder%s.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} %s --help=groff)))))
|
||||||
|
|}
|
||||||
|
suffix cmd);
|
||||||
|
print_string ";; "
|
||||||
|
*)|#
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} --help=groff)))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder-build.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} build --help=groff)))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder-build-package.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} build-package --help=groff)))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder-external-lib-deps.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} external-lib-deps --help=groff)))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder-install.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} install --help=groff)))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder-installed-libraries.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} installed-libraries --help=groff)))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder-runtest.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} runtest --help=groff)))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
((targets (jbuilder-uninstall.1))
|
||||||
|
(action (with-stdout-to ${@}
|
||||||
|
(run ${bin:jbuilder} uninstall --help=groff)))))
|
||||||
|
;; (*$*)
|
||||||
|
|
||||||
|
(install
|
||||||
|
((section man)
|
||||||
|
(files (
|
||||||
|
;; (*$List.iter cmds ~f:(fun (suf, _) -> printf "\n jbuilder%s.1" suf); printf "\n;; "*)
|
||||||
|
jbuilder.1
|
||||||
|
jbuilder-build.1
|
||||||
|
jbuilder-build-package.1
|
||||||
|
jbuilder-external-lib-deps.1
|
||||||
|
jbuilder-install.1
|
||||||
|
jbuilder-installed-libraries.1
|
||||||
|
jbuilder-runtest.1
|
||||||
|
jbuilder-uninstall.1
|
||||||
|
;; (*$*)
|
||||||
|
))))
|
||||||
|
|
||||||
|
(alias
|
||||||
|
((name runtest)
|
||||||
|
(deps (jbuild))
|
||||||
|
(action (run ${bin:cinaps} ${<}))))
|
||||||
|
|
|
@ -176,7 +176,7 @@ let action ~targets =
|
||||||
(fun { Action. prog; args; env; dir; stdout_to; touches } ->
|
(fun { Action. prog; args; env; dir; stdout_to; touches } ->
|
||||||
List.iter touches ~f:(fun fn ->
|
List.iter touches ~f:(fun fn ->
|
||||||
close_out (open_out_bin (Path.to_string fn)));
|
close_out (open_out_bin (Path.to_string fn)));
|
||||||
let stdout_to = Option.map stdout_to ~f:(Path.reach ~from:dir) in
|
let stdout_to = Option.map stdout_to ~f:Path.to_string in
|
||||||
Future.run ~dir:(Path.to_string dir) ~env ?stdout_to (Path.reach ~from:dir prog)
|
Future.run ~dir:(Path.to_string dir) ~env ?stdout_to (Path.reach ~from:dir prog)
|
||||||
args)
|
args)
|
||||||
|
|
||||||
|
|
|
@ -656,9 +656,9 @@ module Rule = struct
|
||||||
}
|
}
|
||||||
|
|
||||||
let common =
|
let common =
|
||||||
field "targets" (list file_in_current_dir) >>= fun targets ->
|
field "targets" (list file_in_current_dir) >>= fun targets ->
|
||||||
field "deps" (list Dep_conf.t) >>= fun deps ->
|
field "deps" (list Dep_conf.t) ~default:[] >>= fun deps ->
|
||||||
field "action" User_action.Unexpanded.t >>= fun action ->
|
field "action" User_action.Unexpanded.t >>= fun action ->
|
||||||
return { targets; deps; action }
|
return { targets; deps; action }
|
||||||
|
|
||||||
let v1 = record common
|
let v1 = record common
|
||||||
|
|
|
@ -78,6 +78,8 @@ rule main stack = parse
|
||||||
{ Buffer.clear escaped_buf;
|
{ Buffer.clear escaped_buf;
|
||||||
scan_string escaped_buf (Lexing.lexeme_start_p lexbuf) stack lexbuf
|
scan_string escaped_buf (Lexing.lexeme_start_p lexbuf) stack lexbuf
|
||||||
}
|
}
|
||||||
|
| "#|"
|
||||||
|
{ block_comment 0 stack lexbuf }
|
||||||
| unquoted* as s
|
| unquoted* as s
|
||||||
{ new_sexp main (Sexp (Atom s, atom_loc lexbuf, stack)) lexbuf }
|
{ new_sexp main (Sexp (Atom s, atom_loc lexbuf, stack)) lexbuf }
|
||||||
| eof
|
| eof
|
||||||
|
@ -87,6 +89,19 @@ rule main stack = parse
|
||||||
| _
|
| _
|
||||||
{ error lexbuf "syntax error" }
|
{ error lexbuf "syntax error" }
|
||||||
|
|
||||||
|
and block_comment depth stack = parse
|
||||||
|
| "#|"
|
||||||
|
{ block_comment (depth + 1) stack lexbuf }
|
||||||
|
| "|#"
|
||||||
|
{ if depth = 0 then
|
||||||
|
main stack lexbuf
|
||||||
|
else
|
||||||
|
block_comment (depth - 1) stack lexbuf }
|
||||||
|
| _
|
||||||
|
{ block_comment depth stack lexbuf }
|
||||||
|
| eof
|
||||||
|
{ error lexbuf "unterminated block comment" }
|
||||||
|
|
||||||
and scan_string buf start stack = parse
|
and scan_string buf start stack = parse
|
||||||
| '"'
|
| '"'
|
||||||
{ new_sexp main
|
{ new_sexp main
|
||||||
|
|
Loading…
Reference in New Issue