]>
Commit | Line | Data |
---|---|---|
d06d8c56 JR |
1 | From 5b8da25acd624d49609ce82bc56ef82f03dcab37 Mon Sep 17 00:00:00 2001 |
2 | From: "Richard W.M. Jones" <rjones@redhat.com> | |
3 | Date: Wed, 20 May 2020 11:31:24 +0100 | |
4 | Subject: [PATCH 1/2] Allow destdir installs. | |
5 | ||
6 | make DESTDIR=/tmp/foo install | |
7 | ||
8 | You still need to create the directory structure under the destdir, so | |
9 | this is not quite a true destdir install, but good enough for Fedora | |
10 | builds. | |
11 | --- | |
12 | compiler/Makefile | 2 +- | |
13 | lib/Makefile | 4 ++-- | |
14 | runtime/Makefile.unix | 8 ++++---- | |
15 | 3 files changed, 7 insertions(+), 7 deletions(-) | |
16 | ||
17 | diff --git a/compiler/Makefile b/compiler/Makefile | |
18 | index d756fba..2e402bc 100644 | |
19 | --- a/compiler/Makefile | |
20 | +++ b/compiler/Makefile | |
21 | @@ -82,7 +82,7 @@ beforedepend:: linenum.ml | |
22 | ||
23 | # Install | |
24 | install: | |
25 | - cp $(PROG) $(BINDIR) | |
26 | + cp $(PROG) $(DESTDIR)$(BINDIR) | |
27 | ||
28 | # Clean up | |
29 | clean:: | |
30 | diff --git a/lib/Makefile b/lib/Makefile | |
31 | index 5048be6..181be01 100644 | |
32 | --- a/lib/Makefile | |
33 | +++ b/lib/Makefile | |
34 | @@ -29,11 +29,11 @@ $(NATIVELIB): $(NATIVEOBJS) | |
35 | install: install-byte $(if $(NATIVELIB),install-opt) | |
36 | ||
37 | install-byte: | |
38 | - cp $(INTERFACES) $(BYTELIB) $(OCAMLLIB) | |
39 | + cp $(INTERFACES) $(BYTELIB) $(DESTDIR)$(OCAMLLIB) | |
40 | ||
41 | install-opt: | |
42 | - cp $(NATIVELIB) $(NATIVELIB:.cmxa=.$(LIBEXT)) $(OCAMLLIB) | |
43 | - cd $(OCAMLLIB); $(RANLIB) $(NATIVELIB:.cmxa=.$(LIBEXT)) | |
44 | + cp $(NATIVELIB) $(NATIVELIB:.cmxa=.$(LIBEXT)) $(DESTDIR)$(OCAMLLIB) | |
45 | + cd $(DESTDIR)$(OCAMLLIB); $(RANLIB) $(NATIVELIB:.cmxa=.$(LIBEXT)) | |
46 | ||
47 | .SUFFIXES: .mli .ml .cmi .cmo .cmx | |
48 | ||
49 | diff --git a/runtime/Makefile.unix b/runtime/Makefile.unix | |
50 | index d51d6bb..6ee4812 100644 | |
51 | --- a/runtime/Makefile.unix | |
52 | +++ b/runtime/Makefile.unix | |
53 | @@ -26,10 +26,10 @@ dllcamlidl.so libcamlidl.a: $(OBJS) | |
54 | # $(RANLIB) $@ | |
55 | ||
56 | install: | |
57 | - cp camlidlruntime.h $(OCAMLLIB)/caml/camlidlruntime.h | |
58 | - cp libcamlidl.a $(OCAMLLIB)/libcamlidl.a | |
59 | - cp dllcamlidl.so $(OCAMLLIB)/stublibs/dllcamlidl.so | |
60 | - cd $(OCAMLLIB); $(RANLIB) libcamlidl.a | |
61 | + cp camlidlruntime.h $(DESTDIR)$(OCAMLLIB)/caml/camlidlruntime.h | |
62 | + cp libcamlidl.a $(DESTDIR)$(OCAMLLIB)/libcamlidl.a | |
63 | + cp dllcamlidl.so $(DESTDIR)$(OCAMLLIB)/stublibs/dllcamlidl.so | |
64 | + cd $(DESTDIR)$(OCAMLLIB); $(RANLIB) libcamlidl.a | |
65 | ||
66 | clean: | |
67 | rm -f *.a *.o *.so | |
68 | -- | |
69 | 2.26.2 | |
70 |