File: Makefile

package info (click to toggle)
xen-api-libs 0.5.2-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,940 kB
  • sloc: ml: 13,925; sh: 2,930; ansic: 1,699; makefile: 1,240; python: 83
file content (177 lines) | stat: -rw-r--r-- 4,311 bytes parent folder | download
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
include ../config.mk

IPROG=install -m 755
OCAMLLOC := $(shell ocamlc -where)

OCAML_TEST_INC = -I $(shell ocamlfind query oUnit)
OCAML_TEST_LIB = $(shell ocamlfind query oUnit)/oUnit.cmxa

STDEXT_OBJS = \
	monad \
	fun \
	opt \
	listext \
	filenameext \
	stringext \
	arrayext \
	hashtblext \
	pervasiveext \
	threadext \
	int64ext \
	ring \
	qring \
	fring \
	bigbuffer \
	unixext \
	range \
	vIO \
	trie \
	config \
	date \
	encodings \
	fe \
	fecomms \
	forkhelpers \
	gzip \
	sha1sum \
	zerocheck \
	base64 \
	backtrace \
	tar \
	mapext \
	os \
	either \
	lazyList \
	extentlistSet \
	set_test

INTF = $(foreach obj, $(STDEXT_OBJS),$(obj).cmi)
LIBS = stdext.cma stdext.cmxa

PROGRAMS = base64pp fe_cli fe_test extentlistset_test

all: $(INTF) $(LIBS)

bins: $(PROGRAMS)

libs: $(LIBS)

base64pp: base64_main.ml all libstdext_stubs.a
	$(OCAMLOPT) $(OCAMLOPTFLAGS) stdext.cmxa -linkpkg -o $@ $< -ccopt -L.

fe_cli: fe_cli.ml all libstdext_stubs.a
	$(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa ../uuid/uuid.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg -o $@ $< -ccopt -L.

fe_test: fe_test.ml all libstdext_stubs.a
	$(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa ../uuid/uuid.cmxa ../rpc-light/rpc.cmx ../rpc-light/jsonrpc.cmx stdext.cmxa -linkpkg -I ../uuid -o $@ $< -ccopt -L.

extentlistset_test: extentlistset_test.ml all libstdext_stubs.a
	$(OCAMLOPT) $(OCAMLOPTFLAGS) unix.cmxa stdext.cmxa -linkpkg -o $@ $< -ccopt -L.

stdext.cmxa: libstdext_stubs.a $(foreach obj,$(STDEXT_OBJS),$(obj).cmx)
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ -cclib -lstdext_stubs $(foreach obj,$(STDEXT_OBJS),$(obj).cmx)

stdext.cma: $(foreach obj,$(STDEXT_OBJS),$(obj).cmo)
	$(OCAMLC) -a -dllib dllstdext_stubs.so -cclib -lstdext_stubs -o $@ $(foreach obj,$(STDEXT_OBJS),$(obj).cmo)

stdext_stubs.a: unixext_stubs.o zerocheck_stub.o 
	ocamlmklib -o stdext_stubs $+

libstdext_stubs.a: unixext_open_stubs.o unixext_write_stubs.o unixext_stubs.o zerocheck_stub.o
	ar rcs $@ $+
	ocamlmklib -o stdext_stubs $+

querycd: querycd.cmo 
	 ocamlfind ocamlc -custom -thread -package "threads,unix,stdext" querycd.cmo -o querycd -linkpkg -linkall
#camlc unix.cma stdext.cma querycd.cmo -o querycd

## OBJS
threadext.cmo: threadext.ml threadext.cmi
	$(OCAMLC) -thread -c -o $@ $<

fecomms.cmo : fecomms.ml
	$(OCAMLC) -I ../rpc-light -c -o $@ $<

fe.cmo: fe.ml 
	$(OCAMLC) $(RPCLIGHTFLAGS) -I ../jsonrpc -I ../rpc-light -c -o $@ $<

forkhelpers.cmo: forkhelpers.ml forkhelpers.cmi
	$(OCAMLC) -thread -I ../uuid -c -o $@ $<

filenameext.cmo: filenameext.ml filenameext.cmi
	$(OCAMLC) -c -I ../uuid -o $@ $<

%.cmo: %.ml %.cmi
	$(OCAMLC) -c -o $@ $<

threadext.cmi: threadext.mli
	$(OCAMLC) -thread -c -o $@ $<

forkhelpers.cmi: forkhelpers.mli
	$(OCAMLC) -thread -c -o $@ $<

filenameext.cmi: filenameext.mli
	$(OCAMLC) -c -I ../uuid -o $@ $<

fe.cmi: fe.cmo
	$(OCAMLC) $(RPCLIGHTFLAGS) -c -o $@ $<

%.cmi: %.mli
	$(OCAMLC) -c -o $@ $<

fe.cmx: fe.ml 
	$(OCAMLOPT) $(RPCLIGHTFLAGS) -I ../rpc-light -c -o $@ $<

threadext.cmx: threadext.ml threadext.cmi
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -c -o $@ $<

fecomms.cmx : fecomms.ml
	$(OCAMLOPT) -I ../rpc-light -c -o $@ $<

forkhelpers.cmx: forkhelpers.ml forkhelpers.cmi
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../uuid -thread -c -o $@ $<

filenameext.cmx: filenameext.ml filenameext.cmi
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -c -I ../uuid -o $@ $<

%.cmx: %.ml %.cmi
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../uuid -c -o $@ $<

%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $<

META: META.in
	sed 's/@VERSION@/$(VERSION)/g' < $< > $@

.PHONY: install
install: $(LIBS) META
	mkdir -p $(OCAMLDESTDIR)
	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore stdext META $(INTF) $(LIBS) *.a *.so *.cmx $(SPOT)

.PHONY: bininstall
bininstall: path = $(DESTDIR)$(LIBEXEC)
bininstall: all
	mkdir -p $(path)
	$(IPROG) $(PROGRAMS) $(path)

.PHONY: uninstall
uninstall:
	ocamlfind remove stdext

.PHONY: binuninstall
binuninstall:
	rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS)

.PHONY: doc
doc: $(INTF)
	python ../doc/doc.py $(DOCDIR) "stdext" "package" "$(STDEXT_OBJS)" "." "threads,uuid,unix" ""

clean:
	rm -f META *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(SPOT) $(LIBS) $(PROGRAMS)

#dependency:

unixext.cmi: filenameext.cmi
gzip.cmi: forkhelpers.cmi
sha1sum.cmi: forkhelpers.cmi
tar.cmi: bigbuffer.cmi