forked from xapi-project/xen-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
OMakeroot
115 lines (97 loc) · 3.95 KB
/
OMakeroot
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
########################################################################
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this file, to deal in the File without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the File, and to permit persons to whom the
# File is furnished to do so, subject to the following condition:
#
# THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
# THE USE OR OTHER DEALINGS IN THE FILE.
########################################################################
# The standard OMakeroot file.
# You will not normally need to modify this file.
# By default, your changes should be placed in the
# OMakefile in this directory.
#
# If you decide to modify this file, note that it uses exactly
# the same syntax as the OMakefile.
#
#
# Include the standard installed configuration files.
# Any of these can be deleted if you are not using them,
# but you probably want to keep the Common file.
#
open build/C
open build/OCaml
open build/LaTeX
# Other C libraries - used when making .cma or .cmxa libraries.
# Should be of the form '-cclib -lpam' or such like
OTHER_CLIBS=
#
# The command-line variables are defined *after* the
# standard configuration has been loaded.
#
DefineCommandVars()
OCamlLibraryClib(name, files, clibs) =
name = $(file $(name))
OFILES = $(addsuffix $(EXT_OBJ), $(files))
CMOFILES = $(addsuffix .cmo, $(files))
CMXFILES = $(addsuffix .cmx, $(files))
CLIB = $(file $(name)$(EXT_LIB))
BYTELIB = $(file $(name).cma)
NATIVELIB = $(file $(name).cmxa)
__BYTE_CLIBS = $(addsuffix $(EXT_LIB), $(clibs))
__NATIVE_CLIBS = $(addsuffix $(EXT_LIB), $(clibs))
_BYTE_CLIBS = $(addprefix $(absname $(CWD))/, $(__BYTE_CLIBS))
_NATIVE_CLIBS = $(addprefix $(absname $(CWD))/, $(__NATIVE_CLIBS))
BYTE_CLIBS = $(mapprefix -cclib, $(_BYTE_CLIBS))
NATIVE_CLIBS = $(mapprefix -cclib, $(_NATIVE_CLIBS))
#
# Link commands
#
$(BYTELIB): $(CMOFILES) $(_BYTE_CLIBS)
$(OCAMLFIND) $(OCAMLLINK) $(LAZY_OCAMLFINDFLAGS) $(OCAMLFLAGS) $(OCAMLCFLAGS) \
$(OCAML_LIB_FLAGS) -a -o $@ $(OCamlLinkSort $(CMOFILES)) -custom $(BYTE_CLIBS) $(OCAML_LINK_FLAGS) $(OTHER_CLIBS)
$(NATIVELIB) $(CLIB): $(CMXFILES) $(OFILES) $(_NATIVE_CLIBS)
$(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(OCAMLFLAGS) $(OCAMLOPTFLAGS) \
$(OCAML_LIB_FLAGS) -a -o $(NATIVELIB) $(OCamlLinkSort $(CMXFILES)) $(NATIVE_CLIBS) $(OTHER_CLIBS)
return $(array $(if $(NATIVE_ENABLED), $(NATIVELIB)), $(if $(NATIVE_ENABLED), $(CLIB)), $(if $(BYTE_ENABLED), $(BYTELIB)))
#
# The documentation generator
#
OCAMLDOC = ocamldoc
#
# Generation of documentation from .ml or .mli files
#
OCamlDoc(name, modules, type) =
private.CMIFILES = $(addsuffix .cmi, $(modules))
.PHONY: doc
dir = $(ROOT)/ocaml/doc
doc: $(CMIFILES) $(ROOT)/ocaml/doc/odoc_json.cma
python $(ROOT)/ocaml/doc/doc.py $(dir) $(name) $(type) "$(modules)" "$(OCAMLINCLUDES)" "$(OCAMLPACKS)" "$(OCAML_LIBS)"
OCamlDocProgram(name, modules) =
OCamlDoc($(name), $(modules), "program")
OCamlDocLibrary(name, modules) =
OCamlDoc($(name), $(modules), "library")
OCamlDocPackage(name, modules) =
OCamlDoc($(name), $(modules), "package")
#
# Use Camlp4
#
UseCamlp4(packs, files) =
OCAMLPACKS += $(packs)
OCAMLFINDFLAGS += -syntax camlp4o
$(addsuffix .cmx, $(files)):
$(addsuffix .o, $(files)):
$(addsuffix .cmi, $(files)):
$(addsuffix .cmo, $(files)):
#
# Include the OMakefile in this directory.
#
.SUBDIRS: .