summaryrefslogtreecommitdiff
path: root/tools/Makefile.shared
diff options
context:
space:
mode:
authorGabriel Scherer <gabriel.scherer@gmail.com>2014-04-07 07:06:17 +0000
committerGabriel Scherer <gabriel.scherer@gmail.com>2014-04-07 07:06:17 +0000
commitde4f4cf8b39785866f50b97443837c6c990ad27e (patch)
treeab1ae349f2b673c9c40f7842f75811f07c15936e /tools/Makefile.shared
parent2ba45f9a2216957a3d8e015a237b59152bb0cea3 (diff)
downloadocaml-de4f4cf8b39785866f50b97443837c6c990ad27e.tar.gz
PR#6358: obey DESTDIR in install targets
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'tools/Makefile.shared')
-rw-r--r--tools/Makefile.shared30
1 files changed, 17 insertions, 13 deletions
diff --git a/tools/Makefile.shared b/tools/Makefile.shared
index 39be1db4e9..b50cb0adde 100644
--- a/tools/Makefile.shared
+++ b/tools/Makefile.shared
@@ -54,10 +54,14 @@ clean::
if test -f ocamldep; then mv -f ocamldep ocamldep.bak; else :; fi
rm -f ocamldep.opt
+
+INSTALL_BINDIR=$(DESTDIR)$(BINDIR)
+INSTALL_LIBDIR=$(DESTDIR)$(LIBDIR)
+
install::
- cp ocamldep $(BINDIR)/ocamldep$(EXE)
+ cp ocamldep $(INSTALL_BINDIR)/ocamldep$(EXE)
if test -f ocamldep.opt; \
- then cp ocamldep.opt $(BINDIR)/ocamldep.opt$(EXE); else :; fi
+ then cp ocamldep.opt $(INSTALL_BINDIR)/ocamldep.opt$(EXE); else :; fi
# The profiler
@@ -79,13 +83,13 @@ ocamloptp: ocamloptp.cmo
opt:: profiling.cmx
install::
- cp ocamlprof $(BINDIR)/ocamlprof$(EXE)
- cp ocamlcp $(BINDIR)/ocamlcp$(EXE)
- cp ocamloptp $(BINDIR)/ocamloptp$(EXE)
- cp profiling.cmi profiling.cmo $(LIBDIR)
+ cp ocamlprof $(INSTALL_BINDIR)/ocamlprof$(EXE)
+ cp ocamlcp $(INSTALL_BINDIR)/ocamlcp$(EXE)
+ cp ocamloptp $(INSTALL_BINDIR)/ocamloptp$(EXE)
+ cp profiling.cmi profiling.cmo $(INSTALL_LIBDIR)
installopt::
- cp profiling.cmx profiling.o $(LIBDIR)
+ cp profiling.cmx profiling.o $(INSTALL_LIBDIR)
clean::
rm -f ocamlprof ocamlcp ocamloptp
@@ -97,7 +101,7 @@ ocamlmklib: ocamlmklibconfig.cmo ocamlmklib.cmo
$(CAMLC) $(LINKFLAGS) -o ocamlmklib ocamlmklibconfig.cmo ocamlmklib.cmo
install::
- cp ocamlmklib $(BINDIR)/ocamlmklib$(EXE)
+ cp ocamlmklib $(INSTALL_BINDIR)/ocamlmklib$(EXE)
clean::
rm -f ocamlmklib
@@ -132,7 +136,7 @@ lexer299.ml: lexer299.mll
$(CAMLLEX) lexer299.mll
#install::
-# cp ocaml299to3 $(BINDIR)/ocaml299to3$(EXE)
+# cp ocaml299to3 $(INSTALL_BINDIR)/ocaml299to3$(EXE)
clean::
rm -f ocaml299to3 lexer299.ml
@@ -148,7 +152,7 @@ lexer301.ml: lexer301.mll
$(CAMLLEX) lexer301.mll
#install::
-# cp scrapelabels $(LIBDIR)
+# cp scrapelabels $(INSTALL_LIBDIR)
clean::
rm -f scrapelabels lexer301.ml
@@ -164,7 +168,7 @@ addlabels: addlabels.cmo
$(ADDLABELS_IMPORTS) addlabels.cmo
#install::
-# cp addlabels $(LIBDIR)
+# cp addlabels $(INSTALL_LIBDIR)
clean::
rm -f addlabels
@@ -285,8 +289,8 @@ objinfo: objinfo_helper$(EXE) $(OBJINFO)
$(CAMLC) -o objinfo $(OBJINFO)
install::
- cp objinfo $(BINDIR)/ocamlobjinfo$(EXE)
- cp objinfo_helper$(EXE) $(LIBDIR)/objinfo_helper$(EXE)
+ cp objinfo $(INSTALL_BINDIR)/ocamlobjinfo$(EXE)
+ cp objinfo_helper$(EXE) $(INSTALL_LIBDIR)/objinfo_helper$(EXE)
clean::
rm -f objinfo objinfo_helper$(EXE)