#!/usr/bin/make -f
# -*- makefile -*-

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow optimize=+lto
export HAVE_ZITA_CONVOLVER = true
export SKIP_STRIPPING = true

ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
	export CROSS_COMPILING = true
endif
noopt = $(if $(filter amd64,$(DEB_HOST_ARCH)),NOOPT=false,NOOPT=true)

%:
	dh $@

execute_before_dh_auto_build:
	@echo "blhc: ignore-line-regexp: ^Compiling .*"

override_dh_auto_build:
	dh_auto_build -- \
		CFLAGS="$(CPPFLAGS) $(CFLAGS)" \
		CXXFLAGS="$(CPPFLAGS) $(CXXFLAGS)" \
		PREFIX=/usr \
		VERBOSE=$(if $(filter terse,$(DEB_BUILD_OPTIONS)),false,true) \
		$(noopt)

execute_before_dh_auto_configure:
	cp -fr /usr/share/dpf/ .

override_dh_auto_install:
	$(MAKE) install \
		DESTDIR=$(CURDIR)/debian/zam-plugins \
		PREFIX=/usr
	chmod 644 $(CURDIR)/debian/zam-plugins/usr/lib/lv2/*/*.ttl

override_dh_auto_clean:
