Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 116 lines (97 sloc) 4.04 kB
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored
1 ########################################################################
2 # Permission is hereby granted, free of charge, to any person
3 # obtaining a copy of this file, to deal in the File without
4 # restriction, including without limitation the rights to use,
5 # copy, modify, merge, publish, distribute, sublicense, and/or
6 # sell copies of the File, and to permit persons to whom the
7 # File is furnished to do so, subject to the following condition:
8 #
9 # THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
10 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
11 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
12 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
13 # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
15 # THE USE OR OTHER DEALINGS IN THE FILE.
16
17 ########################################################################
18 # The standard OMakeroot file.
19 # You will not normally need to modify this file.
20 # By default, your changes should be placed in the
21 # OMakefile in this directory.
22 #
23 # If you decide to modify this file, note that it uses exactly
24 # the same syntax as the OMakefile.
25 #
26
27 #
28 # Include the standard installed configuration files.
29 # Any of these can be deleted if you are not using them,
30 # but you probably want to keep the Common file.
31 #
32 open build/C
33 open build/OCaml
34 open build/LaTeX
35
36 # Other C libraries - used when making .cma or .cmxa libraries.
37 # Should be of the form '-cclib -lpam' or such like
38 OTHER_CLIBS=
39
40 #
41 # The command-line variables are defined *after* the
42 # standard configuration has been loaded.
43 #
44 DefineCommandVars()
45
46 OCamlLibraryClib(name, files, clibs) =
47 name = $(file $(name))
48
49 OFILES = $(addsuffix $(EXT_OBJ), $(files))
50 CMOFILES = $(addsuffix .cmo, $(files))
51 CMXFILES = $(addsuffix .cmx, $(files))
52
53 CLIB = $(file $(name)$(EXT_LIB))
54 BYTELIB = $(file $(name).cma)
55 NATIVELIB = $(file $(name).cmxa)
56
57 __BYTE_CLIBS = $(addsuffix $(EXT_LIB), $(clibs))
58 __NATIVE_CLIBS = $(addsuffix $(EXT_LIB), $(clibs))
59 _BYTE_CLIBS = $(addprefix $(absname $(CWD))/, $(__BYTE_CLIBS))
60 _NATIVE_CLIBS = $(addprefix $(absname $(CWD))/, $(__NATIVE_CLIBS))
61 BYTE_CLIBS = $(mapprefix -cclib, $(_BYTE_CLIBS))
62 NATIVE_CLIBS = $(mapprefix -cclib, $(_NATIVE_CLIBS))
63
64 #
65 # Link commands
66 #
67 $(BYTELIB): $(CMOFILES) $(_BYTE_CLIBS)
68 $(OCAMLFIND) $(OCAMLLINK) $(LAZY_OCAMLFINDFLAGS) $(OCAMLFLAGS) $(OCAMLCFLAGS) \
69 $(OCAML_LIB_FLAGS) -a -o $@ $(OCamlLinkSort $(CMOFILES)) -custom $(BYTE_CLIBS) $(OCAML_LINK_FLAGS) $(OTHER_CLIBS)
70
71 $(NATIVELIB) $(CLIB): $(CMXFILES) $(OFILES) $(_NATIVE_CLIBS)
72 $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(OCAMLFLAGS) $(OCAMLOPTFLAGS) \
73 $(OCAML_LIB_FLAGS) -a -o $(NATIVELIB) $(OCamlLinkSort $(CMXFILES)) $(NATIVE_CLIBS) $(OTHER_CLIBS)
74
75 return $(array $(if $(NATIVE_ENABLED), $(NATIVELIB)), $(if $(NATIVE_ENABLED), $(CLIB)), $(if $(BYTE_ENABLED), $(BYTELIB)))
76
77 #
78 # The documentation generator
79 #
80 OCAMLDOC = ocamldoc
81
82 #
83 # Generation of documentation from .ml or .mli files
84 #
6c88bd8 @robhoes [ocamldoc] Several improvements
robhoes authored
85 OCamlDoc(name, modules, type) =
bfcc539 @robhoes New ocamldoc generator and infrastructure
robhoes authored
86 private.CMIFILES = $(addsuffix .cmi, $(modules))
a1c3dc9 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored
87 .PHONY: doc
39c48cb @robhoes [ocamldoc] Various fixes in mli-files and OMakefiles for ocamldoc
robhoes authored
88 dir = $(ROOT)/ocaml/doc
bfcc539 @robhoes New ocamldoc generator and infrastructure
robhoes authored
89 doc: $(CMIFILES) $(ROOT)/ocaml/doc/odoc_json.cma
6c88bd8 @robhoes [ocamldoc] Several improvements
robhoes authored
90 python $(ROOT)/ocaml/doc/doc.py $(dir) $(name) $(type) "$(modules)" "$(OCAMLINCLUDES)" "$(OCAMLPACKS)" "$(OCAML_LIBS)"
91
92 OCamlDocProgram(name, modules) =
93 OCamlDoc($(name), $(modules), "program")
0eb627f @robhoes Add RPC client to use with rpc-light
robhoes authored
94
6c88bd8 @robhoes [ocamldoc] Several improvements
robhoes authored
95 OCamlDocLibrary(name, modules) =
96 OCamlDoc($(name), $(modules), "library")
71d2b50 @robhoes Generate API docs in JSON format
robhoes authored
97
0eb627f @robhoes Add RPC client to use with rpc-light
robhoes authored
98 OCamlDocPackage(name, modules) =
99 OCamlDoc($(name), $(modules), "package")
100
71d2b50 @robhoes Generate API docs in JSON format
robhoes authored
101 #
0307b7c @robhoes Generate API docs in JSON format
robhoes authored
102 # Use Camlp4
103 #
104 UseCamlp4(packs, files) =
105 OCAMLPACKS += $(packs)
106 OCAMLFINDFLAGS += -syntax camlp4o
107 $(addsuffix .cmx, $(files)):
108 $(addsuffix .o, $(files)):
109 $(addsuffix .cmi, $(files)):
110 $(addsuffix .cmo, $(files)):
111
112 #
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored
113 # Include the OMakefile in this directory.
114 #
115 .SUBDIRS: .
Something went wrong with that request. Please try again.