From aa54c46d5fdd9a68ae2237713d5086ecb91235f9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 3 Aug 2019 15:20:50 +0100 Subject: [PATCH 11/11] ocaml: Add make install rule. This installs the OCaml bindings into $(DESTDIR). If you don't want this then use ./configure --disable-ocaml. --- ocaml/Makefile.am | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index bae9e58..c69b5bd 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -103,4 +103,23 @@ endif $(OCAMLFIND) ocamldep $^ > $@ -include .depend +# Run ocamlfind to perform the install. ocamlfind refuses to install +# the package if it is already installed, so remove the old package +# first. +data_hook_files = META *.so *.a *.cma *.cmi $(srcdir)/*.mli +if HAVE_OCAMLOPT +data_hook_files += *.cmx *.cmxa +endif + +install-data-hook: + mkdir -p $(DESTDIR)$(OCAMLLIB) + mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs + rm -rf $(DESTDIR)$(OCAMLLIB)/nbd + rm -rf $(DESTDIR)$(OCAMLLIB)/stublibs/dllmlnbd.so* + $(OCAMLFIND) install \ + -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \ + nbd \ + $(data_hook_files) + rm $(DESTDIR)$(OCAMLLIB)/nbd/libnbdocaml.a + endif HAVE_OCAML -- 2.22.0