[CRIU] [PATCH 08/10] common: Move atomic.h in
Cyrill Gorcunov
gorcunov at openvz.org
Mon Oct 24 04:58:08 PDT 2016
Since in criu we can't choose proper
arch inside include statements (well,
it will simply require more ifdefs),
I generate include/common/asm symlink
to point proper architecture.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
Makefile | 10 +++++++++-
criu/include/atomic.h | 2 +-
.../include => include/common/arch/aarch64}/asm/atomic.h | 0
.../arch/arm/include => include/common/arch/arm}/asm/atomic.h | 0
.../ppc64/include => include/common/arch/ppc64}/asm/atomic.h | 0
.../arch/x86/include => include/common/arch/x86}/asm/atomic.h | 0
6 files changed, 10 insertions(+), 2 deletions(-)
rename {criu/arch/aarch64/include => include/common/arch/aarch64}/asm/atomic.h (100%)
rename {criu/arch/arm/include => include/common/arch/arm}/asm/atomic.h (100%)
rename {criu/arch/ppc64/include => include/common/arch/ppc64}/asm/atomic.h (100%)
rename {criu/arch/x86/include => include/common/arch/x86}/asm/atomic.h (100%)
diff --git a/Makefile b/Makefile
index c75cbfbdbd7d..7fbb1dbfef5f 100644
--- a/Makefile
+++ b/Makefile
@@ -132,7 +132,7 @@ ifeq ($(GMON),1)
export GMON GMONLDOPT
endif
-CFLAGS += $(WARNINGS) $(DEFINES)
+CFLAGS += $(WARNINGS) $(DEFINES) -iquote include/common
# Default target
all: criu lib
@@ -178,6 +178,13 @@ endif
$(Q) echo "#endif /* __CR_VERSION_H__ */" >> $@
#
+# Setup proper link for asm headers in common code.
+include/common/asm: include/common/arch/$(ARCH)/asm
+ $(call msg-gen, $@)
+ $(Q) ln -s ./arch/$(ARCH)/asm $@
+$(VERSION_HEADER): include/common/asm
+
+#
# piegen tool might be disabled by hands. Don't use it until
# you know what you're doing.
ifneq ($(filter ia32 x86 ppc64,$(ARCH)),)
@@ -271,6 +278,7 @@ mrproper: subclean
$(Q) $(RM) $(CONFIG_HEADER)
$(Q) $(RM) $(SOCCR_CONFIG)
$(Q) $(RM) $(VERSION_HEADER)
+ $(Q) $(RM) include/common/asm
$(Q) $(RM) $(COMPEL_VERSION_HEADER)
$(Q) $(RM) cscope.*
$(Q) $(RM) tags TAGS
diff --git a/criu/include/atomic.h b/criu/include/atomic.h
index 80294ff63161..41ac6323466e 100644
--- a/criu/include/atomic.h
+++ b/criu/include/atomic.h
@@ -1,4 +1,4 @@
#ifndef __CR_INC_ATOMIC_H__
#define __CR_INC_ATOMIC_H__
-#include "asm/atomic.h"
+#include "common/asm/atomic.h"
#endif
diff --git a/criu/arch/aarch64/include/asm/atomic.h b/include/common/arch/aarch64/asm/atomic.h
similarity index 100%
rename from criu/arch/aarch64/include/asm/atomic.h
rename to include/common/arch/aarch64/asm/atomic.h
diff --git a/criu/arch/arm/include/asm/atomic.h b/include/common/arch/arm/asm/atomic.h
similarity index 100%
rename from criu/arch/arm/include/asm/atomic.h
rename to include/common/arch/arm/asm/atomic.h
diff --git a/criu/arch/ppc64/include/asm/atomic.h b/include/common/arch/ppc64/asm/atomic.h
similarity index 100%
rename from criu/arch/ppc64/include/asm/atomic.h
rename to include/common/arch/ppc64/asm/atomic.h
diff --git a/criu/arch/x86/include/asm/atomic.h b/include/common/arch/x86/asm/atomic.h
similarity index 100%
rename from criu/arch/x86/include/asm/atomic.h
rename to include/common/arch/x86/asm/atomic.h
--
2.7.4
More information about the CRIU
mailing list