Skip to contentSkip to conversation

Add virt directory to the top Makefile

PATCH Superseded Feng Wu 3 participants 3 messages Sep 22, 2015

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Feng Wu

author
#0 lore raw

PATCH 1/1 Add virt directory to the top Makefile

We need to build files in virt/lib/, which are now used by KVM and VFIO, so add virt directory to the top Makefile.

---
 Makefile              | 8 +++++---
 arch/x86/kvm/Makefile | 3 ---
 virt/Makefile         | 1 +
 3 files changed, 6 insertions(+), 6 deletions(-)
 create mode 100644 virt/Makefile
Makefile +5 -3
index 35b4c19..d82fceb 100644
@@ -550,6 +550,7 @@ drivers-y	:= drivers/ sound/ firmware/
 net-y		:= net/
 libs-y		:= lib/
 core-y		:= usr/
+virt-y		:= virt/
 endif # KBUILD_EXTMOD
 
 ifeq ($(dot-config),1)
@@ -890,10 +891,10 @@ core-y		+= kernel/ mm/ fs/ ipc/ security/ crypto/ block/
 
 vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
 		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-		     $(net-y) $(net-m) $(libs-y) $(libs-m)))
+		     $(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y)))
 
 vmlinux-alldirs	:= $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
-		     $(init-) $(core-) $(drivers-) $(net-) $(libs-))))
+		     $(init-) $(core-) $(drivers-) $(net-) $(libs-) $(virt-))))
 
 init-y		:= $(patsubst %/, %/built-in.o, $(init-y))
 core-y		:= $(patsubst %/, %/built-in.o, $(core-y))
@@ -902,10 +903,11 @@ net-y		:= $(patsubst %/, %/built-in.o, $(net-y))
 libs-y1		:= $(patsubst %/, %/lib.a, $(libs-y))
 libs-y2		:= $(patsubst %/, %/built-in.o, $(libs-y))
 libs-y		:= $(libs-y1) $(libs-y2)
+virt-y		:= $(patsubst %/, %/built-in.o, $(virt-y))
 
 # Externally visible symbols (used by link-vmlinux.sh)
 export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)
-export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y)
+export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y) $(virt-y)
 export KBUILD_LDS          := arch/$(SRCARCH)/kernel/vmlinux.lds
 export LDFLAGS_vmlinux
 # used by scripts/pacmage/Makefile
arch/x86/kvm/Makefile +0 -3
index 05cc2d7..67d215c 100644
@@ -6,9 +6,6 @@ CFLAGS_svm.o := -I.
 CFLAGS_vmx.o := -I.
 
 KVM := ../../../virt/kvm
-LIB := ../../../virt/lib
-
-obj-$(CONFIG_IRQ_BYPASS_MANAGER)	+= $(LIB)/
 
 kvm-y			+= $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
 				$(KVM)/eventfd.o $(KVM)/irqchip.o $(KVM)/vfio.o
virt/Makefile new file +1 -0
new file mode 100644
index 0000000..335dc0b
@@ -0,0 +1 @@
+obj-y	+= ./lib/
Signature · 1 line
2.1.0
#1 lore raw
Quoted 10 lines · Feng Wu

We need to build files in virt/lib/, which are now used by KVM and VFIO, so add virt directory to the top Makefile.

---
 Makefile              | 8 +++++---
 arch/x86/kvm/Makefile | 3 ---
 virt/Makefile         | 1 +
 3 files changed, 6 insertions(+), 6 deletions(-)
 create mode 100644 virt/Makefile

I assume this will go through the kvm tree, is that correct?

Makefile core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ · line 894

Quoted 4 lines

vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \

Makefile +1 -1
 		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-		     $(net-y) $(net-m) $(libs-y) $(libs-m)))
+		     $(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y)))

This allows to drop the explicit 'virt' entry in the KBUILD_ALLDIRS assignment a few lines below.

virt/Makefile line 1

Quoted 7 lines
virt/Makefile new file +1 -0
new file mode 100644
index 0000000..335dc0b
@@ -0,0 +1 @@
+obj-y	+= ./lib/

Remove the ./

Michal

maintainer
#2 lore raw
Quoted 12 lines · Michal Marek
Quoted 10 lines · Feng Wu

We need to build files in virt/lib/, which are now used by KVM and VFIO, so add virt directory to the top Makefile.

---
 Makefile              | 8 +++++---
 arch/x86/kvm/Makefile | 3 ---
 virt/Makefile         | 1 +
 3 files changed, 6 insertions(+), 6 deletions(-)
 create mode 100644 virt/Makefile
Quoted 1 line

I assume this will go through the kvm tree, is that correct?

Yes. Feng, can you send a v2 of this patch for Michal to ack?

Paolo

Quoted 23 lines

Makefile core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ · line 894

Quoted 6 lines

vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \

Makefile +1 -1
 		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-		     $(net-y) $(net-m) $(libs-y) $(libs-m)))
+		     $(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y)))

This allows to drop the explicit 'virt' entry in the KBUILD_ALLDIRS assignment a few lines below.

virt/Makefile line 1

Quoted 7 lines
virt/Makefile new file +1 -0
new file mode 100644
index 0000000..335dc0b
@@ -0,0 +1 @@
+obj-y	+= ./lib/

Remove the ./

Michal