aboutsummaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorIgor Pashev <igor.pashev@nexenta.com>2012-11-09 21:47:09 +0400
committerIgor Pashev <igor.pashev@nexenta.com>2012-11-09 21:48:03 +0400
commit91ffb1070ce375e510e970cf17f7794907f0cc1a (patch)
tree5424a9847f6b351f420077c098cf531896cb253e /rules
parentf3d91b806b27eea32396148f0667f99a5ca1e8eb (diff)
downloadcibs-91ffb1070ce375e510e970cf17f7794907f0cc1a.tar.gz
Use variants; avoid implicit rules
Diffstat (limited to 'rules')
-rw-r--r--rules/32.mk4
-rw-r--r--rules/64.mk4
-rw-r--r--rules/autotools.mk9
-rw-r--r--rules/common.mk22
4 files changed, 21 insertions, 18 deletions
diff --git a/rules/32.mk b/rules/32.mk
index cb94b2a..a504c24 100644
--- a/rules/32.mk
+++ b/rules/32.mk
@@ -27,10 +27,6 @@ include /usr/share/cibs/rules/common.mk
$(eval $(call add-variant,32))
-build-stamp : build-32-stamp
-configure-stamp : configure-32-stamp
-install-stamp : install-32-stamp
-
%-32-stamp: bits = 32
# build32 = \#, not it is emtpy and lines like
diff --git a/rules/64.mk b/rules/64.mk
index f6b0349..5056969 100644
--- a/rules/64.mk
+++ b/rules/64.mk
@@ -27,10 +27,6 @@ include /usr/share/cibs/rules/common.mk
$(eval $(call add-variant,64))
-build-stamp : build-64-stamp
-configure-stamp : configure-64-stamp
-install-stamp : install-64-stamp
-
%-64-stamp: bits = 64
# build64 = \#, not it is emtpy and lines like
diff --git a/rules/autotools.mk b/rules/autotools.mk
index fd59ff3..bec3042 100644
--- a/rules/autotools.mk
+++ b/rules/autotools.mk
@@ -34,10 +34,10 @@ configure-env = \
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CXXFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
+ $(configure-env.$(variant)) \
configure-options = \
- $(configure-options.$(bits)) \
--prefix="$(prefix)" \
--libdir="$(libdir)" \
--bindir="$(bindir)" \
@@ -45,20 +45,21 @@ configure-options = \
--infodir=/usr/share/info \
--mandir=\$${prefix}/share/man \
--localstatedir=/var \
+ $(configure-options.$(variant)) \
-configure-%-stamp: pre-configure-stamp
+configure-%-stamp:
[ -d "$(builddir)" ] || mkdir -p "$(builddir)"
cd "$(builddir)" && \
env $(configure-env) \
$(configure) $(configure-options)
touch $@
-build-%-stamp: configure-%-stamp
+build-%-stamp:
cd "$(builddir)" && $(MAKE) $(make-jobs:%=-j%)
touch $@
-install-%-stamp: build-%-stamp
+install-%-stamp:
cd "$(builddir)" && $(MAKE) install DESTDIR="$(protodir)"
touch $@
diff --git a/rules/common.mk b/rules/common.mk
index 86bbef0..7358500 100644
--- a/rules/common.mk
+++ b/rules/common.mk
@@ -51,7 +51,19 @@ protodir-base.$1 = $(workdir-base)/proto/$1
builddir-base.$1 = $(workdir-base)/build/$1
protodir.$1 = $(workdir)/proto/$1
builddir.$1 = $(workdir)/build/$1
+
+configure-stamp : configure-$1-stamp
+build-stamp : build-$1-stamp
+install-stamp : install-$1-stamp
+
+configure-$1-stamp : pre-configure-stamp
+build-$1-stamp : configure-$1-stamp
+install-$1-stamp : build-$1-stamp
+
variants += $1
+
+%-$1-stamp: variant = $1
+
endef
@@ -69,11 +81,9 @@ libdir.32 = $(prefix)/lib/$(mach32)
libdir.64 = $(prefix)/lib/$(mach64)
bindir.32 = $(prefix)/bin
bindir.64 = $(prefix)/bin
-includedir.32 = /usr/include
-includedir.64 = /usr/include
+includedir = /usr/include
libdir.noarch = $(prefix)/lib
bindir.noarch = $(prefix)/bin
-includedir.noarch = /usr/include
PKG_CONFIG_PATH.32 = /usr/gnu/lib/$(mach32)/pkg-config:/usr/lib/$(mach32)/pkg-config
PKG_CONFIG_PATH.64 = /usr/gnu/lib/$(mach64)/pkg-config:/usr/lib/$(mach64)/pkg-config
@@ -82,11 +92,11 @@ export PKG_CONFIG_PATH = PKG_CONFIG_PATH.$(bits)
# $(bits) are target-specific and defined in 32.mk or 64.mk
bindir = $(bindir.$(bits))
libdir = $(libdir.$(bits))
-includedir = $(includedir.$(bits))
CC = $(CC.$(bits))
CXX = $(CXX.$(bits))
-builddir = $(builddir.$(bits))
-protodir = $(protodir.$(bits))
+
+builddir = $(builddir.$(variant))
+protodir = $(protodir.$(variant))