#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = optimize=-lto

archs_using_clang = mips64el mipsel
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(archs_using_clang)))
export CC=clang
export CXX=clang++
export DEB_CFLAGS_MAINT_APPEND := -gdwarf-4
export DEB_CXXFLAGS_MAINT_APPEND := -gdwarf-4
export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed
endif

%:
	dh $@ --with kf5

override_dh_auto_configure:
	dh_auto_configure -Skf5 -- -DBUILD_TESTING=OFF

execute_after_dh_auto_install:
	# remove development stuff
	find debian/tmp -name '*.a' -delete

.PHONY: override_dh_auto_test
