#!/usr/bin/make -f
DEB_HOST_MULTIARCH?=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LDFLAGS+=-Wl,--as-needed

# Parallel build.
ifeq ($(DEB_HOST_ARCH_OS),linux)
    export DEB_BUILD_OPTIONS+=parallel=$(shell getconf _NPROCESSORS_ONLN)
endif

%:
	dh $@ --parallel --with autoreconf
override_dh_auto_configure:
	dh_auto_configure -Sautoconf -- \
	    --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
	    --datarootdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
override_dh_strip:
	dh_strip --dbg-package=libpinyin-dbg
override_dh_install:
	find debian/ -name *.la -delete
	dh_install --fail-missing
