[Pkg-ocaml-maint-commits] [SCM] dose2 packaging branch, master, updated. 7fed3623d29483b6d41c545f29ab58c7c09ca1b6

Stefano Zacchiroli zack at upsilon.cc
Thu Apr 10 13:42:56 UTC 2008


The following commit has been merged in the master branch:
commit 770bafbfd9700fdd0907237f4634322a29255f54
Author: Stefano Zacchiroli <zack at upsilon.cc>
Date:   Thu Apr 10 15:25:09 2008 +0200

    support for installing to a non-standard directory
    
    Setting externally the DESTDIR make varilable (as in
    "make install DESTDIR=/shome/where") now gives the ability to install
    somewhere else wrt the standard installation directory.

diff --git a/Makefile b/Makefile
index 7b30173..1052577 100644
--- a/Makefile
+++ b/Makefile
@@ -30,9 +30,10 @@ clean:
 	  $(DO) -C $$x clean ; \
 	done
 
+DESTDIR =
 install:
 	@for x in $(DIRS) ; do \
-	  $(DO) -C $$x install ; \
+	  $(DO) -C $$x install DESTDIR=$(DESTDIR) ; \
 	done
 
 define EXEC_TEMPLATE
diff --git a/make/Makefile.common b/make/Makefile.common
index 026db69..7f367c4 100644
--- a/make/Makefile.common
+++ b/make/Makefile.common
@@ -19,10 +19,17 @@ OCAMLLEX   = ocamllex
 OCAMLMKLIB = ocamlmklib
 MENHIR     = menhir
 
+ifneq ($(DESTDIR),)
+DESTFLAG = -destdir $(DESTDIR)
+else
+DESTFLAG =
+endif
+
 .PHONY: install
 install: all
 	{ test ! -f $(XARCHIVE) || extra1="*.cmxa *.a"; }; \
-	$(OCAMLFIND) install $(NAME) *.mli *.cmi *.cma META $$extra1 $(extra2)
+	{ test -z "$(DESTDIR)" || mkdir -p "$(DESTDIR)"; }; \
+	$(OCAMLFIND) install $(DESTFLAG) $(NAME) *.mli *.cmi *.cma META $$extra1 $(extra2)
 
 .PHONY: uninstall
 uninstall:

-- 
dose2 packaging



More information about the Pkg-ocaml-maint-commits mailing list