/
OMakefile
308 lines (285 loc) · 6.89 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
OCAMLPACKS = oclock xml-light2 cdrom pciutil sexpr xcp stunnel \
http-svr netdev tapctl rpclib xenstore-compat \
uuid gzip sha1 xcp.network xcp.rrd xcp.storage \
xcp.xen xcp.memory tar tar.unix oPasswd xcp-inventory \
rrdd-plugin pci
OCAML_LIBS = ../util/version ../util/vm_memory_constraints ../util/sanitycheck ../util/stats \
../idl/ocaml_backend/common ../idl/ocaml_backend/client ../idl/ocaml_backend/server ../util/ocamltest
OCAMLINCLUDES = ../idl ../idl/ocaml_backend \
../autogen ../database/ \
../xva ../util \
../auth ../license ../client_records ../rfb ../gpg
UseCamlp4(rpclib.syntax, features storage_impl xapi_udhcpd storage_migrate \
xapi_services system_domains cancel_tests config_file_sync updates \
sparse_dd_wrapper vhd_tool_wrapper)
CFLAGS += -std=gnu99 -Wall -Werror -I$(shell ocamlc -where)
#XENLIGHT_LINK_FLAGS= -cclib -lxlutil -cclib -luuid -cclib -lblktapctl -cclib -lutil -cclib -lxenlight -cclib -lxenstore
XENLIGHT_LINK_FLAGS=-cclib -luuid
# Since the section didn't work, link against the xen libs for everything if we are building
# xen stuff at all.
# NB order of libraries is important: OMake cannot determine dependencies between libraries
# (the same holds for OCaml packages)
XEN_OCAML_LIBS = ../auth/pam
XEN_OCAMLINCLUDES =
XEN_OCAMLPACKS = xenstore-compat xenctrl xenctrlext # xenlight
OCAML_CLIBS = $(XEN_OCAML_CLIBS) $(OCAML_CLIBS)
OCAML_LINK_FLAGS = $(XEN_OCAML_LINK_FLAGS) $(OCAML_LINK_FLAGS) # $(XENLIGHT_LINK_FLAGS)
CFLAGS = $(XEN_CFLAGS) $(CFLAGS)
OCAMLINCLUDES = $(XEN_OCAMLINCLUDES) $(OCAMLINCLUDES)
# xc.cma depends on uuid.cma
OCAML_LIBS = $(OCAML_LIBS) $(XEN_OCAML_LIBS)
OCAMLPACKS = $(OCAMLPACKS) $(XEN_OCAMLPACKS)
# -----------------------------------------------------------------------
# Build the server
# -----------------------------------------------------------------------
#OCAML_CLIBS += stubs
OCamlProgram(http_test, http_test)
OCamlProgram(show_bat, show_bat)
OCamlProgram(storage_impl_test, sparse_encoding sparse_dd_wrapper storage_migrate storage_impl task_server updates storage_task storage_locks storage_impl_test)
COMMON = \
xapi_templates \
../idl/api_lowlevel \
network \
nm \
xapi_mgmt_iface \
smint \
../gpg/gpg \
helpers \
at_least_once_more \
fileserver
#OCamlProgram(upload_receive, $(COMMON) fileupload upload_receive)
OCamlProgram(quicktestbin, quicktest quicktest_common quicktest_ocamltest quicktest_storage quicktest_http quicktest_vdi_copy quicktest_encodings quicktest_vm_placement vm_placement quicktest_vm_memory_constraints ../util/vm_memory_constraints quicktest_lifecycle sparse_encoding)
OCamlProgram(xenstore_copy, xenstore_dump xenstore_copy)
XAPI_MODULES = $(COMMON) \
agility \
network \
../util/table \
balloon \
daemon_manager \
map_check \
system_domains \
local_work_queue \
../xva/xva \
../idl/ocaml_backend/json \
../rfb/rfb \
../rfb/rfb_randomtest \
../client_records/records \
../client_records/record_util \
task_server \
updates \
storage_task \
storage_access \
vhd_tool_wrapper \
storage_mux \
storage_migrate \
storage_proxy \
storage_utils \
xapi_services \
sm_exec \
sm \
storage_impl \
storage_locks \
console \
importexport \
sparse_encoding \
create_storage \
create_networks \
xapi_db_upgrade \
xapi_fist \
xapi_udhcpd \
xapi_network \
xapi_network_attach_helpers \
xapi_event \
xapi_alert \
xapi_cli \
xapi_task \
xapi_crashdump \
xapi_pbd \
xapi_user \
xapi_host_cpu \
xapi_host_helpers \
xapi_host_crashdump \
xapi_guest_agent \
xapi_pv_driver_version \
xapi_http \
xapi_host_patch \
xapi_pool_patch \
xapi_pool_license \
xapi_support \
xapi_session \
xapi_auth \
../auth/auth_signature \
../auth/authx \
../auth/extauth \
../auth/extauth_plugin_ADpbis \
xapi_subject \
audit_log \
xapi_xenops \
xapi_xenops_queue \
xapi_vmpp \
xapi_vm_appliance \
xapi_vm_appliance_lifecycle \
xapi_vm_lifecycle \
xapi_vm_clone \
xapi_vm_snapshot \
vm_placement \
xapi_vm_placement \
xapi_vm_helpers \
xenopsMemory \
memory_check \
xapi_vm_memory_constraints \
xapi_vbd_helpers \
xapi_vif_helpers \
xapi_vdi_helpers \
xapi_hooks \
xapi_bond \
xapi_vlan \
xapi_tunnel \
xapi_sr \
xapi_sr_operations \
xapi_sm \
xapi_pbd \
xapi_vdi \
pool_db_backup \
xapi_sync \
config_file_sync \
slave_backup \
sm_fs_ops \
sparse_dd_wrapper \
pciops \
vgpuops \
vbdops \
attach_helpers \
cpuid_helpers \
message_forwarding \
cancel_tasks \
xapi_pool_transition \
thread_queue \
xapi_ha \
xapi_ha_vm_failover \
binpack \
xapi_local_session \
xha_interface \
xha_statefile \
xha_metadata_vdi \
xha_errno \
xha_scripts \
static_vdis \
monitor_transfer \
monitor_types \
monitor_master \
monitor_dbcalls \
monitor_dbcalls_cache \
api_server \
create_misc \
xapi_host \
xapi_host_display \
xapi_plugins \
xapi_fuse \
db_gc \
cli_protocol \
cli_cmdtable \
cli_frontend \
cli_operations \
cli_operations_geneva \
cli_util \
cli_key \
cli_printer \
cli_progress_bar \
ipq \
xapi_periodic_scheduler \
xapi_periodic_scheduler_init \
dbsync \
dbsync_slave \
dbsync_master \
sync_networking \
storage_access \
import_xva \
import \
import_raw_vdi \
export \
export_raw_vdi \
stream_vdi \
fileupload \
smint \
sm_exec \
sm \
startup \
system_status \
license_check \
vpx \
xapi_vm \
xapi_sr \
xapi_vdi \
xapi_vbd \
xapi_vif \
xapi_pif \
xapi_pbd \
xapi_user \
xapi_host_cpu \
xapi_task \
xapi_vm_migrate \
xapi_dr \
xapi_dr_task \
mtc \
xapi_crashdump \
xapi_gpumon \
xapi_templates_install \
xapi_host_backup \
xapi_logs_download \
xapi_vncsnapshot \
xapi_pool \
xapi_pool_helpers \
xapi_upgrade \
xapi_blob \
xapi_message \
../idl/datamodel_schema \
debug_populate \
xapi_remotecmd \
redo_log_usage \
redo_log_alert \
workload_balancing \
wlb_reports \
remote_requests \
xapi_secret \
certificates \
../license/v6client \
../license/v6rpc \
../license/v6errors \
bios_strings \
xapi_config \
features \
pool_features \
../license/license_init \
xapi_pci \
xapi_pci_helpers \
xapi_pgpu \
xapi_pgpu_helpers \
xapi_gpu_group \
xapi_vgpu \
xapi_vgpu_type \
xapi_stats \
rrdd_proxy \
rrdd_helper \
../util/rpc_retry \
xapi \
cluster_stack_constraints \
OCamlProgram(xapi, xapi_main $(XAPI_MODULES))
OCamlLibrary(xapi, xapi $(XAPI_MODULES))
OCamlProgram(bootloader, bootloader bootloader_test)
OCamlProgram(binpack, binpack binpack_test xapi_fist)
OCamlProgram(at_least_once_more, at_least_once_more at_least_once_more_test)
.DEFAULT: xapi
.PHONY: install
install:
mkdir -p $(DESTDIR)$(SBINDIR)
cp -f xapi $(DESTDIR)$(SBINDIR)
mkdir -p $(DESTDIR)$(OPTDIR)/debug
$(IPROG) quicktest $(DESTDIR)$(OPTDIR)/debug
cp -f quicktestbin $(DESTDIR)$(OPTDIR)/debug
mkdir -p $(DESTDIR)$(LIBEXECDIR)
.PHONY: clean
clean:
rm -rf $(CLEAN_OBJS) *.aux *.log *.fig xapi
rm -f config_constants.ml
rm -f binpack xapi_unit_test storage_impl_test monitor_fake_plugin quicktestbin