Files
xen/tools/ocaml/libs/eventchn/Makefile
T
Anthony PERARD 5310a3aa50 tools: Rework linking options for ocaml binding libraries
Using a full path to the C libraries when preparing one of the ocaml
binding for those libraries make the binding unusable by external
project. The full path is somehow embedded and reused by the external
project when linking against the binding.

Instead, we will use the proper way to link a library, by using '-l'.
For in-tree build, we also need to provide the search directory via
'-L'.

(The search path -L are still be embedded, but at least that doesn't
prevent the ocaml binding from been used.)

Related-to: xen-project/xen#96
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
2022-10-14 20:56:57 +01:00

36 lines
845 B
Makefile

OCAML_TOPLEVEL=$(CURDIR)/../..
XEN_ROOT=$(OCAML_TOPLEVEL)/../..
include $(OCAML_TOPLEVEL)/common.make
CFLAGS += $(CFLAGS_libxenevtchn) $(CFLAGS_xeninclude)
OBJS = xeneventchn
INTF = $(foreach obj, $(OBJS),$(obj).cmi)
LIBS = xeneventchn.cma xeneventchn.cmxa
LIBS_xeneventchn = $(call xenlibs-ldflags-ldlibs,evtchn)
all: $(INTF) $(LIBS) $(PROGRAMS)
bins: $(PROGRAMS)
libs: $(LIBS)
xeneventchn_OBJS = $(OBJS)
xeneventchn_C_OBJS = xeneventchn_stubs
OCAML_LIBRARY = xeneventchn
.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xeneventchn
$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xeneventchn META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xeneventchn
include $(OCAML_TOPLEVEL)/Makefile.rules