Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 944 lines (845 sloc) 35.126 kB
fccc685 Initial open-source release
MLstate authored
1 (*
716e24d @OpaOnWindowsNow [fix] build_rules.ml,stdlib,conf: better indentation
OpaOnWindowsNow authored
2 Copyright © 2011, 2012 MLstate
fccc685 Initial open-source release
MLstate authored
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (* ------------------------------------------------------------ *)
19 (* Tags, flags, directory contexts and custom stuff *)
20 (* ------------------------------------------------------------ *)
21
22 (* -- Directory contexts -- *)
23
24 shared_namespace_dir "libqmlcompil";
25 shared_namespace_dir "database";
26 shared_namespace_dir "opa";
27 include_subdirs "opalib";
28 shared_namespace_dir "opalang";
29 shared_namespace_dir "appruntime";
30 shared_namespace_dir "libnet";
31 include_subdirs "qmlflat";
32
33 (* -- Stubs -- *)
34
35 def_stubs ~dir:"libbase" "stubs";
36 def_stubs ~dir:"libsecurity" "ssl_ext";
37 def_stubs ~dir:"appruntime" "io";
38
39 let root_ocamldir = Config.ocamllib in
40
41 let is_release () = Config.is_release in
42
43 let link_cmd = if windows_mode then S[Sh"cp";A"-r"] else S[Sh"ln";A"-s";A"-f"] in
44
45 let extralib_opt = function
46 | Some (lib,ldir,idir) ->
47 flag ["link"; "use_"^lib] (S [A "-ccopt"; P ("-L" ^ ldir); A"-cclib"; A ("-l" ^ lib)]);
48 flag ["compile"; "c"; "use_"^lib] (S [A"-I"; P idir])
49 | None -> ()
50 in
51 extralib_opt Config.libnatpmp;
52 extralib_opt Config.miniupnpc;
53
9c23f19 @Aqua-Ye [fix] iconv: add a pass to filter "system libs" in build_rules
Aqua-Ye authored
54 let linux_system_libs = ["iconv"]
55 and mac_system_libs = []
56 and windows_system_libs = []
57 in
58
59 let filter_system_libs l =
60 let system_libs =
61 match Config.os with
62 | Config.Linux | Config.FreeBSD -> linux_system_libs
63 | Config.Mac -> mac_system_libs
64 | Config.Win32 | Config.Cygwin -> windows_system_libs
65 in List.filter (fun x -> not (List.mem x system_libs)) l
66 in
fccc685 Initial open-source release
MLstate authored
67
68 begin
69 match Config.camlidl with
70 | None -> ()
71 | Some camlidl ->
72 flag ["link"; "use_camlidl"] (S [A "-cclib"; P "-lcamlidl" ]);
73
74 rule "camlidl processing: .idl -> .ml .mli _stubs.c lib_stubs.clib"
75 ~deps:[ "%(dir)stubs%(name).idl" ]
76 ~prods:[ "%(dir:<**/>)stubs%(name:<*> and not <*.*> and not <>).mli";
77 "%(dir:<**/>)stubs%(name:<*> and not <*.*> and not <>).ml" ;
78 "%(dir:<**/>)stubs%(name:<*> and not <*.*> and not <>)_stubs.c" ]
79 ~insert:`top
80 (fun env _build ->
81 let dir = env "%(dir)" in
82 let name = env "%(name)" in
83
84 def_stubs ~dir (name ^ "_idl");
85
86 Cmd(S[Sh"cd"; P dir; Sh"&&";
87 P camlidl; A"-prepro"; P"/usr/bin/cpp"; A"-no-include"; P ("stubs" ^ name -.- "idl") ])
88 )
89 end;
90
91 (* -- Ocamldoc plugin -- *)
92
93 flag_and_dep ["ocaml"; "doc"] (S[A"-g";P"utils/ocamldoc_plugin.cmxs"]);
94
95 (* ------------------------------------------------------------ *)
96 (* Hacks *)
97 (* ------------------------------------------------------------ *)
98
99 (* opatop needs to link its serverLib *then* opabsl *then* the rest. We
100 cheat by copying the opabsl generated files so that they can be seen as
101 local by opatop. *)
102 let magic_import_from_opabsl dest f =
103 rule ("import from opabsl: "^f) ~deps:["opabsl/"^f] ~prod:(dest / f)
104 (fun env build ->
105 Seq[Cmd(S[Sh"mkdir";A"-p";P dest]);
106 if Pathname.exists "opabsl"
107 then (build_list build ["opabsl" / f]; cp ("opabsl"/ f) dest)
108 else cp (mlstatelibs/"opabsl"/ f) dest
109 ])
110 in
111 List.iter
112 (fun m -> magic_import_from_opabsl "opatop" (m ^ ".ml"))
113 [ "opabslgenMLRuntime"; "opabslgenLoader" ];
114
115
116 (* ------------------------------------------------------------ *)
117 (* Additional rules: internal *)
118 (* ------------------------------------------------------------ *)
119
120 (* -- static ppdebug -- *)
121 (* what happens here is:
122 * - generate the file _build/environment containing the environment vars used by ppdebug
123 * - make files tagged with with_static_proprecessing depend on _build/environment
124 * - tag any ml file containing some static ppdebug with the tag with_static_proprecessing
125 *)
126
127 let static_ppdebug_vars = [
128 "CPS_WITH_ML_CLOSURE"; (* disable the use of qml closures in cps continuations
129 * (for performance reasons) *)
130 "CPS_STACK_SIZE" ; (* observe the size of the stack @ cps return *)
131 ] in
132 let environment = "environment" in
133 let build_env_strings =
134 (List.map
135 (fun s ->
136 Printf.sprintf "let %s = %s\n"
137 s (try Printf.sprintf "Some %S" (Sys.getenv s)
138 with Not_found -> "None")
139 ) static_ppdebug_vars) in
140 dep ["with_static_preprocessing"] [environment];
141
142 rule "environment generation"
143 ~prods:[environment;"i_dont_exist"](* fake prod to make sure this rule is
144 * always called *)
145 (fun env build ->
146 Echo (build_env_strings, environment));
147
148 let generate_ocamldep_rule ml_or_mli =
149 rule ("ocaml dependencies " ^ ml_or_mli ^ " reloaded (deps of static ppdebug)")
150 ~prod:("%." ^ ml_or_mli ^ ".depends")
151 ~dep:("%." ^ ml_or_mli)
152 ~insert:`top (* need to be inserted before the real ocamldep rule *)
153 (fun env build ->
154 let ml = env "%." ^ ml_or_mli in
155 if Tags.mem "with_mlstate_debug" (tags_of_pathname ml) &&
156 Sys.command ("grep -q '#<Ifstatic:' " ^ Pathname.to_string ml) = 0
157 then
158 tag_file ml ["with_static_preprocessing"];
159 fail_rule build (* failing to that ocamlbuild calls the real ocamldep rule *)
160 ) in
161 generate_ocamldep_rule "ml";
162 generate_ocamldep_rule "mli";
163
164 (* -- Macro-rules generating mlstate_platform.h files -- *)
165 (* TODO BUG 2 : droits du script invalides *)
166 (* TODO BUG 3 : path du fichier généré foireux *)
167 rule "mlstate_platform: () -> libbase/mlstate_platform.h"
168 ~deps:(tool_deps "mlstate_platform")
169 ~prods:["libbase/mlstate_platform.h"]
170 (fun env build ->
171 Seq[
172 Cmd(S[Sh"chmod +x"; P "libbase/gen_platform"]);
173 Cmd(S[get_tool "mlstate_platform"; A (if windows_mode then "WIN" else "")]);
174 Cmd(S[Sh"mv mlstate_platform.h libbase/mlstate_platform.h"])
175 ]
176 );
177
178 (* -- Opa stdlib -- *)
179
180 (*
181 <!> Mathieu Fri Oct 22 10:54:50 CEST 2010
182 !! IF YOU NEED TO PATCH THE FOLLOWING RULE !!
183 ---> come to me, we have to talk first.
184 *)
185 let stdlib_files =
186 (* keep in sync with s3passes@pass_AddStdlibFiles*)
187 let core_dir = "stdlib/core" in
188 let tests_dir = "stdlib/tests" in
189 let dirs = core_dir :: tests_dir :: rec_subdirs [ core_dir ] in
190 let files = List.fold_right (fun dir acc -> dir_ext_files "js" dir @ dir_ext_files "opa" dir @ acc) dirs [] in
191 files
192 in
193 rule "stdlib embedded: stdlib_files -> opalib/staticsInclude.of"
194 ~deps:stdlib_files
195 ~prod:"opalib/staticsInclude.of"
196 (fun env build -> Echo (List.map (fun f -> f^"\n") stdlib_files, "opalib/staticsInclude.of"));
197
198 let opa_opacapi_files =
199 let dirs = rec_subdirs ["stdlib"] in
200 let files = List.fold_right (fun dir acc -> dir_ext_files "opa" dir @ acc) dirs [] in
201 files
202 in
203
204 (* used in mkinstall *)
205 let opacapi_validation = "opacapi.validation" in
206 rule "Opa Compiler Interface Validation (opacapi)"
207 ~deps:("opa/checkopacapi.native" :: opa_opacapi_files)
208 ~prod:opacapi_validation
209 (fun env build ->
210 Cmd(S ([
211 P "./opa/checkopacapi.native" ;
212 A "-o" ;
213 P opacapi_validation ;
214 ] @ (List.rev_map (fun file -> P file) opa_opacapi_files)));
215 );
216
217 (* -- Build infos and runtime version handling -- *)
218
219 (* TODO: probably same bugs than mlstate_platform *)
220 let generate_buildinfos = "buildinfos/generate_buildinfos.sh" in
ab0b5b4 @OpaOnWindowsNow [feature] version: move to 0.9.0 & S4
OpaOnWindowsNow authored
221 let version_buildinfos = "buildinfos/version_major.txt" in
fccc685 Initial open-source release
MLstate authored
222 let pre_buildinfos = "buildinfos/buildInfos.ml.pre" in
223 let post_buildinfos = "buildinfos/buildInfos.ml.post" in
224 let buildinfos = "buildinfos/buildInfos.ml" in
225 rule "buildinfos: buildinfos/* -> buildinfos/buildInfos.ml"
226 ~deps:[version_buildinfos ; pre_buildinfos ; generate_buildinfos ; post_buildinfos]
227 ~prods:(buildinfos :: (if is_release() then ["always_rebuild"] else []))
228 (fun env build ->
229 let version = env version_buildinfos in
230 let pre_prod = env pre_buildinfos in
231 let prod = env buildinfos in
232 let post_prod = env post_buildinfos in
233 Seq[
234 Cmd(S[Sh "cat" ; P pre_prod ; Sh ">" ; P prod]);
235 Cmd(S[P "bash"; A "-e"; P generate_buildinfos; P Pathname.pwd;
236 if is_release () then A "--release" else N;
237 A "--version" ; P version ;
238 Sh ">>" ; P prod]);
239 Cmd(S[Sh "cat" ; P post_prod ; Sh ">>" ; P prod]);
240 ]
241 );
242
243 let parser_files =
534ca4d @OpaOnWindowsNow [feature] syntax: introduces js-like syntax
OpaOnWindowsNow authored
244 let dir = ["opalang/classic_syntax";"opalang/js_syntax"] in
fccc685 Initial open-source release
MLstate authored
245 let files = List.fold_right (fun dir acc -> dir_ext_files "trx" dir @ dir_ext_files "ml" dir) dir ["general/surfaceAst.ml"] in
246 files
247 in
534ca4d @OpaOnWindowsNow [feature] syntax: introduces js-like syntax
OpaOnWindowsNow authored
248 let opaParserVersion = "opalang"/"classic_syntax"/"opaParserVersion.ml"
fccc685 Initial open-source release
MLstate authored
249 in
534ca4d @OpaOnWindowsNow [feature] syntax: introduces js-like syntax
OpaOnWindowsNow authored
250 rule "opa parser version: opalang/*_syntax/* stdlib -> opalang/classic_syntax/opaParserVersion.ml"
fccc685 Initial open-source release
MLstate authored
251 ~deps:parser_files
252 ~prod:opaParserVersion
253 (fun build env ->
254 let files = List.map (fun s-> P s) parser_files in
255 Seq[
256 Cmd(S ( [Sh"echo let hash = \\\" > "; P (opaParserVersion)]));
39997a8 @fperrin On FreeBSD, use md5, use md5sum elsewhere
fperrin authored
257 Cmd(S ( [Sh"cat"] @ files @ [Sh"|"; md5; Sh">>"; P opaParserVersion]));
fccc685 Initial open-source release
MLstate authored
258 Cmd(S ( [Sh"echo \\\" >>"; P opaParserVersion ] ))
259 ]
260 );
261
262 (* -- Internal use of built tools -- *)
263
264 rule " ofile"
265 ~deps:("%.of" :: tool_deps "ofile")
266 ~prod:"%.ml"
267 (fun env build ->
268 let dir = Pathname.dirname (env "%.of") in
269 build_list build (string_list_of_file (env "%.of"));
270 Cmd(S[get_tool "ofile"; A"-path"; P(Pathname.pwd / !Options.build_dir); P(env "%.of")]));
271
272 (* -- Proto rules -- *)
273
274 rule "proto_deps: proto -> proto.depends"
275 ~dep: "%.proto"
276 ~prod: "%.proto.depends"
277 (proto_deps "%.proto" "%.proto.depends");
278
279 rule "proto: proto & proto_depends -> ml & mli & trx_parse"
280 ~deps:("%.proto" :: "%.proto.depends" :: tool_deps "genproto")
281 ~prods: [ "%.ml" ; "%.mli" ; "%_parse.trx" ]
282 (fun env build ->
283 let dir = Pathname.dirname (env "%.proto") in
284 let proto_deps = (string_list_of_file (env "%.proto.depends")) in
285 if proto_deps <> [] then build_list build proto_deps;
286 Cmd(S[get_tool "genproto"
287 ; P (env "%.proto")
288 ; P dir
289 ; P (Pathname.basename (env "%"))
290 ; P (Pathname.basename (env "%") ^ "_parse")
291 ]));
292
293 (* -- Wsdl2ml rules -- *)
294
295 rule "wsdl2ml: wsdl -> types.ml"
296 ~deps:("%.wsdl" :: tool_deps "wsdl2ml")
297 ~prods: [ "%types.ml" ]
298 (fun env build ->
299 let dir = Pathname.dirname (env "%.wsdl") in
300 Cmd(S[get_tool "wsdl2ml"
301 ; P (env "%.wsdl")
302 ]));
303
304 (* -- Mlidl rules -- *)
305
306 rule "mlidl: mlidl -> types.ml & types.mli"
307 ~deps:("%.mlidl" :: tool_deps "mlidl")
308 ~prods: [ "%types.ml"; "%types.mli" ]
309 (fun env build ->
310 let dir = Pathname.dirname (env "%.mlidl") in
311 Cmd(S[get_tool "mlidl"
312 ; P (env "%.mlidl")
313 ]));
314
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
315 (* -- js validation -- *)
316 (*
317 TODO: enable all of them as soon as possible.
318 *)
319 let google_closure_compiler_options =
320 A"--warning_level" :: A"VERBOSE"::
321 (*
322 Turn on every available warning as errors.
323 Keep synchronized with the checker.
324 *)
325 (
326 List.fold_left (fun acc s -> A"--jscomp_error" :: A s :: acc)
327 [] [
328 "accessControls" ;
329 "checkRegExp" ;
330 (* "checkTypes" ; *)
331 "checkVars" ;
332 "deprecated" ;
333 "fileoverviewTags" ;
334 "invalidCasts" ;
335 "missingProperties" ;
336 (* "nonStandardJsDocs" ; *)
337 "strictModuleDepCheck" ;
338 "undefinedVars" ;
339 "unknownDefines" ;
340 "visibility" ;
341 ]
342 )
343 in
344
345 let js_checker =
346 let local = windows_mode in
347 A"java" :: A"-jar" :: (get_tool ~local "jschecker.jar") ::
348 (* A"--externs" :: (get_tool ~local "jschecker_externals.js") ::
349 A"--externs" :: (get_tool ~local "jschecker_jquery.js") ::
350 A"--externs" :: (get_tool ~local "jschecker_clientliblib.js") ::
351 A"--js_output_file" :: A output_file :: *)
352 google_closure_compiler_options (*@
353 A"--js" :: A clientlib ::
354 A"--js" :: A "opabsl/jsbsl/jquery_ext_bslanchor.extern.js" ::
355 A"--js" :: A "opabsl/jsbsl/jquery_ext_jQueryExtends.extern.js" ::
356 A"--js" :: A "opabsl/jsbsl/selection_ext_bsldom.extern.js" ::
357 A"--js" :: A "opabsl/jsbsl/jquery_extra.externs.js" ::
358 A"--js" :: A"qmlcps/qmlCpsClientLib.js" ::
359 []*)
360 in
361
362 (* -- opa plugin -- *)
363 (* -- plugin that fails to validate -- *)
364 let accept_js_validation_failure = []
365 in
366 (* -- file that are only needed for validation process -- *)
367 let jschecker_file s =
368 let prefix = "jschecker_" in
8135068 @OpaOnWindowsNow [fix] plugin: use _tag file to specify used lib of a plugin
OpaOnWindowsNow authored
369 try String.sub (Pathname.basename s) 0 (String.length prefix) = prefix with _ -> false
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
370 in
5f95972 @Aqua-Ye [feature] iconv: binded iconv in Opa
Aqua-Ye authored
371 let gen_tag prefix s =
372 let pfx = prefix ^ "_" in
373 let lenp = String.length pfx in
374 let t = try String.sub s 0 lenp = pfx with _ -> false in
8135068 @OpaOnWindowsNow [fix] plugin: use _tag file to specify used lib of a plugin
OpaOnWindowsNow authored
375 if t then Some(String.sub s lenp ((String.length s) -lenp))
376 else None
377 in
5f95972 @Aqua-Ye [feature] iconv: binded iconv in Opa
Aqua-Ye authored
378 let use_tag s = gen_tag "use" s in
379 let clib_tag s = gen_tag "clib" s in
8135068 @OpaOnWindowsNow [fix] plugin: use _tag file to specify used lib of a plugin
OpaOnWindowsNow authored
380 let opa_plugin_builder_name = "opa-plugin-builder-bin" in
381 let opa_plugin_builder = get_tool opa_plugin_builder_name in
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
382 let opp_build opa_plugin opp oppf env build =
8135068 @OpaOnWindowsNow [fix] plugin: use _tag file to specify used lib of a plugin
OpaOnWindowsNow authored
383 let dir = Pathname.dirname (env opa_plugin) in
384 let path = let p = Pathname.to_string dir in if p = "." then "" else p^"/" in
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
385 let files = string_list_of_file (env "%.opa_plugin") in
8135068 @OpaOnWindowsNow [fix] plugin: use _tag file to specify used lib of a plugin
OpaOnWindowsNow authored
386 let caml_use_lib = Tags.fold (fun tag list ->
387 match use_tag tag with
388 | None -> list
389 | Some dep -> dep::list
390 ) (tags_of_pathname (env "%.opa_plugin")) []
391 in
5f95972 @Aqua-Ye [feature] iconv: binded iconv in Opa
Aqua-Ye authored
392 let c_libs = Tags.fold (fun tag list ->
393 match clib_tag tag with
394 | None -> list
395 | Some dep -> dep::list
396 ) (tags_of_pathname (env "%.opa_plugin")) []
9c23f19 @Aqua-Ye [fix] iconv: add a pass to filter "system libs" in build_rules
Aqua-Ye authored
397 |> filter_system_libs
5f95972 @Aqua-Ye [feature] iconv: binded iconv in Opa
Aqua-Ye authored
398 in
8135068 @OpaOnWindowsNow [fix] plugin: use _tag file to specify used lib of a plugin
OpaOnWindowsNow authored
399 let lib_dir s = [A"--ml";A"-I";A"--ml";P (if Pathname.exists s then ".." / s else ("+"^s))] in
400 let include_dirs = List.flatten (List.map lib_dir caml_use_lib) in
5f95972 @Aqua-Ye [feature] iconv: binded iconv in Opa
Aqua-Ye authored
401 let clib s = [A"--ml";A"-cclib";A"--ml";A("-l"^s)] in
402 let include_libs = List.flatten (List.map clib c_libs) in
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
403 let files = List.map ((^) path) files in
404 build_list build files;
405 let files_validation, files_lib = List.partition jschecker_file files in
406 let files_lib = List.map (fun s -> P s) files_lib in
407 let plugin_name = Pathname.basename (env "%") in
408 let files_js = List.filter (fun f-> Pathname.check_extension f "js") files in
409 let js_validation = if files_js=[]
410 then [A"--js-validator-off"]
411 else (
412 let files_validation = List.flatten (List.map (fun s -> [A"--js-validator-file";P s]) files_validation) in
413 let unsafe_js = if List.mem plugin_name accept_js_validation_failure then [A"--unsafe-js"] else [] in
414 let js_checker = List.tl (List.flatten (List.map (fun opt -> [A"--js-validator-opt";opt]) js_checker)) in
415 unsafe_js @ [A"--js-validator"] @ js_checker @ files_validation
416 )
417 in
5f95972 @Aqua-Ye [feature] iconv: binded iconv in Opa
Aqua-Ye authored
418 let options = [A"--static" ; A"-o" ; P((Pathname.basename (env opp)))] @ include_dirs @ include_libs @js_validation @ files_lib in
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
419 Seq[Cmd(S(opa_plugin_builder::options));
420 Cmd(S[A"touch"; P(env oppf) ] )]
421 in
422 rule "opa_plugin_dir: opa_plugin -> oppf"
8135068 @OpaOnWindowsNow [fix] plugin: use _tag file to specify used lib of a plugin
OpaOnWindowsNow authored
423 ~deps:("%.opa_plugin" :: (tool_deps opa_plugin_builder_name))
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
424 ~prod:"%.oppf" (* use a dummy target because ocamlbuild don't want directory target *)
425 (opp_build "%.opa_plugin" "%" "%oppf")
426 ;
427
fccc685 Initial open-source release
MLstate authored
428
429
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
430 (* -- BSL compilation (using bslregister) -- *)
fccc685 Initial open-source release
MLstate authored
431 let ml_sources_bsl = dir_sources_bsl "opabsl/mlbsl" in
432 let js_sources_bsl = dir_sources_bsl "opabsl/jsbsl" in
433 let js_dest_bsl = dir_sources_bsl ~prefix:"opabslgen_" "opabsl/jsbsl" in
434 let mlstate_init_bsl = dir_sources_bsl "opabsl/mlstatebsl" in
435 let js_conf = "opabsl/jsbsl/bsl-sources.jsconf" in
436
437 (*
438 let rec ponctuate s f = function
439 | [] -> ""
440 | [ty] -> f ty
441 | ty::q -> ((f ty) ^ s) ^ ponctuate s f q
442 in
443
444 let _ = Printf.eprintf "js_sources_bsl: %s\n" (ponctuate ", " (fun x -> x) (List.map Ocamlbuild_plugin.Pathname.to_string js_sources_bsl)) in
445 let _ = Printf.eprintf "js_dest_bsl: %s\n" (ponctuate ", " (fun x -> x) (List.map Ocamlbuild_plugin.Pathname.to_string js_dest_bsl)) in
446 *)
447
448 (* TODO: this is not the way to LLVM, the C code is not usable as it is now *)
449 (* let c_sources_bsl = dir_sources_bsl "opabsl/cbsl" in *)
450
451 (* used for js-validation-only *)
452 rule "opabsl_sources"
453 ~deps: (js_conf :: ml_sources_bsl
454 @ js_sources_bsl
455 @ mlstate_init_bsl
456 @ tool_deps "opa-plugin-builder-bin")
457 ~prods: ((List.map (fun s -> "opabsl"/s)
458 ["opabslgenLoader.ml";"opabslgenPlugin.ml";
459 "opabslgen.bypass" ;
460 "opabslgenMLRuntime_x.ml";"opabslgenMLRuntime_x.mli";
461 "opabslgenJSkeys.js";
462 ])@js_dest_bsl)
463 begin fun env build ->
464 Seq[Cmd(S([Sh"cd opabsl && ";
465 get_tool "opa-plugin-builder-bin";
466 A"-o";P"opabslgen";
467 A"--no-opp";
468 A"--no-build";
469 A"--static";
470 ]
471 @special_bsl_options@
472 List.map (fun s -> P (".."/s)) (
473 js_conf ::
474 ml_sources_bsl
475 @js_sources_bsl
476 @mlstate_init_bsl
477 )));
478 mv "opabsl/opabslgenMLRuntime.ml" "opabsl/opabslgenMLRuntime_x.ml";
479 mv "opabsl/opabslgenMLRuntime.mli" "opabsl/opabslgenMLRuntime_x.mli";
480 ]
481 end;
482
483 rule "opa-bslgenMLRuntime interface validation"
484 ~deps: [
485 "opabsl/opabslgenMLRuntime_x.cmo";
486 "opabsl/js_validation/imp_client_lib.js";
487 "opabsl/js_validation/bsl.js";
488 ]
489 ~prod: "opabsl/opabslgenMLRuntime.ml"
490 (fun env build ->
491 Seq[
492 cp "opabsl/opabslgenMLRuntime_x.ml" "opabsl/opabslgenMLRuntime.ml";
493 ]
494 );
495
496 let js_pp_bsl = dir_sources_bsl ~prefix:"opabslgen_" ~suffix:".pp" "opabsl/jsbsl" in
497
498 rule "preprocess JS files for validation"
499 ~deps:((tool_deps "ppjs")@js_dest_bsl)
500 ~prods:js_pp_bsl
501 (fun env build ->
502 let ppjs = get_tool "ppjs" in
503 Cmd(S (ppjs::A"--output-suffix"::A ".pp"::List.map (fun x -> A x) js_dest_bsl))
504 );
505
506 rule "Client lib JS validation"
507 ~deps: (
508 "qmljsimp/qmlJsImpClientLib.js" ::
509 "qmlcps/qmlCpsClientLib.js" ::
c4cbaf9 @fpessaux [cleanup] js-warnings: Less warnings in Google closure compiler (10 r…
fpessaux authored
510 "opabsl/jsbsl/jquery_ext_bslanchor.extern.js" ::
511 "opabsl/jsbsl/jquery_ext_jQueryExtends.extern.js" ::
97f2e43 @fpessaux [cleanup] js-warnings: No more "undefined properties". Remaining 9 wa…
fpessaux authored
512 "opabsl/jsbsl/selection_ext_bsldom.extern.js" ::
59bd529 [enhance] jquery: updgrade to 1.6.4
François-Régis Sinot authored
513 "opabsl/jsbsl/jquery_extra.externs.js" ::
fccc685 Initial open-source release
MLstate authored
514 (tool_deps "jschecker.jar") @
515 (tool_deps "jschecker_externals.js") @
516 (tool_deps "jschecker_clientliblib.js") @
517 (tool_deps "jschecker_jquery.js") )
518 ~prods:[
519 "opabsl/js_validation/imp_client_lib.js";
520 ]
521 (fun env build ->
522 let run_check clientlib output_file =
523 let local = windows_mode in
524 [
525 Cmd(S [Sh"mkdir"; A"-p";P "opabsl/js_validation"]);
526 Cmd(S(
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
527 js_checker @
528 A"--externs" :: (get_tool ~local "jschecker_externals.js") ::
529 A"--externs" :: (get_tool ~local "jschecker_jquery.js") ::
530 A"--externs" :: (get_tool ~local "jschecker_clientliblib.js") ::
531 A"--js_output_file" :: A output_file ::
532 A"--js" :: A clientlib ::
533 A"--js" :: A "opabsl/jsbsl/jquery_ext_bslanchor.extern.js" ::
534 A"--js" :: A "opabsl/jsbsl/jquery_ext_jQueryExtends.extern.js" ::
535 A"--js" :: A "opabsl/jsbsl/selection_ext_bsldom.extern.js" ::
536 A"--js" :: A "opabsl/jsbsl/jquery_extra.externs.js" ::
537 A"--js" :: A"qmlcps/qmlCpsClientLib.js" ::
538 []
539 ))
fccc685 Initial open-source release
MLstate authored
540 ]
541 in
542 Seq (
543 run_check "qmljsimp/qmlJsImpClientLib.js" "opabsl/js_validation/imp_client_lib.js"
544 )
545 );
546
547 rule "opa-bslgenMLRuntime JS validation"
548 ~deps: (
549 (tool_deps "jschecker.jar")
550 @ (tool_deps "jschecker_externals.js")
551 @ (tool_deps "jschecker_jquery.js")
552 @ (tool_deps "jschecker_clientlib.js")
553 @ (tool_deps "jschecker_clientliblib.js")
554 @ (tool_deps "jschecker_cpsclientlib.js")
555 @ js_pp_bsl
c4cbaf9 @fpessaux [cleanup] js-warnings: Less warnings in Google closure compiler (10 r…
fpessaux authored
556 @ [ "opabsl/jsbsl/jquery_ext_bslanchor.extern.js" ;
557 "opabsl/jsbsl/jquery_ext_jQueryExtends.extern.js" ;
97f2e43 @fpessaux [cleanup] js-warnings: No more "undefined properties". Remaining 9 wa…
fpessaux authored
558 "opabsl/jsbsl/selection_ext_bsldom.extern.js" ;
59bd529 [enhance] jquery: updgrade to 1.6.4
François-Régis Sinot authored
559 "opabsl/jsbsl/jquery_extra.externs.js" ;
c4cbaf9 @fpessaux [cleanup] js-warnings: Less warnings in Google closure compiler (10 r…
fpessaux authored
560 "opabsl/opabslgenJSkeys.js" ]
fccc685 Initial open-source release
MLstate authored
561 )
562 ~prods: ["opabsl/js_validation/bsl.js"]
563 (fun env build ->
564 let arg_of_file file acc = match file with (*A very dumb filter to get rid of files that we just can't fix in the first place*)
27aabf1 @Aqua-Ye [enhance] jQuery: upgrading to 1.7.2
Aqua-Ye authored
565 | "opabsl/jsbsl/opabslgen_jquery-1.7.2.min.js.pp" -> acc
fccc685 Initial open-source release
MLstate authored
566 | "opabsl/jsbsl/opabslgen_json2.js.pp" -> acc
567 | _ -> A "--js" :: A file :: acc
568 in
569 let get_tool = get_tool ~local:windows_mode in
570 Seq[
571 Cmd(S [Sh"mkdir";A"-p";P "opabsl/js_validation"]);
572 Cmd(S(
573 A"java" :: A"-jar" :: (get_tool "jschecker.jar") ::
574 A"--externs" :: (get_tool "jschecker_externals.js") ::
575 A"--externs" :: (get_tool "jschecker_clientliblib.js") ::
576 A"--externs" :: (get_tool "jschecker_clientlib.js") ::
577 A"--externs" :: (get_tool "jschecker_jquery.js") ::
578 A"--externs" :: (get_tool "jschecker_cpsclientlib.js") ::
c4cbaf9 @fpessaux [cleanup] js-warnings: Less warnings in Google closure compiler (10 r…
fpessaux authored
579 A"--externs" :: A "opabsl/jsbsl/jquery_ext_bslanchor.extern.js" ::
580 A"--externs" :: A "opabsl/jsbsl/jquery_ext_jQueryExtends.extern.js" ::
97f2e43 @fpessaux [cleanup] js-warnings: No more "undefined properties". Remaining 9 wa…
fpessaux authored
581 A"--externs" :: A "opabsl/jsbsl/selection_ext_bsldom.extern.js" ::
59bd529 [enhance] jquery: updgrade to 1.6.4
François-Régis Sinot authored
582 A"--externs" :: A "opabsl/jsbsl/jquery_extra.externs.js" ::
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
583 A"--js_output_file" :: A "opabsl/js_validation/bsl.js" ::
fccc685 Initial open-source release
MLstate authored
584 google_closure_compiler_options @
585 (List.fold_right (fun s acc -> arg_of_file s acc) js_pp_bsl [])
586 @ [ A"--js" ; A "opabsl/opabslgenJSkeys.js" ]
587 ))]
588 );
589
590 (*
591 -The documentation generator does not work if files are not suffixed with '.js'
592 -But, we do not need to preprocess the opabslgen_ files with ppjs,
593 as for JS validation (files js_pp_bsl)
594 -We simply use the files opabslgen_ for generating the doc. It is obtained from
595 the origin js file, and with a resolution of bsl directives (+ generation of additionnal
596 type directive for the js validation
597
598 Configuration stuff for jsdoc generator.
599 Needs to access lots of files. Cf jsdocdir/README.txt
600 *)
601 let jsdocdir =
602 let opageneral = Pathname.to_string Pathname.pwd in
603 opageneral ^ "/tools/jsdoc-toolkit"
604 in
605
606 let jsdoc_target = "doc.jsbsl" in
607
608 rule "opa-bslgenMLRuntime JS documentation"
609 ~deps: (
610 js_dest_bsl
611 )
612 ~prods: (
613 [ jsdoc_target ^ "/index.html" ]
614 )
615 (fun env build ->
616 Cmd(S(
617 A"java" ::
618 A("-Djsdoc.dir="^jsdocdir) ::
619 A("-Djsdoc.template.dir="^jsdocdir^"/templates") ::
620 A"-jar" ::
621 A(jsdocdir^"/jsrun.jar") :: A(jsdocdir^"/app/run.js") ::
622 A("-t="^(jsdocdir^"/templates/jsdoc")) ::
623 A("--allfunctions") ::
624 (* Set the target directory *)
625 A("-d="^jsdoc_target) ::
626 (List.map (fun js -> A js) js_dest_bsl)
627 ))
628 );
629
630
631 (* ------------------------------------------------------------------ *)
632 (* Additional rules: final compilation (compiling using our backends) *)
633 (* ------------------------------------------------------------------ *)
634
635 (* -- OPA compiler rules -- *)
636
637 let stdlib_packages_dir = "stdlib" in
638
639 let opaopt = try Sh(Sys.getenv "OPAOPT") with Not_found -> N in
640
641 let opacomp_deps_js = string_list_of_file "opa-run-js-libs.itarget" in
642 let opacomp_deps_native = string_list_of_file "opa-run-libs.itarget" in
643 let opacomp_deps_byte = List.map (fun l -> Pathname.update_extension "cma" l) opacomp_deps_native in
644
645 let opacomp_deps_native = opacomp_deps_native @ opacomp_deps_js in
646 let opacomp_deps_byte = opacomp_deps_byte @ opacomp_deps_js in
647
648 let opa_prefix = Pathname.pwd / !Options.build_dir in
649
650 let opa_libs_dir = "lib" / "opa" / "static" in
651
652 let opa_share_dir = "share" / "opa" in
653
654 let copy_lib_to_runtime lib =
655 let modules = string_list_of_file (lib -.- "mllib") in
656 let files =
657 List.fold_left
658 (fun acc f ->
659 let dir, modl = Pathname.dirname f, Pathname.basename f -.- "cmi" in
660 List.filter (fun m -> Pathname.exists (opa_prefix / m))
661 [dir / String.uncapitalize modl; dir / String.capitalize modl] @ acc)
662 [] modules
663 in
664 let stubs =
665 List.map (Pathname.update_extension !Options.ext_lib) (dir_ext_files "clib" (mlstate_lib_dir lib))
666 in
667 let files = stubs @ files in
668 Cmd(S(link_cmd :: List.map (fun f -> P (opa_prefix / f)) files @ [ P (opa_prefix / opa_libs_dir) ]))
669 in
670
671 rule "opa run-time libraries"
672 ~deps:("libbase"/"mimetype_database.xml" :: opacomp_deps_native)
673 ~stamp:"runtime-libs.stamp"
674 (fun _env _build ->
675 let mllibs = List.filter (fun f -> Pathname.check_extension f "cmxa") opacomp_deps_native in
676 let mllibs = List.map Pathname.remove_extension mllibs in
677 let copylibs = List.map copy_lib_to_runtime mllibs in
678 Seq[
679 Cmd(S[Sh"rm"; A"-rf"; P (opa_prefix / opa_libs_dir)]);
680 Cmd(S[Sh"mkdir"; A"-p"; P (opa_prefix / opa_libs_dir)]);
681 Cmd(S[Sh"rm"; A"-rf"; P (opa_prefix / opa_share_dir)]);
682 Cmd(S[Sh"mkdir"; A"-p"; P (opa_prefix / opa_share_dir)]);
683 Cmd(S(link_cmd :: List.map (fun f -> P (opa_prefix / f)) opacomp_deps_native
684 @ [ P (opa_prefix / opa_libs_dir) ]));
685 Cmd(S(link_cmd :: List.map (fun f -> P (opa_prefix / f -.- !Options.ext_lib)) mllibs
686 @ [ P (opa_prefix / opa_libs_dir) ]));
687 Cmd(S(link_cmd :: P (opa_prefix / "libbase" / "mimetype_database.xml") :: [ P (opa_prefix / opa_share_dir / "mimetype_database.xml") ]));
688 Seq copylibs
689 ]
690 );
691
692 let opacomp build src dst_ext opt =
693 build_list build
694 (List.map ((/) (Pathname.dirname src)) (string_list_of_file (src-.-"depends")));
695 let dst = Pathname.update_extension dst_ext src in
696 Cmd(S[
697 Sh("MLSTATELIBS=\""^ opa_prefix ^"\"");
698 get_tool "opa-bin"; opt;
699 A"--verbose";(* A"--no-opa-walker"; *)
700 opaopt;
701 A"-o"; P dst; P src
702 ])
703 in
704
705 rule "opa and server dependencies"
706 ~deps:("runtime-libs.stamp" :: tool_deps "opa-bin")
707 ~stamp:"opacomp.stamp"
708 (fun env build -> Nop);
709
710 rule "opackdep: .opack -> .opack.depends"
711 ~dep:"%.opack"
712 ~prod:"%.opack.depends"
713 (fun env build ->
714 Cmd(S[P"grep"; A"-v"; A"^\\w*-"; P(env "%.opack"); Sh">"; P(env "%.opack.depends"); Sh"|| true"]));
715
716 (* A rule to build applications using the stdlib (e.g. opadoc) *)
717 rule "opacomp: .opack -> .native"
718 ~deps: ("%.opack"::"%.opack.depends"::"opa-packages.stamp"::"opacomp.stamp"::[])
719 ~prod: "%.native"
720 (fun env build ->
721 let dir = Pathname.dirname (env "%") in
722 let mano_depends = Pathname.pwd / (env "%.depends") in
723 if Pathname.exists mano_depends then (
724 build_list build (List.map ((/) dir) (string_list_of_file mano_depends))
725 );
726 build_list build (List.map ((/) dir) (string_list_of_file (env "%.opack.depends")));
727 opacomp build (env "%.opack") "native"
5e9da00 @BourgerieQuentin [enhance] compiler, syntax: Default syntax is now js-like
BourgerieQuentin authored
728 (S[ A"-I" ; P stdlib_packages_dir ; A"--project-root" ; P dir; A"--parser"; A"classic";]));
fccc685 Initial open-source release
MLstate authored
729
730 rule "opacomp: .opack -> .byte"
731 ~deps: ("%.opack"::"%.opack.depends"::"opa-packages.stamp"::"opacomp-byte.stamp"::[])
732 ~prod: "%.byte"
733 (fun env build ->
734 let dir = Pathname.dirname (env "%") in
735 build_list build (List.map ((/) dir) (string_list_of_file (env "%.opack.depends")));
736 opacomp build (env "%.opack") "byte" (S[A"-I";P stdlib_packages_dir]));
737 (*
738 (A"--bytecode"));
739 Used to give this option to opa-bin, but since the opa package are build by ocamlbuild,
740 we do not generated bytecode version of opa-packages, making the bytecode compilation
741 of server not available anymore.
742 *)
743
744 (* temporary and unreliable *)
745 rule "opadep: .opa -> .opa.depends"
746 ~dep: "%.opa"
747 ~prod: "%.opa.depends"
748 (fun env build ->
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
749 let dep_opx_regex = "^ *import \\*\\(.\\+\\) *$" in
750 let dep_opp_regex = "^ *import-plugin \\*\\(.\\+\\) *$" in
751 let sed_dep dep_regex redir dest = S[sed; A"-n"; A("s%"^dep_regex^"%\\1.opx%p"); P(env "%.opa"); Sh redir; P dest] in
752 Seq[
753 Cmd(sed_dep dep_opp_regex ">" (env "%.opa.depends"));
754 Cmd(sed_dep dep_opx_regex ">>" (env "%.opa.depends"))
755 ]
756 )
757 ;
fccc685 Initial open-source release
MLstate authored
758
759 rule "opacomp: .opa -> .native"
760 ~deps: ("%.opa"::"%.opa.depends"::"opacomp.stamp"::[])
761 ~prod: "%.native"
762 (fun env build -> opacomp build (env "%.opa") "native" N);
763
764 rule "opacomp: .opa -> .byte"
765 ~deps: ("%.opa"::"%.opa.depends"::"opacomp-byte.stamp"::[])
766 ~prod: "%.byte"
767 (fun env build -> opacomp build (env "%.opa") "byte" (A"--bytecode"));
768
769 rule "opa bash_completion: opa-bin -> bash_completion"
770 ~deps: (tool_deps "opa-bin")
771 ~prod: "bash_completion"
772 (fun env build ->
773 Seq[Cmd(S[get_tool "opa-bin"; A"--bash-completion"])]);
774
775 (* -- OPA packages -- *)
776
777 let package_to_dir s0 =
778 let s = String.copy s0 in
779 for i = 0 to String.length s - 1 do
780 if s.[i] = '.' then s.[i] <- '/'
781 done;
782 s
783 in
784 let dir_to_package s0 =
785 let s = String.copy s0 in
786 let len_std = String.length stdlib_packages_dir in
787 let pfx,s = (* remove optional stdlib_packages_dir prefix *)
788 try
789 let pfx = String.sub s 0 len_std in
790 if pfx = stdlib_packages_dir
791 then pfx, String.sub s (len_std + 1) (String.length s - len_std - 1)
792 else "", s
793 with Invalid_argument _ -> "", s
794 in
795 for i = 0 to String.length s - 1 do
796 if s.[i] = '/' then s.[i] <- '.'
797 done;
798 pfx, s
799 in
800
801 let module RuleFailure = struct exception E end in
802 let files_of_package pkg =
803 let pkdir = package_to_dir pkg in
804 if not (Pathname.is_directory (Pathname.pwd / pkdir)) then
805 let () = Printf.eprintf "Error: can not find sources for package %s (directory %s does not exist)\n" pkg pkdir in
806 raise RuleFailure.E
807 else
808 let opack = dir_ext_files "opack" (Pathname.pwd / pkdir) in
809 let files = dir_ext_files "opa" (Pathname.pwd / pkdir) in
810 let files = files @ opack in
811 (*
812 return relative filenames
813 *)
814 let files =
815 let len = String.length Pathname.pwd + 1 in (* the additinal '/' *)
816 let relative_part s = String.sub s len (String.length s - len) in
817 List.map relative_part files
818 in
819 (*
820 When you compare 2 branches, if the order of opa sources is not deterministic, you can become crazy
821 *)
822 let files = List.sort String.compare files in
823 files in
824
825 let make_all_packages = stdlib_packages_dir/"all_packages.sh" in
826 let all_packages_file = stdlib_packages_dir/"all.packages" in
827
828 rule "all.packages"
829 ~dep: make_all_packages
830 ~prod: all_packages_file
831 (fun env build ->
832 Cmd(S[
833 Sh"cd"; P (Pathname.pwd / stdlib_packages_dir); Sh"&&";
834 P"./all_packages.sh"; Sh">"; P (Pathname.pwd / !Options.build_dir / all_packages_file);
835 ])
836 );
837
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
838 let make_all_plugins = stdlib_packages_dir/"all_plugins.sh" in
839 let all_plugins_file = stdlib_packages_dir/"all.plugins" in
840
841 rule "all.plugins"
842 ~dep: make_all_plugins
843 ~prod: all_plugins_file
844 (fun env build ->
845 Cmd(S[
846 Sh"cd"; P (Pathname.pwd / stdlib_packages_dir); Sh"&&";
847 P"./all_plugins.sh"; Sh">"; P (Pathname.pwd / !Options.build_dir / all_plugins_file);
848 ])
849 );
850
851
852
fccc685 Initial open-source release
MLstate authored
853 let package_building ~name ~stamp ~stdlib_only ~rebuild =
854 rule name
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
855 ~deps:[opacapi_validation;all_plugins_file;all_packages_file;"opacomp.stamp"]
fccc685 Initial open-source release
MLstate authored
856 ~stamp
857 ~prod:"i_dont_exist" (* forces ocamlbuild to always run the command *)
858 (fun env build ->
859 try
7178477 @OpaOnWindowsNow [feature] plugin: activate compilation of stdlib imported plugins
OpaOnWindowsNow authored
860 let plugins = string_list_of_file all_plugins_file in
861 let plugins = List.map (fun f -> "plugins" / f / f -.- "oppf") plugins in
862 build_list build plugins;
fccc685 Initial open-source release
MLstate authored
863 let packages = string_list_of_file all_packages_file in
864 let packages =
865 if stdlib_only
866 then
867 let stdlib = "stdlib.core" in
868 List.filter (fun package ->
869 String.length package > String.length stdlib &&
870 stdlib = String.sub package 0 (String.length stdlib)) packages
871 else packages in
872 let list_package_files = List.map
873 (fun pkg ->
874 let files = files_of_package pkg in
875 (*
876 Copy in _build the opa files of the packages.
877 In this way, files given to the compiler are relative,
878 and api files are generated in the _build
879 This makes also that the packages does not contain absolute filename,
880 which is not valid wrt the deb checker.
881 *)
882 build_list build files;
883 (pkg, files)) packages in
884 let conf =
885 List.concat (
886 List.map
887 (fun (pkg, files) ->
888 (pkg ^ ":\n") ::
889 (
890 (* auto import *)
891 let prefix = "stdlib.core" in
892 let len = String.length prefix in
893 if String.length pkg >= String.length prefix && String.sub pkg 0 len = prefix
894 then (
895 if pkg = prefix
896 then ""
897 else
898 (* subdirectory of stdlib.core import stdlib.core *)
716e24d @OpaOnWindowsNow [fix] build_rules.ml,stdlib,conf: better indentation
OpaOnWindowsNow authored
899 " import stdlib.core\n"
fccc685 Initial open-source release
MLstate authored
900 )
901 else " import stdlib.core\n import stdlib.core.*\n"
902 ) ::
903 List.map (fun file -> " " ^ file ^ "\n") files)
904 list_package_files
905 ) in
ec3e51c @OpaOnWindowsNow [enhance] build_rules,stdlib: use --conf-opa-files for the stdlib
OpaOnWindowsNow authored
906 let all_files =
907 (*List.concat (List.map (fun (_,files) -> List.map (fun f -> P f) files) list_package_files)*)
908 [A"--conf-opa-files"]
909 in
fccc685 Initial open-source release
MLstate authored
910 let rebuild_opt = if rebuild then [A"--rebuild"] else [] in
911 Seq[
912 Echo(conf, "conf");
913 Cmd(S([Sh("MLSTATELIBS=\""^ opa_prefix ^"\"");
914 get_tool "opa-bin";
915 A"--autocompile";
916 (* A"--verbose-build"; *)
917 A"--conf";P "conf";
2a526dc @OpaOnWindowsNow [fix] build_rules.ml: disable slicer check for stdlib
OpaOnWindowsNow authored
918 A"--slicer-check"; A "low";
fccc685 Initial open-source release
MLstate authored
919 A"--warn-error"; A"root";
920 A"--project-root"; P Pathname.pwd; (* because the @static_resource in the stdlib expect this *)
921 A"--no-stdlib";
5e9da00 @BourgerieQuentin [enhance] compiler, syntax: Default syntax is now js-like
BourgerieQuentin authored
922 A"--parser"; A"classic";
fccc685 Initial open-source release
MLstate authored
923 opaopt;
924 S all_files;
925 ] @ rebuild_opt));
926 ]
927 with RuleFailure.E ->
928 fail_rule build
929 ) in
930
931 package_building
932 ~name:"opa-packages: meta-rule to build all .opx"
933 ~stamp:"opa-packages.stamp"
934 ~stdlib_only:false
935 ~rebuild:false;
936
937 package_building
938 ~name:"opa-stdlib-packages: meta-rule to build all the stdlib .opx"
939 ~stamp:"opa-stdlib-packages.stamp"
940 ~stdlib_only:true
941 ~rebuild:false;
942
943 () (* This file should be an expr of type unit *)
Something went wrong with that request. Please try again.