8 sane-arch
= $(subst i386
,x86
,$(subst x86_64
,x86
,$(subst s390x
,s390
,$(ARCH
))))
10 .PHONY
: kernel user libkvm qemu bios vgabios extboot
clean libfdt cscope
13 ifneq '$(filter $(ARCH), x86_64 i386 ia64)' ''
14 all: $(if
$(WANT_MODULE
), kernel
) user
17 kcmd
= $(if
$(WANT_MODULE
),,@\
#)
19 qemu kernel user libkvm
:
23 ifneq '$(filter $(ARCH), i386 x86_64)' ''
26 ifneq '$(filter $(ARCH), powerpc ia64)' ''
31 user libkvm qemu
: header-sync-
$(if
$(WANT_MODULE
),n
,y
)
37 LINUX
=$(if
$(KERNELSOURCEDIR
),$(KERNELSOURCEDIR
),$(KERNELDIR
)) \
39 rm -f kernel
/include/asm
40 ln
-sf asm-
$(sane-arch
) kernel
/include/asm
44 cp bios
/BIOS-bochs-latest qemu
/pc-bios
/bios.bin
48 cp vgabios
/VGABIOS-lgpl-latest.bin qemu
/pc-bios
/vgabios.bin
49 cp vgabios
/VGABIOS-lgpl-latest.cirrus.bin qemu
/pc-bios
/vgabios-cirrus.bin
53 if
! [ -f qemu
/pc-bios
/extboot.bin
] \
54 ||
! cmp
-s qemu
/pc-bios
/extboot.bin extboot
/extboot.bin
; then \
55 cp extboot
/extboot.bin qemu
/pc-bios
/extboot.bin
; \
63 make
-C kernel sync LINUX
=$(shell readlink
-f
"$(LINUX)")
69 utilsdir
= /etc
/kvm
/utils
72 mkdir
-p
$(DESTDIR
)/$(bindir)
73 mkdir
-p
$(DESTDIR
)/$(confdir
)
74 mkdir
-p
$(DESTDIR
)/$(initdir
)
75 mkdir
-p
$(DESTDIR
)/$(utilsdir
)
76 mkdir
-p
$(DESTDIR
)/etc
/udev
/rules.d
77 make
-C qemu DESTDIR
=$(DESTDIR
)/ install
78 ln
-sf
/usr
/kvm
/bin
/qemu-system-x86_64
$(DESTDIR
)/$(bin
)
79 install -m
755 kvm_stat
$(DESTDIR
)/$(bindir)/kvm_stat
80 cp scripts
/kvm
$(DESTDIR
)/$(initdir
)/kvm
81 cp scripts
/qemu-ifup
$(DESTDIR
)/$(confdir
)/qemu-ifup
82 install -t
$(DESTDIR
)/etc
/udev
/rules.d scripts
/*kvm
*.rules
85 $(kcmd
)make
-C kernel DESTDIR
="$(DESTDIR)" install
86 make
-C libkvm DESTDIR
="$(DESTDIR)" install
87 make
-C qemu DESTDIR
="$(DESTDIR)" install
89 tmpspec
= .tmp.kvm.spec
90 RPMTOPDIR
= $$(pwd
)/rpmtop
93 rm -rf
$(RPMTOPDIR
)/BUILD
94 mkdir
-p
$(RPMTOPDIR
)/{BUILD
,RPMS
/$$(uname
-i
)}
96 --define="_topdir $(RPMTOPDIR)" \
97 $(RPMTOPDIR
)/SRPMS
/kvm-0.0
-$(rpmrelease
).src.rpm
100 mkdir
-p
$(RPMTOPDIR
)/{SOURCES
,SRPMS
}
101 sed
's/^Release:.*/Release: $(rpmrelease)/' kvm.spec
> $(tmpspec
)
102 tar czf
$(RPMTOPDIR
)/SOURCES
/kvm.
tar.gz qemu
103 tar czf
$(RPMTOPDIR
)/SOURCES
/user.
tar.gz user
104 tar czf
$(RPMTOPDIR
)/SOURCES
/libkvm.
tar.gz libkvm
105 tar czf
$(RPMTOPDIR
)/SOURCES
/kernel.
tar.gz kernel
106 tar czf
$(RPMTOPDIR
)/SOURCES
/scripts.
tar.gz scripts
107 tar czf
$(RPMTOPDIR
)/SOURCES
/extboot.
tar.gz extboot
108 cp Makefile configure kvm_stat
$(RPMTOPDIR
)/SOURCES
109 rpmbuild
--define="_topdir $(RPMTOPDIR)" -bs
$(tmpspec
)
113 for i in
$(if
$(WANT_MODULE
), kernel
) user libkvm qemu libfdt
; do \
119 rm -f config.mak user
/config.mak
123 find .
-wholename
'./kernel' -prune
-o
-name
"*.[ch]" -print > .
/cscope.files