forked from ocsigen/js_of_ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.conf
78 lines (54 loc) · 2.1 KB
/
Makefile.conf
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
# Where binaries are installed:
BINDIR := `dirname \`which ocamlc\``
####
EXEEXT := $(shell ocamlc -config | (grep -q -E "system: (win|mingw)" && echo ".exe"))
OBJEXT := .o
LIBEXT := .a
DLLEXT := .so
####
LIBRARY := js_of_ocaml
COMPILER := js_of_ocaml$(EXEEXT)
MINIFIER := jsoo_minify$(EXEEXT)
LINKER := jsoo_link$(EXEEXT)
MKTOP := jsoo_mktop$(EXEEXT)
MKCMIS := jsoo_mkcmis$(EXEEXT)
LISTUNITS := jsoo_listunits$(EXEEXT)
PPX := ppx_js$(EXEEXT)
NATIVE ?= YES
NATIVE_DYN ?= $(shell if [ -f `ocamlc -where`/dynlink.cmxa ]; then echo YES; else echo NO; fi)
# opt/byte
ifeq "$(NATIVE)" "YES"
BEST := opt
else
BEST := byte
endif
DOCOPT := -colorize-code -short-functors -charset utf-8
####
ifeq ($(shell ocamlc -config | grep -q "architecture: i386"; echo $$?),0)
ARCH_32BIT=YES
endif
ifeq ($(shell ocamlc -safe-string 2> /dev/null ; echo $$?),0)
SAFESTRING=-safe-string
else
SAFESTRING=-package bytes
endif
### Optional dependencies: deriving
WITH_DERIVING ?= $(shell if [ -f `ocamlfind query deriving 2> /dev/null`/deriving.cma ]; then echo YES; else echo NO; fi)
WITH_GRAPHICS ?= $(shell if [ -f `ocamlfind query graphics 2> /dev/null`/graphics.cmi ]; then echo YES; else echo NO; fi)
WITH_REACT ?= $(shell if [ -f `ocamlfind query reactiveData 2> /dev/null`/reactiveData.cma ]; then echo YES; else echo NO; fi)
WITH_TYXML ?= $(shell if [ -f `ocamlfind query tyxml 2> /dev/null`/tyxml_f.cma ]; then echo YES; else echo NO; fi)
WITH_FINDLIB?=YES
WITH_LWT?=YES
WITH_PPX_TOOLS ?= $(shell if [ -f `ocamlfind query ppx_tools 2> /dev/null`/ppx_tools.cma ]; then echo YES; else echo NO; fi)
WITH_PPX_DERIVING ?= $(shell if [ -f `ocamlfind query ppx_deriving 2> /dev/null`/ppx_deriving.cma ]; then echo YES; else echo NO; fi)
##disabled for ocaml < 4.02.2
ifeq "${WITH_PPX_TOOLS}" "YES"
ifneq ($(shell ocamlc -version | grep -q -E "4.02.[01]"; echo $$?),0)
WITH_PPX?=YES
WITH_TOPLEVEL=YES
endif
endif
WITH_CAMLP4 ?= $(shell if [ -f `ocamlfind query camlp4.extend 2> /dev/null`/Camlp4Parsers/Camlp4GrammarParser.cmo ]; then echo YES; else echo NO; fi)
METAOCAML ?= 0
%.ml: %.cppo.ml
cppo $< -o $@ -V OCAML:`ocamlc -version`