|
| 1 | +From 7688bb4fea24463c92e9c4870acc08495a4c77cb Mon Sep 17 00:00:00 2001 |
| 2 | +From: David Allsopp < [email protected]> |
| 3 | +Date: Wed, 10 Jan 2018 15:20:46 +0000 |
| 4 | +Subject: [PATCH] Provide findlib-install target |
| 5 | + |
| 6 | +Allows installing the entire library using ocamlfind. |
| 7 | +--- |
| 8 | + Makefile | 10 +++++++++- |
| 9 | + src/META | 17 ----------------- |
| 10 | + src/META.in | 19 +++++++++++++++++++ |
| 11 | + src/Makefile | 17 +++++++++++++++-- |
| 12 | + 4 files changed, 43 insertions(+), 20 deletions(-) |
| 13 | + delete mode 100644 src/META |
| 14 | + create mode 100644 src/META.in |
| 15 | + |
| 16 | +diff --git a/Makefile b/Makefile |
| 17 | +index 6a5d08f..b40e588 100644 |
| 18 | +--- a/Makefile |
| 19 | ++++ b/Makefile |
| 20 | +@@ -14,8 +14,16 @@ install: |
| 21 | + $(MAKE) -C src install |
| 22 | + $(MAKE) -C toplevel install |
| 23 | + |
| 24 | ++findlib-install: |
| 25 | ++ $(MAKE) -C src findlib-install |
| 26 | ++ $(MAKE) -C toplevel install |
| 27 | ++ |
| 28 | + uninstall: |
| 29 | + $(MAKE) -C src uninstall |
| 30 | + $(MAKE) -C toplevel uninstall |
| 31 | + |
| 32 | +-.PHONY: all test clean install uninstall |
| 33 | ++findlib-uninstall: |
| 34 | ++ $(MAKE) -C src findlib-uninstall |
| 35 | ++ $(MAKE) -C toplevel uninstall |
| 36 | ++ |
| 37 | ++.PHONY: all test clean install uninstall findlib-install findlib-uninstall |
| 38 | +diff --git a/src/META b/src/META |
| 39 | +deleted file mode 100644 |
| 40 | +index 66ac170..0000000 |
| 41 | +--- a/src/META |
| 42 | ++++ /dev/null |
| 43 | +@@ -1,17 +0,0 @@ |
| 44 | +-# This META is the one provided by findlib when the "num" library was |
| 45 | +-# part of the core OCaml distribution. For backward compatibility, |
| 46 | +-# it installs into OCaml's standard library directory, not in a subdirectory |
| 47 | +- |
| 48 | +-requires = "num.core" |
| 49 | +-requires(toploop) = "num.core,num-top" |
| 50 | +-version = "1.0" |
| 51 | +-description = "Arbitrary-precision rational arithmetic" |
| 52 | +-package "core" ( |
| 53 | +- directory = "^" |
| 54 | +- version = "1.0" |
| 55 | +- browse_interfaces = "" |
| 56 | +- archive(byte) = "nums.cma" |
| 57 | +- archive(native) = "nums.cmxa" |
| 58 | +- plugin(byte) = "nums.cma" |
| 59 | +- plugin(native) = "nums.cmxs" |
| 60 | +-) |
| 61 | +diff --git a/src/META.in b/src/META.in |
| 62 | +new file mode 100644 |
| 63 | +index 0000000..b5678b7 |
| 64 | +--- /dev/null |
| 65 | ++++ b/src/META.in |
| 66 | +@@ -0,0 +1,19 @@ |
| 67 | ++# This META is the one provided by findlib when the "num" library was |
| 68 | ++# part of the core OCaml distribution. For backward compatibility, |
| 69 | ++# it is installed into OCaml's standard library directory. If the |
| 70 | ++# directory line below is removed, then it's installed in a |
| 71 | ++# subdirectory, as normal for a findlib package. |
| 72 | ++ |
| 73 | ++requires = "num.core" |
| 74 | ++requires(toploop) = "num.core,num-top" |
| 75 | ++version = "1.0" |
| 76 | ++description = "Arbitrary-precision rational arithmetic" |
| 77 | ++package "core" ( |
| 78 | ++ directory = "^" |
| 79 | ++ version = "1.0" |
| 80 | ++ browse_interfaces = "" |
| 81 | ++ archive(byte) = "nums.cma" |
| 82 | ++ archive(native) = "nums.cmxa" |
| 83 | ++ plugin(byte) = "nums.cma" |
| 84 | ++ plugin(native) = "nums.cmxs" |
| 85 | ++) |
| 86 | +diff --git a/src/Makefile b/src/Makefile |
| 87 | +index 97dc074..ff271fe 100644 |
| 88 | +--- a/src/Makefile |
| 89 | ++++ b/src/Makefile |
| 90 | +@@ -80,21 +80,34 @@ endif |
| 91 | + ifeq "$(NATDYNLINK)" "true" |
| 92 | + TOINSTALL+=nums.cmxs |
| 93 | + endif |
| 94 | ++ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" |
| 95 | + TOINSTALL_STUBS=dllnums.$(SO) |
| 96 | ++else |
| 97 | ++TOINSTALL_STUBS= |
| 98 | ++endif |
| 99 | + |
| 100 | + install: |
| 101 | ++ cp META.in META |
| 102 | + $(OCAMLFIND) install num META |
| 103 | ++ rm -f META |
| 104 | + $(INSTALL_DATA) $(TOINSTALL) $(STDLIBDIR) |
| 105 | + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" |
| 106 | + $(INSTALL_DLL) $(TOINSTALL_STUBS) $(STDLIBDIR)/stublibs |
| 107 | + endif |
| 108 | + |
| 109 | +-uninstall: |
| 110 | ++findlib-install: |
| 111 | ++ grep -Fv '^' META.in > META |
| 112 | ++ $(OCAMLFIND) install num META $(TOINSTALL) $(TOINSTALL_STUBS) |
| 113 | ++ rm -f META |
| 114 | ++ |
| 115 | ++findlib-uninstall: |
| 116 | ++ $(OCAMLFIND) remove num |
| 117 | ++ |
| 118 | ++uninstall: findlib-uninstall |
| 119 | + cd $(STDLIBDIR) && rm -f $(TOINSTALL) |
| 120 | + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" |
| 121 | + cd $(STDLIBDIR)/stublibs && rm -f $(TOINSTALL_STUBS) |
| 122 | + endif |
| 123 | +- $(OCAMLFIND) remove num |
| 124 | + |
| 125 | + clean: |
| 126 | + rm -f *.cm[ioxta] *.cmx[as] *.cmti *.$(O) *.$(A) *.$(SO) |
| 127 | +-- |
| 128 | +2.14.1 |
| 129 | + |
0 commit comments