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
)
36 make
-C kernel LINUX
=$(KERNELDIR
) header-sync
37 rm -f kernel
/include/asm
38 ln
-sf asm-
$(sane-arch
) kernel
/include/asm
42 cp bios
/BIOS-bochs-latest qemu
/pc-bios
/bios.bin
46 cp vgabios
/VGABIOS-lgpl-latest.bin qemu
/pc-bios
/vgabios.bin
47 cp vgabios
/VGABIOS-lgpl-latest.cirrus.bin qemu
/pc-bios
/vgabios-cirrus.bin
51 if
! [ -f qemu
/pc-bios
/extboot.bin
] \
52 ||
! cmp
-s qemu
/pc-bios
/extboot.bin extboot
/extboot.bin
; then \
53 cp extboot
/extboot.bin qemu
/pc-bios
/extboot.bin
; \
61 make
-C kernel sync LINUX
=$(shell readlink
-f
"$(LINUX)")
67 utilsdir
= /etc
/kvm
/utils
70 mkdir
-p
$(DESTDIR
)/$(bindir)
71 mkdir
-p
$(DESTDIR
)/$(confdir
)
72 mkdir
-p
$(DESTDIR
)/$(initdir
)
73 mkdir
-p
$(DESTDIR
)/$(utilsdir
)
74 mkdir
-p
$(DESTDIR
)/etc
/udev
/rules.d
75 make
-C qemu DESTDIR
=$(DESTDIR
)/ install
76 ln
-sf
/usr
/kvm
/bin
/qemu-system-x86_64
$(DESTDIR
)/$(bin
)
77 install -m
755 kvm_stat
$(DESTDIR
)/$(bindir)/kvm_stat
78 cp scripts
/kvm
$(DESTDIR
)/$(initdir
)/kvm
79 cp scripts
/qemu-ifup
$(DESTDIR
)/$(confdir
)/qemu-ifup
80 install -t
$(DESTDIR
)/etc
/udev
/rules.d scripts
/*kvm
*.rules
83 $(kcmd
)make
-C kernel DESTDIR
="$(DESTDIR)" install
84 make
-C libkvm DESTDIR
="$(DESTDIR)" install
85 make
-C qemu DESTDIR
="$(DESTDIR)" install
87 tmpspec
= .tmp.kvm.spec
88 RPMTOPDIR
= $$(pwd
)/rpmtop
91 rm -rf
$(RPMTOPDIR
)/BUILD
92 mkdir
-p
$(RPMTOPDIR
)/{BUILD
,RPMS
/$$(uname
-i
)}
94 --define="_topdir $(RPMTOPDIR)" \
95 $(RPMTOPDIR
)/SRPMS
/kvm-0.0
-$(rpmrelease
).src.rpm
98 mkdir
-p
$(RPMTOPDIR
)/{SOURCES
,SRPMS
}
99 sed
's/^Release:.*/Release: $(rpmrelease)/' kvm.spec
> $(tmpspec
)
100 tar czf
$(RPMTOPDIR
)/SOURCES
/kvm.
tar.gz qemu
101 tar czf
$(RPMTOPDIR
)/SOURCES
/user.
tar.gz user
102 tar czf
$(RPMTOPDIR
)/SOURCES
/libkvm.
tar.gz libkvm
103 tar czf
$(RPMTOPDIR
)/SOURCES
/kernel.
tar.gz kernel
104 tar czf
$(RPMTOPDIR
)/SOURCES
/scripts.
tar.gz scripts
105 tar czf
$(RPMTOPDIR
)/SOURCES
/extboot.
tar.gz extboot
106 cp Makefile configure kvm_stat
$(RPMTOPDIR
)/SOURCES
107 rpmbuild
--define="_topdir $(RPMTOPDIR)" -bs
$(tmpspec
)
111 for i in
$(if
$(WANT_MODULE
), kernel
) user libkvm qemu libfdt
; do \
117 rm -f config.mak user
/config.mak
121 find .
-wholename
'./kernel' -prune
-o
-name
"*.[ch]" -print > .
/cscope.files