kvm: qemu: virtio_blk_init return PCIDevice pointer
[kvm-userspace.git] / Makefile
blobd4cd8776b30b877176296436114c117349b5b507
2 include config.mak
4 DESTDIR=
6 rpmrelease = devel
8 .PHONY: kernel user libkvm qemu bios vgabios extboot clean
10 all: libkvm qemu
11 ifneq '$(filter $(ARCH), x86_64 i386 ia64)' ''
12 all: $(if $(WANT_MODULE), kernel) user
13 endif
15 kcmd = $(if $(WANT_MODULE),,@\#)
17 qemu kernel user libkvm:
18 $(MAKE) -C $@
20 qemu: libkvm
21 ifneq '$(filter $(ARCH), i386 x86_64)' ''
22 qemu: extboot
23 endif
24 user: libkvm
26 bios:
27 $(MAKE) -C $@
28 cp bios/BIOS-bochs-latest qemu/pc-bios/bios.bin
30 vgabios:
31 $(MAKE) -C $@
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
35 extboot:
36 $(MAKE) -C $@
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; \
43 bindir = /usr/bin
44 bin = $(bindir)/kvm
45 initdir = /etc/init.d
46 confdir = /etc/kvm
47 utilsdir = /etc/kvm/utils
49 install-rpm:
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
62 install:
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
70 rpm: srpm
71 rm -rf $(RPMTOPDIR)/BUILD
72 mkdir -p $(RPMTOPDIR)/{BUILD,RPMS/$$(uname -i)}
73 rpmbuild --rebuild \
74 --define="_topdir $(RPMTOPDIR)" \
75 $(RPMTOPDIR)/SRPMS/kvm-0.0-$(rpmrelease).src.rpm
77 srpm:
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)
88 $(RM) $(tmpspec)
90 clean:
91 for i in $(if $(WANT_MODULE), kernel) user libkvm qemu; do \
92 make -C $$i clean; \
93 done
94 rm -f config.mak user/config.mak