forked from xapi-project/xen-api
/
OMakefile
121 lines (96 loc) · 4.91 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
119
120
121
OCAMLINCLUDES = ../xapi ../util ..
OCAML_LIBS = ../util/stats ../fhs
OCAML_CLIBS += $(XEN_OCAML_CLIBS)
# XXX: these should all be specified in the ocamlfind META file:
XENLIGHT_LINK_FLAGS= -cclib -luuid
#XENLIGHT_LINK_FLAGS= -cclib -lxlutil -cclib -luuid -cclib -lblktapctl -cclib -lutil -cclib -lxenlight -cclib -lxenstore
OCAML_LINK_FLAGS+= $(XEN_OCAML_LINK_FLAGS) # $(XENLIGHT_LINK_FLAGS)
CFLAGS += $(XEN_CFLAGS)
OCAMLPACKS = oclock xml-light2 sexpr stunnel http-svr netdev rpc-light threads xenctrl xenstore xenctrlext xenstoreext stdext log cdrom netdev oUnit # xenlight
OCAMLFLAGS += -thread
UseCamlp4(rpc-light.syntax, device_number xenops_utils xenops_server xenops_server_simulator xenops_migrate xenops_server_xen updates xenops_server_plugin domain device device_common xenops_hooks task_server)
UseCamlp4(rpc-light.idl, xenops_interface memory_interface)
LIBFILES = ../util/table xenops_helpers cancel_utils xenbus_utils xenguestHelper domain hotplug device io statdev netman memory device_common squeeze squeeze_xen squeezed_state device_number stubdom bootloader xenops_interface memory_interface memory_client updates xenops_utils xenops_client xenops_server_plugin ../xapi/storage_interface ../xapi/vdi_automaton xenops_server xenops_migrate task_server xenops_task xenops_hooks ionice xenops_server_xen xenops_server_simulator xenstore_watch
StaticCLibrary(statdev_stubs, statdev_stubs)
OCamlLibraryClib(xenops, $(LIBFILES), statdev_stubs)
OCamlDocLibrary(xenops, $(LIBFILES))
OCamlLibrary(xenops_client, xenops_interface device_number memory xenops_client ionice)
OCamlLibrary(memory_client, memory_interface memory_client)
XENSTORE_WATCH_OBJS=xenstore_watch xenops_helpers
XENSTORE_WATCH_LIBNAME=xenstore_watch
OCamlLibrary($(XENSTORE_WATCH_LIBNAME), $(XENSTORE_WATCH_OBJS))
OCAML_LIBS += ../util/version ../idl/ocaml_backend/common xenops
OCamlProgram(cancel_utils_test, cancel_utils_test)
OCamlProgram(domain_sethandle, domain_sethandle)
OCamlProgram(list_domains, list_domains)
OCamlDocProgram(list_domains, list_domains)
OCamlProgram(memory_breakdown, memory_breakdown)
OCamlProgram(memory_summary, memory_summary)
OCamlProgram(freemem, freemem)
OCamlProgram(squeezed, squeezed memory_server)
OCamlDocProgram(squeezed, squeezed)
OCamlProgram(xenopsd, xenopsd)
OCamlDocProgram(xenopsd, xenopsd)
OCamlProgram(device_number_test, device_number_test device_number)
# legacy
OCamlProgram(create_domain, xenops)
OCamlProgram(destroy_domain, xenops)
OCamlProgram(build_domain, xenops)
OCamlProgram(build_hvm, xenops)
OCamlProgram(restore_domain, xenops)
OCamlProgram(suspend_domain, xenops)
OCamlProgram(add_vbd, xenops)
OCamlProgram(add_vif, xenops)
OCamlProgram(shutdown_domain, xenops)
OCamlProgram(unpause_domain, xenops)
OCamlProgram(pause_domain, xenops)
OCamlProgram(xenops, xenops)
OCamlProgram(fence, fence)
OCamlProgram(dbgring, dbgring)
section
OCAMLINCLUDES = ../idl/ocaml_backend ../idl
OCAMLFLAGS = -dtypes -warn-error F # -cclib -static
OCAMLPACKS = xenctrl xenstore xenstoreext
OCamlProgram(xs, xenstore_readdir)
OCamlProgram(squeeze_test, squeeze_test squeeze_test_main)
BIN_PROGS=list_domains
DEBUG_PROGS=xs xenops memory_breakdown memory_summary
SYMLINK_PROGS=destroy_domain shutdown_domain create_domain build_domain build_hvm add_vbd add_vif unpause_domain pause_domain suspend_domain restore_domain
OTHER_PROGS=fence dbgring squeezed xenopsd domain_sethandle
.PHONY: allxenops
allxenops: $(DEBUG_PROGS) $(BIN_PROGS) $(OTHER_PROGS)
.PHONY: install
install:
mkdir -p $(DESTDIR)$(OPTDIR)/debug
cp -f $(DEBUG_PROGS) $(DESTDIR)$(OPTDIR)/debug
sh -c 'for i in $(SYMLINK_PROGS); do ln -nfs xenops $(DESTDIR)$(OPTDIR)/debug/$$i; done'
mkdir -p $(DESTDIR)$(BINDIR)
$(IPROG) $(BIN_PROGS) $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(LIBEXECDIR)
$(IPROG) fence $(DESTDIR)$(LIBEXECDIR)/fence.bin
mkdir -p $(DESTDIR)$(LIBEXECDIR)
$(IPROG) squeezed $(DESTDIR)$(LIBEXECDIR)
mkdir -p $(DESTDIR)$(LIBEXECDIR)
$(IPROG) xenopsd $(DESTDIR)$(LIBEXECDIR)
$(IPROG) domain_sethandle $(DESTDIR)$(LIBEXECDIR)
.PHONY: sdk-install
sdk-install: install
.PHONY: clean
clean:
rm -f *.cmi *.cmx *.cmo *.a *.cma *.cmxa *.o *.annot *.run *.opt $(DEBUG_PROGS) $(BIN_PROGS) $(SYMLINK_PROGS) $(OTHER_PROGS)
if $(defined-env DESTDIR)
INSTALL_PATH = $(DESTDIR)/$(shell ocamlfind printconf destdir)
export
else
INSTALL_PATH = $(shell ocamlfind printconf destdir)
export
XENSTORE_WATCH_PACKNAME=xenstore-watch
META: META.in
sed 's/@VERSION@/$(PRODUCT_VERSION)/g' < $< > $@
.PHONY: lib-install
lib-install: META
mkdir -p $(INSTALL_PATH)
ocamlfind install -destdir $(INSTALL_PATH) -ldconf ignore $(XENSTORE_WATCH_PACKNAME) META $(addsuffixes .cmi,$(XENSTORE_WATCH_OBJS)) $(if $(BYTE_ENABLED), $(XENSTORE_WATCH_LIBNAME).cma) $(if $(NATIVE_ENABLED), $(XENSTORE_WATCH_LIBNAME).cmxa $(XENSTORE_WATCH_LIBNAME).a $(addsuffixes .cmx, $(XENSTORE_WATCH_OBJS)))
.PHONY: lib-uninstall
lib-uninstall:
ocamlfind remove -destdir $(INSTALL_PATH) $(XENSTORE_WATCH_PACKNAME)