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 # sync if kernel/Makefile exists and if using --with-patched-kernel
32 user libkvm qemu
: header-sync-
$(if
$(wildcard kernel
/Makefile
),$(if
$(WANT_MODULE
),n
,y
),n
)
38 LINUX
=$(if
$(KERNELSOURCEDIR
),$(KERNELSOURCEDIR
),$(KERNELDIR
)) \
40 rm -f kernel
/include/asm
41 ln
-sf asm-
$(sane-arch
) kernel
/include/asm
45 cp bios
/BIOS-bochs-latest qemu
/pc-bios
/bios.bin
49 cp vgabios
/VGABIOS-lgpl-latest.bin qemu
/pc-bios
/vgabios.bin
50 cp vgabios
/VGABIOS-lgpl-latest.cirrus.bin qemu
/pc-bios
/vgabios-cirrus.bin
54 if
! [ -f qemu
/pc-bios
/extboot.bin
] \
55 ||
! cmp
-s qemu
/pc-bios
/extboot.bin extboot
/extboot.bin
; then \
56 cp extboot
/extboot.bin qemu
/pc-bios
/extboot.bin
; \
64 make
-C kernel sync LINUX
=$(shell readlink
-f
"$(LINUX)")
70 utilsdir
= /etc
/kvm
/utils
73 mkdir
-p
$(DESTDIR
)/$(bindir)
74 mkdir
-p
$(DESTDIR
)/$(confdir
)
75 mkdir
-p
$(DESTDIR
)/$(initdir
)
76 mkdir
-p
$(DESTDIR
)/$(utilsdir
)
77 mkdir
-p
$(DESTDIR
)/etc
/udev
/rules.d
78 make
-C qemu DESTDIR
=$(DESTDIR
)/ install
79 ln
-sf
/usr
/kvm
/bin
/qemu-system-x86_64
$(DESTDIR
)/$(bin
)
80 install -m
755 kvm_stat
$(DESTDIR
)/$(bindir)/kvm_stat
81 cp scripts
/kvm
$(DESTDIR
)/$(initdir
)/kvm
82 cp scripts
/qemu-ifup
$(DESTDIR
)/$(confdir
)/qemu-ifup
83 install -t
$(DESTDIR
)/etc
/udev
/rules.d scripts
/*kvm
*.rules
86 $(kcmd
)make
-C kernel DESTDIR
="$(DESTDIR)" install
87 make
-C libkvm DESTDIR
="$(DESTDIR)" install
88 make
-C qemu DESTDIR
="$(DESTDIR)" install
90 tmpspec
= .tmp.kvm.spec
91 RPMTOPDIR
= $$(pwd
)/rpmtop
94 rm -rf
$(RPMTOPDIR
)/BUILD
95 mkdir
-p
$(RPMTOPDIR
)/{BUILD
,RPMS
/$$(uname
-i
)}
97 --define="_topdir $(RPMTOPDIR)" \
98 $(RPMTOPDIR
)/SRPMS
/kvm-0.0
-$(rpmrelease
).src.rpm
101 mkdir
-p
$(RPMTOPDIR
)/{SOURCES
,SRPMS
}
102 sed
's/^Release:.*/Release: $(rpmrelease)/' kvm.spec
> $(tmpspec
)
103 tar czf
$(RPMTOPDIR
)/SOURCES
/kvm.
tar.gz qemu
104 tar czf
$(RPMTOPDIR
)/SOURCES
/user.
tar.gz user
105 tar czf
$(RPMTOPDIR
)/SOURCES
/libkvm.
tar.gz libkvm
106 tar czf
$(RPMTOPDIR
)/SOURCES
/kernel.
tar.gz kernel
107 tar czf
$(RPMTOPDIR
)/SOURCES
/scripts.
tar.gz scripts
108 tar czf
$(RPMTOPDIR
)/SOURCES
/extboot.
tar.gz extboot
109 cp Makefile configure kvm_stat
$(RPMTOPDIR
)/SOURCES
110 rpmbuild
--define="_topdir $(RPMTOPDIR)" -bs
$(tmpspec
)
114 for i in
$(if
$(WANT_MODULE
), kernel
) user libkvm qemu libfdt
; do \
120 rm -f config.mak user
/config.mak
124 find .
-wholename
'./kernel' -prune
-o
-name
"*.[ch]" -print > .
/cscope.files