-
Notifications
You must be signed in to change notification settings - Fork 0
/
dune
81 lines (74 loc) · 2.11 KB
/
dune
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
(env
(dev
(flags (:standard
-strict-formats ;; Disallows legacy formats.
-strict-sequence ;; Enforces the lhs of a sequence to have type `unit'.
-safe-string ;; Immutable strings.
-annot ;; Dumps information per (file) module about types, bindings, tail-calls, etc. Used by some tools.
-warn-error -a ;; Do not treat warnings as errors.
-w A-4-42-44-45-48-60-67 ;; Ignores warnings 4, 42, 44, 45, 48, 60, and 67.
-g ;; Adds debugging information to the resulting executable / library.
)))
(release
(flags (:standard
;; The following flags are the same as for the "dev" profile.
-strict-formats -strict-sequence -safe-string -annot
-w A-4-42-44-45-48-60-67 ;; Ignores warnings 4, 42, 44, 45, 48, 60, and 67.
))
(ocamlopt_flags (:standard
-O3 ;; Applies (aggressive) optimisations to the resulting executable.
)))
)
;; COMPILER LIBS package ;;
;; Common
(copy_files# common/*.ml{,i})
(library
(name hx_common)
(public_name hx-compiler-libs.common)
(modules settings
input_output))
;; Text
(copy_files text/*.mly)
(copy_files# text/*.ml{,i,l})
(library
(name hx_text)
(public_name hx-compiler-libs.text)
(wrapped true)
(modules lexer parser incparser)
(libraries menhirLib))
(ocamllex
(modules lexer))
(menhir
(modules parser)
(flags --strict))
(menhir
(modules incparser)
(flags --strict --table))
; Syntax error messages
(rule
(targets parser_messages.ml)
(deps parser.messages parser.mly)
(action (with-stdout-to %{targets} (run menhir --compile-errors %{deps}))))
;; Bundle everything into `Hx` compiler libs
(copy_files# compilerlibs/hx.ml{,i})
(library
(name hx)
(public_name hx-compiler-libs)
(wrapped false)
(modules hx)
(libraries
(re_export hx-compiler-libs.common)
(re_export hx-compiler-libs.text)
))
;; EXECUTABLES ;;
;; Main driver
(copy_files# driver/*.ml{,i})
(executable
(name main)
(public_name hx)
(modes native)
(libraries stdlib hx-compiler-libs)
(modules main repl)
(package hx))
(rule
(copy main.exe hx))