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
20 # FIXME: pass to configure as --extra-cflags=CFLAGS ?! also LDFLAGS?
25 # DEB_BUILD_OPTIONS=parallel=N
26 MAKEFLAGS
+= $(subst parallel
=,-j
,$(filter parallel
=%,${DEB_BUILD_OPTIONS}))
28 ${BUILDDIR}/config.status
: configure
30 # Add here commands to configure the package.
32 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
33 cp
-f
/usr
/share
/misc
/config.sub config.sub
35 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
36 cp
-f
/usr
/share
/misc
/config.guess config.guess
39 # guest-agent is only required for guest systems
42 --docdir
=/usr
/share
/doc
/pve-qemu-kvm \
43 --localstatedir
=/var \
46 --target-list
=$(HOST_CPU
)-softmmu
,aarch64-softmmu \
48 --with-pkgversion
="${DEB_SOURCE}_${DEB_VERSION_UPSTREAM_REVISION}" \
49 --audio-drv-list
="alsa" \
50 --datadir=/usr
/share \
51 --libexecdir
=/usr
/lib
/kvm \
54 --disable-guest-agent \
55 --disable-guest-agent-msi \
69 --enable-linux-io-uring \
77 --enable-virglrenderer \
81 build
: build-arch build-indep
82 build-arch
: build-stamp
83 build-indep
: build-stamp
86 build-stamp
: ${BUILDDIR}/config.status
89 # Add here commands to compile the package.
92 #docbook-to-man debian/kvm.sgml > kvm.1
101 # Add here commands to clean up before the build process.
113 # Add here commands to install the package into debian/pve-kvm.
114 $(MAKE
) DESTDIR
=$(destdir
) install
116 # Remove things we don't package at all, would be a "kvm-dev" package
117 rm -Rf
$(destdir
)/usr
/include/linux
/
118 rm -Rf
$(destdir
)/usr
/include
119 rm -f
$(destdir
)/usr
/lib
/kvm
/qemu-bridge-helper
120 rm -f
$(destdir
)/usr
/lib
/kvm
/virtfs-proxy-helper
122 # CPU flags are static for QEMU version, allows avoiding more costly checks
123 $(destdir
)/usr
/bin
/qemu-system-x86_64
-cpu help | .
/debian
/parse-cpu-flags.pl
> $(flagfile
)
124 $(destdir
)/usr
/bin
/qemu-system-x86_64
-machine help | .
/debian
/parse-machines.pl
> $(machinefile
)
126 # Build architecture-independent files here.
127 binary-indep
: build
install
128 # We have nothing to do by default.
130 # Build architecture-dependent files here.
131 binary-arch
: build
install
134 # exclude historic Changelog file, which stops at release 0.14
135 dh_installchangelogs
--exclude
=Changelog
141 # dh_installlogrotate
151 dh_strip
--dbgsym-migration
='pve-qemu-kvm-dbg (<<8.0.0-1~)'
157 # Debian >= Buster has libglusterfs0 and lots of libgfFOO, upstream has the libs in glusterfs-common
158 # pass -x to dpkg-shlibdeps and specify dependencies in d/control instead
159 dh_shlibdeps
-- -xlibglusterfs0
-xlibgfxdr0
-xlibgfrpc0
-xlibgfdb0
-xlibgfchangelog0
-xlibgfapi0
164 binary
: binary-indep binary-arch
165 .PHONY
: build
clean binary-indep binary-arch binary
install