8 .PHONY
: kernel user libkvm qemu bios vgabios extboot
clean
11 ifneq '$(filter $(ARCH), x86_64 i386 ia64)' ''
12 all: $(if
$(WANT_MODULE
), kernel
) user
15 kcmd
= $(if
$(WANT_MODULE
),,@\
#)
17 qemu kernel user libkvm
:
21 ifneq '$(filter $(ARCH), i386 x86_64)' ''
28 cp bios
/BIOS-bochs-latest qemu
/pc-bios
/bios.bin
32 cp vgabios
/VGABIOS-lgpl-latest.bin qemu
/pc-bios
/vgabios.bin
33 cp vgabios
/VGABIOS-lgpl-latest.cirrus.bin qemu
/pc-bios
/vgabios-cirrus.bin
37 if
! [ -f qemu
/pc-bios
/extboot.bin
] \
38 ||
! cmp
-s qemu
/pc-bios
/extboot.bin extboot
/extboot.bin
; then \
39 cp extboot
/extboot.bin qemu
/pc-bios
/extboot.bin
; \
47 utilsdir
= /etc
/kvm
/utils
50 mkdir
-p
$(DESTDIR
)/$(bindir)
51 mkdir
-p
$(DESTDIR
)/$(confdir
)
52 mkdir
-p
$(DESTDIR
)/$(initdir
)
53 mkdir
-p
$(DESTDIR
)/$(utilsdir
)
54 mkdir
-p
$(DESTDIR
)/etc
/udev
/rules.d
55 make
-C qemu DESTDIR
=$(DESTDIR
)/ install
56 ln
-sf
/usr
/kvm
/bin
/qemu-system-x86_64
$(DESTDIR
)/$(bin
)
57 install -m
755 kvm_stat
$(DESTDIR
)/$(bindir)/kvm_stat
58 cp scripts
/kvm
$(DESTDIR
)/$(initdir
)/kvm
59 cp scripts
/qemu-ifup
$(DESTDIR
)/$(confdir
)/qemu-ifup
60 install -t
$(DESTDIR
)/etc
/udev
/rules.d scripts
/*kvm
*.rules
63 $(kcmd
)make
-C kernel DESTDIR
="$(DESTDIR)" install
64 make
-C libkvm DESTDIR
="$(DESTDIR)" install
65 make
-C qemu DESTDIR
="$(DESTDIR)" install
67 tmpspec
= .tmp.kvm.spec
68 RPMTOPDIR
= $$(pwd
)/rpmtop
71 rm -rf
$(RPMTOPDIR
)/BUILD
72 mkdir
-p
$(RPMTOPDIR
)/{BUILD
,RPMS
/$$(uname
-i
)}
74 --define="_topdir $(RPMTOPDIR)" \
75 $(RPMTOPDIR
)/SRPMS
/kvm-0.0
-$(rpmrelease
).src.rpm
78 mkdir
-p
$(RPMTOPDIR
)/{SOURCES
,SRPMS
}
79 sed
's/^Release:.*/Release: $(rpmrelease)/' kvm.spec
> $(tmpspec
)
80 tar czf
$(RPMTOPDIR
)/SOURCES
/kvm.
tar.gz qemu
81 tar czf
$(RPMTOPDIR
)/SOURCES
/user.
tar.gz user
82 tar czf
$(RPMTOPDIR
)/SOURCES
/libkvm.
tar.gz libkvm
83 tar czf
$(RPMTOPDIR
)/SOURCES
/kernel.
tar.gz kernel
84 tar czf
$(RPMTOPDIR
)/SOURCES
/scripts.
tar.gz scripts
85 tar czf
$(RPMTOPDIR
)/SOURCES
/extboot.
tar.gz extboot
86 cp Makefile configure kvm_stat
$(RPMTOPDIR
)/SOURCES
87 rpmbuild
--define="_topdir $(RPMTOPDIR)" -bs
$(tmpspec
)
91 for i in
$(if
$(WANT_MODULE
), kernel
) user libkvm qemu
; do \
94 rm -f config.mak user
/config.mak