-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathbuild.ml
More file actions
executable file
·120 lines (99 loc) · 5.04 KB
/
Copy pathbuild.ml
File metadata and controls
executable file
·120 lines (99 loc) · 5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env ocaml
#directory "pkg";;
#use "topkg.ml";;
#use "filelist.ml"
(* DEBUG ONLY *)
let nothing_should_be_rebuilt=false
let except = function
(* cmxs are regerated every time ( bug in ocamlbuild rule) *)
| ".cmxs" when nothing_should_be_rebuilt -> false
| _ -> true
(* END *)
let exts_syntax = List.filter except [".cmo";".cmx";".cma";".cmxa";".cmxs";".a"]
let exts_modlib = List.filter except Exts.module_library
let exts_lib = List.filter except Exts.library
let _ =
list_to_file "src/lib/client/client.mllib" client_mllib;
list_to_file "src/lib/client/api.odocl" client_api;
list_to_file "src/lib/server/server.mllib" server_mllib;
list_to_file "src/lib/server/server.mldylib" server_mllib;
list_to_file "src/lib/server/api.odocl" server_api;
list_to_file "src/ocamlbuild/ocamlbuild.mllib" ocamlbuild_mllib;
list_to_file "src/ocamlbuild/ocamlbuild.mldylib" ocamlbuild_mllib;
list_to_file "src/ocamlbuild/api.odocl" ocamlbuild_api;
list_to_file "src/ppx/ppx.mllib" ppx_mllib;
list_to_file "src/ppx/ppx.mldylib" ppx_mllib;
list_to_file "src/ppx/api.odocl" ppx_api;
list_to_file "src/ppx/ppx.mllib" ppx_mllib;
list_to_file "src/ppx/ppx.mldylib" ppx_mllib;
list_to_file "src/ppx/api.odocl" ppx_api
let spf = Printf.sprintf
let nothing =
if nothing_should_be_rebuilt
then "-nothing-should-be-rebuilt"
else ""
let builder = `Other ("_build/build/build.native","_build")
let with_man3 = Env.bool "manpage"
let () =
Pkg.describe "eliom" ~builder ([
(* META *)
Pkg.lib "pkg/META";
(* MANPAGE *)
Pkg.man ~dst:"man1/eliomc.1" "pkg/man/eliomc.1";
Pkg.man ~dst:"man1/eliomcp.1" "pkg/man/eliomc.1";
Pkg.man ~dst:"man1/eliomopt.1" "pkg/man/eliomc.1";
Pkg.man ~dst:"man1/eliomdep.1" "pkg/man/eliomc.1";
Pkg.man ~dst:"man1/js_of_eliom.1" "pkg/man/eliomc.1";
Pkg.man ~dst:"man1/eliom-distillery.1" "pkg/man/eliom-distillery.1";
Pkg.man ~cond:with_man3 ~dst:"man3/%.3oc" ~target:"src/lib/client/api.mandocdir/man.3oc" "src/lib/client/api.mandocdir/%.3oc";
Pkg.man ~cond:with_man3 ~dst:"man3/%.3os" ~target:"src/lib/server/api.mandocdir/man.3os" "src/lib/server/api.mandocdir/%.3os";
Pkg.man ~cond:with_man3 ~dst:"man3/%.3o" ~target:"src/ocamlbuild/api.mandocdir/man.3o" "src/ocamlbuild/api.mandocdir/%.3o";
Pkg.man ~cond:with_man3 ~dst:"man3/%.3o" ~target:"src/ppx/api.mandocdir/man.3o" "src/ppx/api.mandocdir/%.3o";
(* TOOLS *)
Pkg.bin ~auto:true "src/tools/eliomc";
Pkg.bin ~auto:true "src/tools/eliomcp";
Pkg.bin ~auto:true "src/tools/eliomdep";
Pkg.bin ~auto:true "src/tools/eliomopt";
Pkg.bin ~auto:true "src/tools/js_of_eliom";
Pkg.bin ~auto:true "src/tools/eliomdoc";
Pkg.bin ~auto:true "src/tools/eliompp";
Pkg.bin ~auto:true ~dst:"eliom-distillery" "src/tools/distillery";
Pkg.bin ~auto:true "src/ocamlbuild/eliombuild";
(* SYNTAXES *)
Pkg.lib ~exts:exts_syntax ~dst:"syntax/pa_eliom_seed" "src/syntax/pa_eliom_seed";
Pkg.lib ~exts:exts_syntax ~dst:"syntax/pa_eliom_client_client" "src/syntax/pa_eliom_client_client";
Pkg.lib ~exts:exts_syntax ~dst:"syntax/pa_eliom_client_server" "src/syntax/pa_eliom_client_server";
Pkg.lib ~exts:exts_syntax ~dst:"syntax/pa_eliom_type_filter" "src/syntax/pa_eliom_type_filter";
Pkg.lib ~exts:exts_modlib ~dst:"ocamlbuild/ocamlbuild_eliom" "src/ocamlbuild/ocamlbuild_eliom";
(* PPX *)
Pkg.lib ~exts:Exts.module_library ~dst:"ppx/ppx_eliom" "src/ppx/ppx_eliom";
Pkg.lib ~exts:Exts.module_library ~dst:"ppx/ppx_eliom_client" "src/ppx/ppx_eliom_client";
Pkg.lib ~exts:Exts.module_library ~dst:"ppx/ppx_eliom_type" "src/ppx/ppx_eliom_type";
Pkg.lib ~exts:Exts.module_library ~dst:"ppx/ppx_eliom_server" "src/ppx/ppx_eliom_server";
Pkg.bin ~auto:true ~dst:"ppx_eliom_client" "src/ppx/ppx_eliom_client_ex" ;
Pkg.bin ~auto:true ~dst:"ppx_eliom_server" "src/ppx/ppx_eliom_server_ex" ;
Pkg.bin ~auto:true ~dst:"ppx_eliom_types" "src/ppx/ppx_eliom_types_ex"
] @ (
(* CLIENT LIBS *)
Pkg.lib ~dst:"client/client" ~exts:[".cma"] "src/lib/client/client" ::
Pkg.lib ~dst:"client/eliom_client_main.cmo" "src/lib/client/eliom_client_main.cmo" ::
Pkg.lib ~dst:"client/eliom_client.js" "src/lib/client/eliom_client.js" ::
List.map (fun x -> Pkg.lib ~dst:(spf "client/%s" x) (spf "src/lib/client/%s" x)) client_extra
) @ (
(* SERVER LIBS *)
Pkg.lib ~dst:"server/monitor/eliom_monitor" ~exts:Exts.module_library "src/lib/server/monitor/eliom_monitor" ::
Pkg.lib ~dst:"server/monitor/eliom_monitor_main" ~exts:Exts.module_library "src/lib/server/monitor/eliom_monitor_main" ::
Pkg.lib ~dst:"server/server" ~exts:exts_lib "src/lib/server/server" ::
List.map (fun x -> Pkg.lib ~dst:(spf "server/%s" x) (spf "src/lib/server/%s" x)) server_extra
) @ [
(* MISC *)
Pkg.doc "README.md";
Pkg.doc "CHANGES";
Pkg.etc "pkg/etc/mime.types"
] @ (
List.flatten (
List.map (fun (name,files) ->
List.map (fun file ->
Pkg.lib ~dst:(spf "templates/%s/%s" name file) (spf "%s/%s/%s" templates_dir name file)
) files) templates_files )
))