Permalink
Browse files

Lots of environment variables to configure build/install

  • Loading branch information...
1 parent aef15eb commit 8776f17cb531f0662c13e9472daf2ee57c92cd9e @thelema thelema committed Feb 18, 2010
Showing with 22 additions and 6 deletions.
  1. +7 −3 OMakefile
  2. +14 −2 README
  3. +1 −1 libs/estring/OMakefile
View
@@ -1,5 +1,5 @@
BYTE_ENABLED = true
-#NATIVE_ENABLED = false # true only if ocamlopt exists
+NATIVE_ENABLED = $(getenv BATTERIES_NATIVE, true)
USE_OCAMLFIND = true
OCAMLPACKS[] +=
@@ -14,13 +14,17 @@ OCAMLCFLAGS += -g
OCAMLDEP_MODULES_ENABLED = false
OCAMLROOT = $(shell ocamlfind printconf destdir)
-DOCROOT = /usr/share/doc/ocaml-batteries/
+DOCROOT = $(getenv BATTERIES_DOCROOT,/usr/share/doc/ocaml-batteries/)
BROWSER_COMMAND = x-www-browser %s
NAME = batteries
VERSION = 1.1.0
LIBSDIR = $(ROOT)/libs
+DESTOPT =
+if $(defined-env DESTDIR)
+ DESTOPT += -destdir $(getenv DESTDIR)
+ export DESTOPT
.PHONY: doc uninstall install all clean test reinstall install-doc release
.DEFAULT: all
@@ -53,7 +57,7 @@ uninstall:
rm -rf $(DOCROOT)
install: all build/META
- $(OCAMLFIND) install $(NAME) build/META $(BAT_FILES)
+ $(OCAMLFIND) install $(DESTOPT) $(NAME) build/META $(BAT_FILES)
doc: src/batteries.cma
if $(not $(test -e hdoc/index.html))
View
16 README
@@ -24,8 +24,7 @@ You will need
**** Configuration and installation ****
-To install the full version of OCaml Batteries Included in the default
-directory (/usr/local/), execute
+To install the full version of OCaml Batteries Included, execute
$ omake all
$ omake test [ optional ]
@@ -34,6 +33,19 @@ directory (/usr/local/), execute
$ omake doc [ optional ]
$ sudo omake install-doc [ optional ]
+If you want the documentation installed elsewhere, set this *before*
+starting the build process (it becomes part of batteries_config.ml).
+
+ $ export BATTERIES_DOCROOT=/path/to/new/docroot/
+
+If you want findlib to use a -destdir argument to [ocamlfind install], set
+
+ $ export DESTDIR=/path/to/findlib/dest
+
+To disable native compilation:
+
+ $ export BATTERIES_NATIVE=false
+
*** Using Batteries ***
To get started using Batteries at the toplevel, copy the ocamlinit
View
@@ -9,7 +9,7 @@ META: VERSION META.in
FILES[] = pa_estring.cmi pa_estring.cmo pa_estring_top.cmo
install: $(FILES) META
- $(OCAMLFIND) install estring META *.mli *.cmi *.cmo
+ $(OCAMLFIND) install $(DESTOPT) estring META *.mli *.cmi *.cmo
uninstall:
$(OCAMLFIND) remove estring

0 comments on commit 8776f17

Please sign in to comment.