forked from xapi-project/xen-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OMakefile
96 lines (84 loc) · 2.38 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
OCAMLINCLUDES = \
$(ROOT)/ocaml \
$(ROOT)/ocaml/autogen \
$(ROOT)/ocaml/idl \
$(ROOT)/ocaml/idl/ocaml_backend \
$(ROOT)/ocaml/network \
$(ROOT)/ocaml/util \
$(ROOT)/ocaml/xapi \
$(ROOT)/ocaml/xenops \
interface
# ocaml/xapi only needed for xapi_fist : should move xapi_first to libs
OCAMLPACKS = oclock xml-light2 stunnel http-svr xenctrl xenctrlext xenstore
OCAML_LIBS = $(ROOT)/ocaml/fhs ../idl/ocaml_backend/xapi_client ../xenops/xenstore_watch
# ../xenops/xenops_client
UseCamlp4(rpc-light.syntax, rrdd_server)
RRDD = xcp-rrdd
RRDD_FILES = \
../pool_role_shared \
../network/network_interface \
../network/network_monitor \
../util/config_shared \
../util/stats \
../xapi/xapi_fist \
../xenops/device_number \
interface/ds \
interface/data_source \
interface/rrd \
interface/rrdd_common \
interface/rrdd_fake_common \
interface/rrdd_interface \
interface/monitor_types \
rrdd_fake \
rrdd_shared \
rrdd_ha_stats \
rrdd_http_handler \
rrdd_server \
rrdd_monitor \
rrdd_stats \
rrdd_main
RRDD_TEST = rrdd_test
RRDD_TEST_FILES = \
interface/rrd \
interface/rrdd_interface \
interface/data_source \
rrdd_test
RRD_CLIENT_OBJS = \
interface/rrd \
interface/rrdd_interface \
interface/ds \
interface/data_source \
rrdd_shared
.SUBDIRS: interface
OCamlProgram($(RRDD), $(RRDD_FILES))
OCamlDocProgram($(RRDD), $(RRDD_FILES))
OCamlLibrary(rrd_client, $(RRD_CLIENT_OBJS))
OCamlProgram($(RRDD_TEST), $(RRDD_TEST_FILES))
.PHONY: install
install:
mkdir -p $(DESTDIR)$(LIBEXECDIR)
$(IPROG) $(RRDD) $(DESTDIR)$(LIBEXECDIR)
META: META.in
sed 's/@VERSION@/$(PRODUCT_VERSION)/g' < $< > $@
if $(defined-env DESTDIR)
INSTALL_PATH = $(DESTDIR)/$(shell ocamlfind printconf destdir)
export
else
INSTALL_PATH = $(shell ocamlfind printconf destdir)
export
.PHONY: lib-install
lib-install: META
mkdir -p $(INSTALL_PATH)
ocamlfind install -destdir $(INSTALL_PATH) -ldconf ignore rrd-client META $(addsuffixes .cmi,$(RRD_CLIENT_OBJS)) $(if $(BYTE_ENABLED), rrd_client.cma) $(if $(NATIVE_ENABLED), rrd_client.cmxa rrd_client.a $(addsuffixes .cmx, $(RRD_CLIENT_OBJS)))
.PHONY: lib-uninstall
lib-uninstall:
ocamlfind remove -destdir $(INSTALL_PATH) rrd-client
.PHONY: test
test: $(RRDD) $(RRDD_TEST)
killall $(RRDD) || true
./$(RRDD) -daemon
./$(RRDD_TEST)
killall $(RRDD) || true
clean:
rm -f *.cmi *.cmx *.cmo *.a *.cma *.run *.opt *.annot *.o *.orig *.spit *.spot *.omc
rm -f $(RRDD) $(RRDD_TEST)