#!/usr/bin/make -f

LDFLAGS+=-Wl,--as-needed
export LDFLAGS

override_dh_auto_build:
	dh_auto_build -- MCS=$(shell which mono-csc)

override_dh_auto_install:
	dh_auto_install -- MCS=$(shell which mono-csc)

binary: binary-arch binary-indep
%-indep:
	dh $@ --with=cli

%:
	dh $@

# dh_clideps expects to see dh_makeshlibs called before it, but dh_makeshlibs
# is never called when building only arch-indep packages. So we force the issue
# by making a phony shlibs.local file that dh_clideps will accept, if no others
# exist. See #806629 for the specific case of libkarma and #830416 for the bug
# in dh_clideps.
override_dh_clideps:
	if ! grep -q . debian/*/DEBIAN/shlibs; then echo libkarma 0 libkarma0 > debian/shlibs.local; fi
	dh_clideps
	rm -f debian/shlibs.local
