kvm: external module: Remove obsolete special_reload_dr7 hack
[qemu-kvm/amd-iommu.git] / kvm / Makefile
blob64e296d5a4f441217d8d1644c2c1c67310fdadfa
2 include config.mak
4 DESTDIR=
6 rpmrelease = devel
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
12 all: libkvm qemu
13 ifneq '$(filter $(ARCH), x86_64 i386 ia64)' ''
14 all: $(if $(WANT_MODULE), kernel) user
15 endif
17 kcmd = $(if $(WANT_MODULE),,@\#)
19 qemu kernel user libkvm:
20 $(MAKE) -C $@
22 qemu: libkvm
23 ifneq '$(filter $(ARCH), i386 x86_64)' ''
24 qemu: extboot
25 endif
26 ifneq '$(filter $(ARCH), powerpc ia64)' ''
27 qemu: libfdt
28 endif
29 user: libkvm
31 user libkvm qemu: header-sync-$(if $(WANT_MODULE),n,y)
33 header-sync-n:
35 header-sync-y:
36 make -C kernel LINUX=$(KERNELDIR) header-sync
37 rm -f kernel/include/asm
38 ln -sf asm-$(sane-arch) kernel/include/asm
40 bios:
41 $(MAKE) -C $@
42 cp bios/BIOS-bochs-latest qemu/pc-bios/bios.bin
44 vgabios:
45 $(MAKE) -C $@
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
49 extboot:
50 $(MAKE) -C $@
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; \
55 libfdt:
56 $(MAKE) -C $@
58 LINUX=linux-2.6
60 sync:
61 make -C kernel sync LINUX=$(shell readlink -f "$(LINUX)")
63 bindir = /usr/bin
64 bin = $(bindir)/kvm
65 initdir = /etc/init.d
66 confdir = /etc/kvm
67 utilsdir = /etc/kvm/utils
69 install-rpm:
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
82 install:
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
90 rpm: srpm
91 rm -rf $(RPMTOPDIR)/BUILD
92 mkdir -p $(RPMTOPDIR)/{BUILD,RPMS/$$(uname -i)}
93 rpmbuild --rebuild \
94 --define="_topdir $(RPMTOPDIR)" \
95 $(RPMTOPDIR)/SRPMS/kvm-0.0-$(rpmrelease).src.rpm
97 srpm:
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)
108 $(RM) $(tmpspec)
110 clean:
111 for i in $(if $(WANT_MODULE), kernel) user libkvm qemu libfdt; do \
112 make -C $$i clean; \
113 done
114 rm -f ./cscope.*
116 distclean: clean
117 rm -f config.mak user/config.mak
119 cscope:
120 rm -f ./cscope.*
121 find . -wholename './kernel' -prune -o -name "*.[ch]" -print > ./cscope.files
122 cscope -b