aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <igor.pashev@nexenta.com>2012-12-19 11:27:22 +0400
committerIgor Pashev <igor.pashev@nexenta.com>2012-12-19 11:27:22 +0400
commitfdcf880b3c8c67f08453f553474a551e9707d29d (patch)
treed09ca40a4924eb386a85187438da61bbc85dc1b6
parent78e72b99085c8aabdb4382bca7b084f921cd6213 (diff)
downloadcibs-fdcf880b3c8c67f08453f553474a551e9707d29d.tar.gz
autotools.mk: allow target-specific variable for make
-rw-r--r--README.md14
-rw-r--r--rules/autotools.mk6
2 files changed, 18 insertions, 2 deletions
diff --git a/README.md b/README.md
index 0fccce1..7930d76 100644
--- a/README.md
+++ b/README.md
@@ -118,6 +118,20 @@ You can tune building by defining variables like `configure-options.FOO`, e. g.:
configure-options.gnu = --without-ssl --with-gnutls
configure-options.ssl = --with-ssl --without-gnutls
+## autotools.mk
+
+This module defines configure, build and install targets by GNU autotools.
+These targets are implicit (e. g. `configure-%-stamp`), and you can completely
+override any of them by explicit target (e. g. `configure-foo-stamp`) in the top Makefile.
+Build and install targets use target-specific variable `target` for invoking `make`.
+This variable is empty for `build-%-stamp` and is set to "install" for `install-%-stamp`.
+You can redefine it in the top Makefile to build/install only a subset of a package. E. g.
+for NCurses with wide character support this will build and install only libraries (without
+programs and terminal database):
+
+ $(eval $(call add-variant,wide))
+ build-wide-stamp: target = libs
+ install-wide-stamp: target = install.libs
## ips.mk
diff --git a/rules/autotools.mk b/rules/autotools.mk
index ce9d3be..d2b6349 100644
--- a/rules/autotools.mk
+++ b/rules/autotools.mk
@@ -55,12 +55,14 @@ configure-%-stamp:
$(configure) $(configure-options)
touch $@
+build-%-stamp: target =
build-%-stamp:
- cd "$(builddir)" && $(MAKE) $(make-jobs:%=-j%) V=1
+ cd "$(builddir)" && $(MAKE) $(make-jobs:%=-j%) $(target) V=1
touch $@
+install-%-stamp: target = install
install-%-stamp:
- cd "$(builddir)" && $(MAKE) install DESTDIR="$(protodir)"
+ cd "$(builddir)" && $(MAKE) $(target) DESTDIR="$(protodir)"
touch $@