[CRIU] [PATCH 2/3] build: Move ARCH handling on toplevel

Cyrill Gorcunov gorcunov at openvz.org
Thu Apr 14 04:01:00 PDT 2016


We are going to build everything from toplevel
for convenience (just like it was before criu 2)
so move one more snippet on top.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile      | 41 ++++++++++++++++++++++++++++++++++++-----
 criu/Makefile | 33 +--------------------------------
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/Makefile b/Makefile
index e22c71e4d977..441c9b78b14f 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,42 @@ SRC_DIR	:= $(CURDIR)
 export SRC_DIR
 
 #
-# General architecture specific options.
+# Architecture specific options.
+ifneq ($(filter-out x86 arm arm64 ppc64,$(ARCH)),)
+        $(error "The architecture $(ARCH) isn't supported")
+endif
+
+ifeq ($(ARCH),x86)
+        SRCARCH		:= x86
+        LDARCH		:= i386:x86-64
+        VDSO		:= y
+endif
+
+ifeq ($(ARCH),arm)
+        SRCARCH		:= arm
+endif
+
+ifeq ($(ARCH),arm64)
+        ARCH		:= aarch64
+        SRCARCH		:= aarch64
+        VDSO		:= y
+endif
+
+ifeq ($(ARCH),ppc64)
+        SRCARCH		:= ppc64
+        LDARCH		:= powerpc:common64
+        VDSO		:= y
+endif
+
+LDARCH ?= $(SRCARCH)
+
+export SRCARCH LDARCH VDSO
+
+SRCARCH			?= $(ARCH)
+LDARCH			?= $(SRCARCH)
+
+export SRCARCH LDARCH VDSO
+
 UNAME-M := $(shell uname -m)
 export UNAME-M
 
@@ -54,10 +89,6 @@ ifeq ($(ARCH),x86)
         DEFINES		:= -DCONFIG_X86_64
 endif
 
-ifeq ($(ARCH),aarch64)
-	VDSO         := y
-endif
-
 #
 # The PowerPC 64 bits architecture could be big or little endian.
 # They are handled in the same way.
diff --git a/criu/Makefile b/criu/Makefile
index 539b7fd0832f..775a6a7a4dae 100644
--- a/criu/Makefile
+++ b/criu/Makefile
@@ -2,39 +2,8 @@
 # 6a8d90f5fec4 "attr: Allow attribute type 0" 
 LDFLAGS			+= -Wl,--wrap=nla_parse,--wrap=nlmsg_parse
 
-ifeq ($(ARCH),x86)
-        SRCARCH		:= x86
-        LDARCH		:= i386:x86-64
-        VDSO		:= y
-endif
-
-ifeq ($(ARCH),arm)
-        SRCARCH		:= arm
-endif
-
-ifeq ($(ARCH),arm64)
-        ARCH		:= aarch64
-        SRCARCH		:= aarch64
-        VDSO		:= y
-endif
-
-ifeq ($(ARCH),ppc64)
-        SRCARCH		:= ppc64
-        LDARCH		:= powerpc:common64
-        VDSO		:= y
-endif
-
-LDARCH ?= $(SRCARCH)
-
-export SRCARCH LDARCH VDSO
-
-SRCARCH			?= $(ARCH)
-LDARCH			?= $(SRCARCH)
 ARCH_DIR		:= arch/$(SRCARCH)
-
-export SRCARCH LDARCH ARCH_DIR VDSO
-
-$(if $(wildcard $(ARCH_DIR)),,$(error "The architecture $(ARCH) isn't supported"))
+export ARCH_DIR
 
 #
 # General flags.
-- 
2.5.5



More information about the CRIU mailing list