Skip to contentSkip to conversation

Make "make sync" in kernel dir work for multiple archs

PATCH Superseded Jerone Young 3 participants 5 messages Apr 15, 2008 KVM

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make "make sync" in kernel dir work for multiple archs

1 file changed, 13 insertions(+), 5 deletions(-)

kernel/Makefile | 18 +++++++++++++-----

This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86.

kernel/Makefile +13 -5
@@ -1,5 +1,10 @@ include ../config.mak
 include ../config.mak
 
+ASM_DIR=$(ARCH)
+ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' ''
+	ASM_DIR=x86
+endif
+ 
 KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR))
 
 DESTDIR=
@@ -34,15 +39,16 @@ sync:
 sync:
 	rm -rf tmp include
 	rsync --exclude='*.mod.c' -R \
-             "$(LINUX)"/arch/x86/kvm/./*.[ch] \
+             "$(LINUX)"/arch/$(ASM_DIR)/kvm/./*.[ch] \
              "$(LINUX)"/virt/kvm/./*.[ch] \
 	     "$(LINUX)"/./include/linux/kvm*.h \
-	     "$(LINUX)"/./include/asm-x86/kvm*.h \
+	     "$(LINUX)"/./include/asm-$(ASM_DIR)/kvm*.h \
              tmp/
-	mkdir -p include/linux include/asm-x86
-	ln -s asm-x86 include/asm
-	ln -sf asm-x86 include-compat/asm
+	mkdir -p include/linux include/asm-$(ASM_DIR)
+	ln -s asm-$(ASM_DIR) include/asm
+	ln -sf asm-$(ASM_DIR) include-compat/asm
 
+ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' ''
 	$(call unifdef, include/linux/kvm.h)
 	$(call unifdef, include/linux/kvm_para.h)
 	$(call unifdef, include/asm-x86/kvm.h)
@@ -54,6 +60,8 @@ sync:
 	$(call hack, svm.c)
 	$(call hack, x86.c)
 	$(call hack, irq.h)
+endif
+
 	for i in $$(find tmp -type f -printf '%P '); \
 		do cmp -s $$i tmp/$$i || cp tmp/$$i $$i; done
 	rm -rf tmp

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

#1 lore raw
Quoted 12 lines · Jerone Young
1 file changed, 13 insertions(+), 5 deletions(-)

kernel/Makefile | 18 +++++++++++++-----

This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86.

kernel/Makefile include ../config.mak · line 7

Quoted 7 lines
kernel/Makefile +4 -0
@@ -1,5 +1,10 @@ include ../config.mak
 include ../config.mak
 
+ASM_DIR=$(ARCH)
+ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' ''
+	ASM_DIR=x86
+endif
 

That doesn't look correct for ia64...

Regards,

Anthony Liguori

Quoted 36 lines
kernel/Makefile +8 -6
 KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR))
 
 DESTDIR=
@@ -34,15 +39,16 @@ sync:
 sync:
 	rm -rf tmp include
 	rsync --exclude='*.mod.c' -R \
-             "$(LINUX)"/arch/x86/kvm/./*.[ch] \
+             "$(LINUX)"/arch/$(ASM_DIR)/kvm/./*.[ch] \
              "$(LINUX)"/virt/kvm/./*.[ch] \
 	     "$(LINUX)"/./include/linux/kvm*.h \
-	     "$(LINUX)"/./include/asm-x86/kvm*.h \
+	     "$(LINUX)"/./include/asm-$(ASM_DIR)/kvm*.h \
              tmp/
-	mkdir -p include/linux include/asm-x86
-	ln -s asm-x86 include/asm
-	ln -sf asm-x86 include-compat/asm
+	mkdir -p include/linux include/asm-$(ASM_DIR)
+	ln -s asm-$(ASM_DIR) include/asm
+	ln -sf asm-$(ASM_DIR) include-compat/asm
 
+ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' ''
 	$(call unifdef, include/linux/kvm.h)
 	$(call unifdef, include/linux/kvm_para.h)
 	$(call unifdef, include/asm-x86/kvm.h)
@@ -54,6 +60,8 @@ sync:
 	$(call hack, svm.c)
 	$(call hack, x86.c)
 	$(call hack, irq.h)
+endif
+
 	for i in $$(find tmp -type f -printf '%P '); \
 		do cmp -s $$i tmp/$$i || cp tmp/$$i $$i; done
 	rm -rf tmp
 
-------------------------------------------------------------------------
Quoted 9 lines

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

#2 lore raw
In reply to Jerone Young
Quoted 13 lines · On Monday 14 April 2008 21:46:43 Jerone Young wrote:
1 file changed, 13 insertions(+), 5 deletions(-)

kernel/Makefile | 18 +++++++++++++-----

This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86.

kernel/Makefile include ../config.mak · line 6

Quoted 6 lines
kernel/Makefile +4 -0
@@ -1,5 +1,10 @@ include ../config.mak
 include ../config.mak
 
+ASM_DIR=$(ARCH)
+ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' ''
+	ASM_DIR=x86
+endif

Minor complaint: "ASM_DIR" really isn't. You use it as arch/$(ASM_DIR) and also as include/asm-$(ASM_DIR). I think what you really meant is "ARCH_DIR" (or similar).

kernel/Makefile sync: · line 64

Quoted 10 lines
kernel/Makefile +3 -0
+ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' ''
 	$(call unifdef, include/linux/kvm.h)
 	$(call unifdef, include/linux/kvm_para.h)
 	$(call unifdef, include/asm-x86/kvm.h)
@@ -54,6 +60,8 @@ sync:
 	$(call hack, svm.c)
 	$(call hack, x86.c)
 	$(call hack, irq.h)
+endif
+

Why are you keeping IA64 touching asm-x86?

What happened to my suggestion of creating a per-arch HACK_FILES and UNIFDEF_FILES variables, and looping over those?

Signature · 8 lines
Hollis Blanchard
IBM Linux Technology Center

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
#3 lore raw
Quoted 16 lines · Hollis Blanchard
Quoted 15 lines · On Monday 14 April 2008 21:46:43 Jerone Young wrote:
1 file changed, 13 insertions(+), 5 deletions(-)

kernel/Makefile | 18 +++++++++++++-----

This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86.

kernel/Makefile +0 -0
@@ -1,5 +1,10 @@ include ../config.mak
 include ../config.mak
 
Quoted 8 lines

kernel/Makefile include ../config.mak · line 6

Quoted 4 lines
kernel/Makefile +4 -0
+ASM_DIR=$(ARCH)
+ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' ''
+	ASM_DIR=x86
+endif

Minor complaint: "ASM_DIR" really isn't. You use it as arch/$(ASM_DIR) and also as include/asm-$(ASM_DIR). I think what you really meant is "ARCH_DIR" (or similar).

I can change it. Not that big of a deal. Oh left the ia64 on there by accident.

Quoted 13 lines

kernel/Makefile sync: · line 64

Quoted 11 lines
kernel/Makefile +3 -0
+ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' ''
 	$(call unifdef, include/linux/kvm.h)
 	$(call unifdef, include/linux/kvm_para.h)
 	$(call unifdef, include/asm-x86/kvm.h)
@@ -54,6 +60,8 @@ sync:
 	$(call hack, svm.c)
 	$(call hack, x86.c)
 	$(call hack, irq.h)
+endif
+

Why are you keeping IA64 touching asm-x86?

Accident. Cut and past error from the first mistake.

Quoted 3 lines

What happened to my suggestion of creating a per-arch HACK_FILES and UNIFDEF_FILES variables, and looping over those?

These macros are only for x86. We don't want them or need them. So I just left them be as not to accidentally miss or break anything.

Quoted 1 line

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

#4 lore raw
Quoted 5 lines · On Tuesday 15 April 2008 11:20:58 Jerone Young wrote:
Quoted 2 lines

What happened to my suggestion of creating a per-arch HACK_FILES and UNIFDEF_FILES variables, and looping over those?

These macros are only for x86. We don't want them or need them. So I just left them be as not to accidentally miss or break anything.

Right, they are only used for x86. So as I said before, create arch-specific HACK_FILES and UNIFDEF_FILES variables, and use those instead.

Signature · 8 lines
Hollis Blanchard
IBM Linux Technology Center

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone