8 sane-arch
= $(subst i386
,x86
,$(subst x86_64
,x86
,$(ARCH
)))
10 .PHONY
: kernel user libkvm qemu bios vgabios extboot
clean libfdt
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)' ''
31 user libkvm qemu
: header-sync-
$(if
$(WANT_MODULE
),n
,y
)
36 make
-C kernel LINUX
=$(KERNELDIR
) header-sync
37 rm -f kernel
/include/asm
38 ln
-sf asm-
$(sane-arch
) kernel
/include/asm
42 cp bios
/BIOS-bochs-latest qemu
/pc-bios
/bios.bin
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
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
; \
63 utilsdir
= /etc
/kvm
/utils
66 mkdir
-p
$(DESTDIR
)/$(bindir)
67 mkdir
-p
$(DESTDIR
)/$(confdir
)
68 mkdir
-p
$(DESTDIR
)/$(initdir
)
69 mkdir
-p
$(DESTDIR
)/$(utilsdir
)
70 mkdir
-p
$(DESTDIR
)/etc
/udev
/rules.d
71 make
-C qemu DESTDIR
=$(DESTDIR
)/ install
72 ln
-sf
/usr
/kvm
/bin
/qemu-system-x86_64
$(DESTDIR
)/$(bin
)
73 install -m
755 kvm_stat
$(DESTDIR
)/$(bindir)/kvm_stat
74 cp scripts
/kvm
$(DESTDIR
)/$(initdir
)/kvm
75 cp scripts
/qemu-ifup
$(DESTDIR
)/$(confdir
)/qemu-ifup
76 install -t
$(DESTDIR
)/etc
/udev
/rules.d scripts
/*kvm
*.rules
79 $(kcmd
)make
-C kernel DESTDIR
="$(DESTDIR)" install
80 make
-C libkvm DESTDIR
="$(DESTDIR)" install
81 make
-C qemu DESTDIR
="$(DESTDIR)" install
83 tmpspec
= .tmp.kvm.spec
84 RPMTOPDIR
= $$(pwd
)/rpmtop
87 rm -rf
$(RPMTOPDIR
)/BUILD
88 mkdir
-p
$(RPMTOPDIR
)/{BUILD
,RPMS
/$$(uname
-i
)}
90 --define="_topdir $(RPMTOPDIR)" \
91 $(RPMTOPDIR
)/SRPMS
/kvm-0.0
-$(rpmrelease
).src.rpm
94 mkdir
-p
$(RPMTOPDIR
)/{SOURCES
,SRPMS
}
95 sed
's/^Release:.*/Release: $(rpmrelease)/' kvm.spec
> $(tmpspec
)
96 tar czf
$(RPMTOPDIR
)/SOURCES
/kvm.
tar.gz qemu
97 tar czf
$(RPMTOPDIR
)/SOURCES
/user.
tar.gz user
98 tar czf
$(RPMTOPDIR
)/SOURCES
/libkvm.
tar.gz libkvm
99 tar czf
$(RPMTOPDIR
)/SOURCES
/kernel.
tar.gz kernel
100 tar czf
$(RPMTOPDIR
)/SOURCES
/scripts.
tar.gz scripts
101 tar czf
$(RPMTOPDIR
)/SOURCES
/extboot.
tar.gz extboot
102 cp Makefile configure kvm_stat
$(RPMTOPDIR
)/SOURCES
103 rpmbuild
--define="_topdir $(RPMTOPDIR)" -bs
$(tmpspec
)
107 for i in
$(if
$(WANT_MODULE
), kernel
) user libkvm qemu libfdt
; do \
112 rm -f config.mak user
/config.mak