-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.ocp2
47 lines (37 loc) · 1.33 KB
/
build.ocp2
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
(****************************************************************************
#
# This file is managed by ocp-autoconf.
#
# Remove it from `manage_files` in 'ocp-autoconf.config' if you want to
# modify it manually.
#
****************************************************************************)
Sys = { file_exists = Sys_file_exists };
oflags = [ "-w"; "+a-48-4"; ];
ocaml.bytecomp = oflags;
ocaml.asmcomp = oflags;
include "autoconf/config.ocp2gen";
ocaml.version = autoconf.package_version;
base64_3 = false;
filename_ocp2 = "ocp-autoconf.d/build.ocp2inc";
if( Sys.file_exists(dirname + "/" + filename_ocp2) ){ include filename_ocp2; }
filename_ocp2 = "ocp-autoconf.d/config.ocp2inc";
if( Sys.file_exists(dirname + "/" + filename_ocp2) ){ include filename_ocp2; }
pp_js = { pp = [ "%{js_of_ocaml-ppx_SRC_DIR}%/ppx.exe"; "--as-pp" ] };
function js_program(name, file, libs){
OCaml.program(name, ocaml + {
has_asm = false;
requires = libs;
files = [ file, pp_js ];
build_rules = [
"%{" + name + "_FULL_DST_DIR}%/" + name + ".js", {
build_target = true;
sources = [ "%{" + name + "_FULL_DST_DIR}%/" + name + ".byte" ];
commands = [
OCaml.system([
"js_of_ocaml";
"--pretty";
"%{" + name + "_FULL_DST_DIR}%/" + name + ".byte";
])]}]
});
}