4 # Uncomment this to turn on verbose mode.
7 include /usr
/share
/dpkg
/default.mk
9 HOST_CPU ?
= $(DEB_HOST_GNU_CPU
)
12 destdir
:= $(CURDIR
)/debian
/$(PACKAGE
)
14 flagfile
:= $(destdir
)/usr
/share
/kvm
/recognized-CPUID-flags-x86_64
15 machinefile
:= $(destdir
)/usr
/share
/kvm
/machine-versions-x86_64.json
17 # default QEMU out-of-tree build directory is ./build
22 # FIXME: There is a second -02 added because of meson.build in the subproject
23 # and that is appended after -O0 from here (last -O wins), so supporting noopt
24 # doesn't work like this.
25 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
33 # DEB_BUILD_OPTIONS=parallel=N
34 MAKEFLAGS
+= $(subst parallel
=,-j
,$(filter parallel
=%,${DEB_BUILD_OPTIONS}))
36 ${BUILDDIR}/config.status
: configure
38 # Add here commands to configure the package.
40 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
41 cp
-f
/usr
/share
/misc
/config.sub config.sub
43 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
44 cp
-f
/usr
/share
/misc
/config.guess config.guess
47 # guest-agent is only required for guest systems
49 --with-git-submodules
=ignore \
50 --docdir
=/usr
/share
/doc
/pve-qemu-kvm \
51 --localstatedir
=/var \
54 --target-list
=$(HOST_CPU
)-softmmu
,aarch64-softmmu \
56 --with-pkgversion
="${DEB_SOURCE}_${DEB_VERSION_UPSTREAM_REVISION}" \
57 --audio-drv-list
="alsa" \
58 --datadir=/usr
/share \
59 --libexecdir
=/usr
/lib
/kvm \
62 --disable-guest-agent \
63 --disable-guest-agent-msi \
77 --enable-linux-io-uring \
85 --enable-virglrenderer \
90 build
: build-arch build-indep
91 build-arch
: build-stamp
92 build-indep
: build-stamp
95 build-stamp
: ${BUILDDIR}/config.status
98 # Add here commands to compile the package.
101 #docbook-to-man debian/kvm.sgml > kvm.1
110 # Add here commands to clean up before the build process.
122 # Add here commands to install the package into debian/pve-kvm.
123 $(MAKE
) DESTDIR
=$(destdir
) install
125 # we do not need openbios files (sparc/ppc)
126 rm -rf
$(destdir
)/usr
/share
/kvm
/openbios-
*
128 rm $(destdir
)/usr
/share
/kvm
/*.dtb
129 rm $(destdir
)/usr
/share
/kvm
/s390-ccw.img
130 rm $(destdir
)/usr
/share
/kvm
/s390-netboot.img
131 rm $(destdir
)/usr
/share
/kvm
/qemu_vga.ndrv
132 rm $(destdir
)/usr
/share
/kvm
/slof.bin
133 rm $(destdir
)/usr
/share
/kvm
/u-boot.e500
135 rm $(destdir
)/usr
/share
/kvm
/palcode-clipper
136 # remove RISC-V files
137 rm $(destdir
)/usr
/share
/kvm
/opensbi-riscv32-generic-fw_dynamic.bin
138 rm $(destdir
)/usr
/share
/kvm
/opensbi-riscv64-generic-fw_dynamic.bin
140 # Remove things we don't package at all, would be a "kvm-dev" package
141 rm -Rf
$(destdir
)/usr
/include/linux
/
142 rm -Rf
$(destdir
)/usr
/include
143 rm -f
$(destdir
)/usr
/lib
/kvm
/qemu-bridge-helper
144 rm -f
$(destdir
)/usr
/lib
/kvm
/virtfs-proxy-helper
146 # CPU flags are static for QEMU version, allows avoiding more costly checks
147 $(destdir
)/usr
/bin
/qemu-system-x86_64
-cpu help | .
/debian
/parse-cpu-flags.pl
> $(flagfile
)
148 $(destdir
)/usr
/bin
/qemu-system-x86_64
-machine help | .
/debian
/parse-machines.pl
> $(machinefile
)
150 # Build architecture-independent files here.
151 binary-indep
: build
install
152 # We have nothing to do by default.
154 # Build architecture-dependent files here.
155 binary-arch
: build
install
158 # exclude historic Changelog file, which stops at release 0.14
159 dh_installchangelogs
--exclude
=Changelog
165 # dh_installlogrotate
175 dh_strip
--dbg-package
=pve-qemu-kvm-dbg
181 # Debian >= Buster has libglusterfs0 and lots of libgfFOO, upstream has the libs in glusterfs-common
182 # pass -x to dpkg-shlibdeps and specify dependencies in d/control instead
183 dh_shlibdeps
-- -xlibglusterfs0
-xlibgfxdr0
-xlibgfrpc0
-xlibgfdb0
-xlibgfchangelog0
-xlibgfapi0
188 binary
: binary-indep binary-arch
189 .PHONY
: build
clean binary-indep binary-arch binary
install