summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--README.md5
2 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index baa6859..6f2af0c 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,7 @@ BENCHINP?=README.md
JSMODULES=$(wildcard js/lib/*.js)
VERSION?=$(SPECVERSION)
RELEASE?=CommonMark-$(VERSION)
+INSTALL_PREFIX?=/usr/local
.PHONY: all cmake_build spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site npm debug mingw archive tarball ziparchive testtarball testziparchive testlib bench astyle
@@ -33,7 +34,10 @@ $(BUILDDIR): $(SRCDIR)/html_unescape.h $(SRCDIR)/case_fold_switch.inc
@cmake --version > /dev/null || (echo "You need cmake to build this program: http://www.cmake.org/download/" && exit 1)
mkdir -p $(BUILDDIR); \
cd $(BUILDDIR); \
- cmake .. -G "$(GENERATOR)" -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
+ cmake .. \
+ -G "$(GENERATOR)" \
+ -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
+ -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX)
install: $(BUILDDIR)
make -C $(BUILDDIR) install
diff --git a/README.md b/README.md
index ca8246e..776d886 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,10 @@ the repository to reduce build dependencies.
If you have GNU make, you can simply `make`, `make test`, and `make
install`. This calls [cmake] to create a `Makefile` in the `build`
directory, then uses that `Makefile` to create the executable and
-library. The binaries can be found in `build/src`.
+library. The binaries can be found in `build/src`. The default
+installation prefix is `/usr/local`. To change the installation
+prefix, pass the `INSTALL_PREFIX` variable if you run `make` for the
+first time: `make INSTALL_PREFIX=path`.
For a more portable method, you can use [cmake] manually. [cmake] knows
how to create build environments for many build systems. For example,