1 From 12dff1ac0a8cacbda2969b560f021ebb73b16887 Mon Sep 17 00:00:00 2001
2 From: David Allsopp <david.allsopp@metastack.com>
3 Date: Thu, 11 Jan 2018 08:10:10 +0000
4 Subject: [PATCH] Provide findlib-install target (#6)
6 Allows installing the entire library using ocamlfind, in an ocamlfind-managed directory.
7 This differs from the `install` target which performs the old-style installation in the OCaml stdlib directory.
10 Makefile | 10 +++++++++-
11 src/{META => META.in} | 4 +++-
12 src/Makefile | 17 +++++++++++++++--
13 4 files changed, 28 insertions(+), 4 deletions(-)
14 rename src/{META => META.in} (72%)
16 diff --git a/.gitignore b/.gitignore
17 index 6acd3bc..172bf23 100644
25 diff --git a/Makefile b/Makefile
26 index 6a5d08f..b40e588 100644
29 @@ -14,8 +14,16 @@ install:
30 $(MAKE) -C src install
31 $(MAKE) -C toplevel install
34 + $(MAKE) -C src findlib-install
35 + $(MAKE) -C toplevel install
38 $(MAKE) -C src uninstall
39 $(MAKE) -C toplevel uninstall
41 -.PHONY: all test clean install uninstall
43 + $(MAKE) -C src findlib-uninstall
44 + $(MAKE) -C toplevel uninstall
46 +.PHONY: all test clean install uninstall findlib-install findlib-uninstall
47 diff --git a/src/META b/src/META.in
51 index 66ac170..b5678b7 100644
55 # This META is the one provided by findlib when the "num" library was
56 # part of the core OCaml distribution. For backward compatibility,
57 -# it installs into OCaml's standard library directory, not in a subdirectory
58 +# it is installed into OCaml's standard library directory. If the
59 +# directory line below is removed, then it's installed in a
60 +# subdirectory, as normal for a findlib package.
63 requires(toploop) = "num.core,num-top"
64 diff --git a/src/Makefile b/src/Makefile
65 index 97dc074..ff271fe 100644
68 @@ -80,21 +80,34 @@ endif
69 ifeq "$(NATDYNLINK)" "true"
72 +ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true"
73 TOINSTALL_STUBS=dllnums.$(SO)
80 $(OCAMLFIND) install num META
82 $(INSTALL_DATA) $(TOINSTALL) $(STDLIBDIR)
83 ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true"
84 $(INSTALL_DLL) $(TOINSTALL_STUBS) $(STDLIBDIR)/stublibs
89 + grep -Fv '^' META.in > META
90 + $(OCAMLFIND) install num META $(TOINSTALL) $(TOINSTALL_STUBS)
94 + $(OCAMLFIND) remove num
96 +uninstall: findlib-uninstall
97 cd $(STDLIBDIR) && rm -f $(TOINSTALL)
98 ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true"
99 cd $(STDLIBDIR)/stublibs && rm -f $(TOINSTALL_STUBS)
101 - $(OCAMLFIND) remove num
104 rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *.$(SO)