aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <igor.pashev@nexenta.com>2012-10-26 13:35:26 +0400
committerIgor Pashev <igor.pashev@nexenta.com>2012-10-26 13:35:26 +0400
commit29cbb3fd6e46de4f46a45f1eca80f6de279324d5 (patch)
tree68aefaabdd41af0c5ab60cfdbf2ca86bb3158584
parent32c4576478363eb0b47ccc2a77333d149879e1a6 (diff)
downloadcibs-29cbb3fd6e46de4f46a45f1eca80f6de279324d5.tar.gz
Define variants (32/64/noarch/etc) on the fly
-rw-r--r--rules/32.mk4
-rw-r--r--rules/64.mk6
-rw-r--r--rules/common.mk13
-rw-r--r--rules/noarch.mk4
4 files changed, 20 insertions, 7 deletions
diff --git a/rules/32.mk b/rules/32.mk
index 3bd29ba..4e32741 100644
--- a/rules/32.mk
+++ b/rules/32.mk
@@ -23,6 +23,10 @@
ifeq (,$(__32_mk))
+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
diff --git a/rules/64.mk b/rules/64.mk
index 29b63b7..ca13218 100644
--- a/rules/64.mk
+++ b/rules/64.mk
@@ -23,6 +23,10 @@
ifeq (,$(__64_mk))
+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
@@ -35,7 +39,7 @@ protodirs += $(destdir.64)
# $(build64) file path=...
# in manifests are included
build64 :=
-
+:
__64_mk := included
endif
diff --git a/rules/common.mk b/rules/common.mk
index 820b8f0..815ce94 100644
--- a/rules/common.mk
+++ b/rules/common.mk
@@ -40,14 +40,15 @@ mach := $(shell uname -p)
mach32 :=
mach64 := amd64
+define add-variant
+destdir.$1 = $(workdir)/proto/$1
+builddir.$1 = $(workdir)/build/$1
+endef
+
+
workdir := $(CURDIR)/work
sourcedir := $(workdir)/source
-destdir.32 := $(workdir)/proto/32
-destdir.64 := $(workdir)/proto/64
-destdir.noarch := $(workdir)/proto/noarch
-builddir.32 := $(workdir)/build/32
-builddir.64 := $(workdir)/build/64
-builddir.noarch := $(workdir)/build/noarch
+$(eval $(call add-variant,64))
CC.32 = gcc -m32
CC.64 = gcc -m64
diff --git a/rules/noarch.mk b/rules/noarch.mk
index 92103fa..e22d9be 100644
--- a/rules/noarch.mk
+++ b/rules/noarch.mk
@@ -23,6 +23,10 @@
ifeq (,$(__noarch_mk))
+include /usr/share/cibs/rules/common.mk
+
+$(eval $(call add-variant,noarch))
+
build-stamp : build-noarch-stamp
configure-stamp : configure-noarch-stamp
install-stamp : install-noarch-stamp