-
Notifications
You must be signed in to change notification settings - Fork 283
/
OMakefile
118 lines (84 loc) · 3.53 KB
/
OMakefile
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
116
117
118
.SUBDIRS: ocaml_backend js_backend
PSTOPDF = $(shell bash -c "which pstopdf 2>/dev/null || which ps2pdf 2>/dev/null || which ps2pdf14 2>/dev/null || echo false")
OCAMLINCLUDES = ocaml_backend ../database ..
OCAMLPACKS = xml-light2 sexpr log http-svr
CAMLP4_FILES = datamodel_types
UseCamlp4(rpc-light.syntax, $(CAMLP4_FILES))
# -----------------------------------------------------------------------
# Build datamodel library
# -----------------------------------------------------------------------
OCamlLibrary(datamodel, datamodel ../fhs constants datamodel_utils datamodel_types api_errors api_messages dm_api ocaml_backend/ocaml_utils ocaml_backend/ref ../database/string_marshall_helper)
# -----------------------------------------------------------------------
# Build datamodel documentation
# -----------------------------------------------------------------------
DATAMODEL = datamodel
DATAMODEL_FILES = constants datamodel_types api_errors api_messages dm_api datamodel datamodel_utils dtd_backend latex_backend dot_backend ocaml_backend/ref ../database/string_marshall_helper
SHARED_TEX = coversheet.tex presentation.tex vm-lifecycle.tex wire-protocol.tex
SHARED_EPS = vm_lifecycle.eps
OPEN_TEX = xenapi.tex xenapi-coversheet.tex xenapi-datamodel.tex
OPEN_EPS = xenapi-datamodel-graph.eps xen.eps
CLOSED_TEX = xenenterpriseapi.tex xenenterpriseapi-coversheet.tex xenenterpriseapi-datamodel.tex
CLOSED_EPS = xenenterpriseapi-datamodel-graph.eps citrix_logo_black.eps
DOCDIR = $(ROOT)/ocaml/autogen/doc
OCamlProgram($(DATAMODEL), $(DATAMODEL_FILES) datamodel_main)
OCamlDocProgram(datamodel, $(DATAMODEL_FILES))
#.PHONY: sdk-classes
#sdk-classes: sdk-classes.dot
# dot -Tps2 -Kneato -Goverlap=false sdk-classes.dot > sdk-classes.ps
# dot -Tgif -Kneato -Goverlap=false sdk-classes.dot > sdk-classes.gif
xenapi-datamodel-graph.dot: datamodel
./datamodel -dot >$@
xenenterpriseapi-datamodel-graph.dot: datamodel
./datamodel -dot -closed >$@
xenapi-datamodel.tex: datamodel
./datamodel -latex >$@
xenenterpriseapi-datamodel.tex: datamodel
./datamodel -latex -closed >$@
datamodel-dtd.xml: datamodel
./datamodel -dtd >$@
xenenterpriseapi.dvi: $(CLOSED_TEX) $(SHARED_TEX) $(CLOSED_EPS) $(SHARED_EPS)
latex $<
latex $<
xenapi.dvi: $(OPEN_TEX) $(SHARED_TEX) $(OPEN_EPS) $(SHARED_EPS)
latex $<
latex $<
%.pdf: %.ps
$(PSTOPDF) $< $@
%.ps: %.dvi
dvips $< -o $@
#%.eps: %.dot
# dot -Tps $< >$@
%.map: %.dot
dot -Tcmapx $< >$@
%.gif: %.dot
dot -Tgif $< >$@
.PHONY: clean
clean:
rm -rf *.cmi *.cma *.cmxa *.a *.cmo *.cmx *.o *.opt *.aux *.log *.fig *.run *.spot *.spit datamodel
rm -rf *.ps *.pdf *.dvi *.annot
rm -rf *datamodel.tex datamodel-dtd.xml datamodel-coversheet.tex
sdk-README.txt : sdk-README.html
lynx -dump sdk-README.html > sdk-README.txt
.PHONY: doc
doc: xenenterpriseapi.pdf
.PHONY: sdk-install
sdk-install: doc sdk-README.txt
mkdir -p $(SDK)/docs/pdf
cp xenenterpriseapi.pdf $(SDK)/docs/pdf/
cp sdk-README.txt $(SDK)/README.txt
cp sdk-index.html $(SDK)/index.html
noarch-install: sdk-install
META: META.in
sed 's/@VERSION@/$(PRODUCT_VERSION)/g' < $< > $@
if $(defined-env DESTDIR)
INSTALL_PATH = $(DESTDIR)/$(shell ocamlc -where)$(EXTRA_INSTALL_PATH)
export
else
INSTALL_PATH = $(shell ocamlfind printconf destdir)
export
lib-install: META
mkdir -p $(INSTALL_PATH)
ocamlfind install -destdir $(INSTALL_PATH) -ldconf ignore xapi-datamodel META datamodel.{a,cmxa,cmi} datamodel_types.cmi datamodel_utils.cmi dm_api.cmi api_messages.cmi
.PHONY: lib-uninstall
lib-uninstall:
ocamlfind remove -destdir $(INSTALL_PATH) xapi-datamodel