#! /usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
# LFS support
export DEB_CPPFLAGS_MAINT_APPEND=$(shell getconf LFS_CFLAGS)

%:
	dh $@ --parallel --sourcedirectory=source --buildsystem=cmake

override_dh_clean:
	dh_clean
	rm -rf doc/reST/build

override_dh_auto_configure:
	dh_auto_configure -- \
		-DLIB_INSTALL_DIR=lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

override_dh_auto_build-indep:
	$(MAKE) -C doc/reST html

override_dh_installdocs-indep:
	dh_installdocs
	dh_sphinxdoc

override_dh_strip:
	dh_strip -plibx265-35 --dbg-package=libx265-35-dbg
	dh_strip --remaining-packages
