kvm: qemu: pass virtio disk geometry via config space
[kvm-userspace.git] / Makefile
blob76c149ac921bc4c4a5577b1d8561b9a0ca456de2
2 include config.mak
4 DESTDIR=
6 rpmrelease = devel
8 .PHONY: kernel user libkvm qemu bios vgabios extboot clean libfdt
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 ifneq '$(filter $(ARCH), powerpc)' ''
25 qemu: libfdt
26 endif
27 user: libkvm
29 bios:
30 $(MAKE) -C $@
31 cp bios/BIOS-bochs-latest qemu/pc-bios/bios.bin
33 vgabios:
34 $(MAKE) -C $@
35 cp vgabios/VGABIOS-lgpl-latest.bin qemu/pc-bios/vgabios.bin
36 cp vgabios/VGABIOS-lgpl-latest.cirrus.bin qemu/pc-bios/vgabios-cirrus.bin
38 extboot:
39 $(MAKE) -C $@
40 if ! [ -f qemu/pc-bios/extboot.bin ] \
41 || ! cmp -s qemu/pc-bios/extboot.bin extboot/extboot.bin; then \
42 cp extboot/extboot.bin qemu/pc-bios/extboot.bin; \
44 libfdt:
45 $(MAKE) -C $@
48 bindir = /usr/bin
49 bin = $(bindir)/kvm
50 initdir = /etc/init.d
51 confdir = /etc/kvm
52 utilsdir = /etc/kvm/utils
54 install-rpm:
55 mkdir -p $(DESTDIR)/$(bindir)
56 mkdir -p $(DESTDIR)/$(confdir)
57 mkdir -p $(DESTDIR)/$(initdir)
58 mkdir -p $(DESTDIR)/$(utilsdir)
59 mkdir -p $(DESTDIR)/etc/udev/rules.d
60 make -C qemu DESTDIR=$(DESTDIR)/ install
61 ln -sf /usr/kvm/bin/qemu-system-x86_64 $(DESTDIR)/$(bin)
62 install -m 755 kvm_stat $(DESTDIR)/$(bindir)/kvm_stat
63 cp scripts/kvm $(DESTDIR)/$(initdir)/kvm
64 cp scripts/qemu-ifup $(DESTDIR)/$(confdir)/qemu-ifup
65 install -t $(DESTDIR)/etc/udev/rules.d scripts/*kvm*.rules
67 install:
68 $(kcmd)make -C kernel DESTDIR="$(DESTDIR)" install
69 make -C libkvm DESTDIR="$(DESTDIR)" install
70 make -C qemu DESTDIR="$(DESTDIR)" install
72 tmpspec = .tmp.kvm.spec
73 RPMTOPDIR = $$(pwd)/rpmtop
75 rpm: srpm
76 rm -rf $(RPMTOPDIR)/BUILD
77 mkdir -p $(RPMTOPDIR)/{BUILD,RPMS/$$(uname -i)}
78 rpmbuild --rebuild \
79 --define="_topdir $(RPMTOPDIR)" \
80 $(RPMTOPDIR)/SRPMS/kvm-0.0-$(rpmrelease).src.rpm
82 srpm:
83 mkdir -p $(RPMTOPDIR)/{SOURCES,SRPMS}
84 sed 's/^Release:.*/Release: $(rpmrelease)/' kvm.spec > $(tmpspec)
85 tar czf $(RPMTOPDIR)/SOURCES/kvm.tar.gz qemu
86 tar czf $(RPMTOPDIR)/SOURCES/user.tar.gz user
87 tar czf $(RPMTOPDIR)/SOURCES/libkvm.tar.gz libkvm
88 tar czf $(RPMTOPDIR)/SOURCES/kernel.tar.gz kernel
89 tar czf $(RPMTOPDIR)/SOURCES/scripts.tar.gz scripts
90 tar czf $(RPMTOPDIR)/SOURCES/extboot.tar.gz extboot
91 cp Makefile configure kvm_stat $(RPMTOPDIR)/SOURCES
92 rpmbuild --define="_topdir $(RPMTOPDIR)" -bs $(tmpspec)
93 $(RM) $(tmpspec)
95 clean:
96 for i in $(if $(WANT_MODULE), kernel) user libkvm qemu libfdt; do \
97 make -C $$i clean; \
98 done
100 distclean: clean
101 rm -f config.mak user/config.mak