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 \
89 build
: build-arch build-indep
90 build-arch
: build-stamp
91 build-indep
: build-stamp
94 build-stamp
: ${BUILDDIR}/config.status
97 # Add here commands to compile the package.
100 #docbook-to-man debian/kvm.sgml > kvm.1
109 # Add here commands to clean up before the build process.
121 # Add here commands to install the package into debian/pve-kvm.
122 $(MAKE
) DESTDIR
=$(destdir
) install
124 # Remove things we don't package at all, would be a "kvm-dev" package
125 rm -Rf
$(destdir
)/usr
/include/linux
/
126 rm -Rf
$(destdir
)/usr
/include
127 rm -f
$(destdir
)/usr
/lib
/kvm
/qemu-bridge-helper
128 rm -f
$(destdir
)/usr
/lib
/kvm
/virtfs-proxy-helper
130 # CPU flags are static for QEMU version, allows avoiding more costly checks
131 $(destdir
)/usr
/bin
/qemu-system-x86_64
-cpu help | .
/debian
/parse-cpu-flags.pl
> $(flagfile
)
132 $(destdir
)/usr
/bin
/qemu-system-x86_64
-machine help | .
/debian
/parse-machines.pl
> $(machinefile
)
134 # Build architecture-independent files here.
135 binary-indep
: build
install
136 # We have nothing to do by default.
138 # Build architecture-dependent files here.
139 binary-arch
: build
install
142 # exclude historic Changelog file, which stops at release 0.14
143 dh_installchangelogs
--exclude
=Changelog
149 # dh_installlogrotate
159 dh_strip
--dbg-package
=pve-qemu-kvm-dbg
165 # Debian >= Buster has libglusterfs0 and lots of libgfFOO, upstream has the libs in glusterfs-common
166 # pass -x to dpkg-shlibdeps and specify dependencies in d/control instead
167 dh_shlibdeps
-- -xlibglusterfs0
-xlibgfxdr0
-xlibgfrpc0
-xlibgfdb0
-xlibgfchangelog0
-xlibgfapi0
172 binary
: binary-indep binary-arch
173 .PHONY
: build
clean binary-indep binary-arch binary
install