aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ocaml/libs/xl/Makefile
blob: a1e79a5a30028eff2891cf969e3e58f2ea301984 (plain)
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
TOPLEVEL=$(CURDIR)/../..
XEN_ROOT=$(TOPLEVEL)/../..
include $(TOPLEVEL)/common.make

# ignore unused generated functions
CFLAGS += -Wno-unused
CFLAGS += $(CFLAGS_libxenlight)

OBJS = xl
INTF = xl.cmi
LIBS = xl.cma xl.cmxa

LIBS_xl = $(LDLIBS_libxenlight)

xl_OBJS = $(OBJS)
xl_C_OBJS = xl_stubs

OCAML_LIBRARY = xl

GENERATED_FILES += xl.ml xl.ml.tmp xl.mli xl.mli.tmp
GENERATED_FILES += _libxl_types.ml.in _libxl_types.mli.in
GENERATED_FILES += _libxl_types.inc

all: $(INTF) $(LIBS)

xl.ml: xl.ml.in _libxl_types.ml.in
	$(Q)sed -e '1i\
(*\
 * AUTO-GENERATED FILE DO NOT EDIT\
 * Generated from xl.ml.in and _libxl_types.ml.in\
 *)\
' \
	    -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.ml.in' \
	  < xl.ml.in > xl.ml.tmp
	$(Q)mv xl.ml.tmp xl.ml

xl.mli: xl.mli.in _libxl_types.mli.in
	$(Q)sed -e '1i\
(*\
 * AUTO-GENERATED FILE DO NOT EDIT\
 * Generated from xl.mli.in and _libxl_types.mli.in\
 *)\
' \
	    -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.mli.in' \
	  < xl.mli.in > xl.mli.tmp
	$(Q)mv xl.mli.tmp xl.mli

_libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
                $(XEN_ROOT)/tools/libxl/libxltypes.py
	PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
		$(XEN_ROOT)/tools/libxl/libxl_types.idl \
		_libxl_types.mli.in _libxl_types.ml.in _libxl_types.inc

libs: $(LIBS)

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

.PHONY: uninstall
uninstall:
	ocamlfind remove -destdir $(OCAMLDESTDIR) xl

include $(TOPLEVEL)/Makefile.rules