#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/buildflags.mk

# Enable verbose make output during package builds
export V = 1
# Enable debhelper verbose output
export DH_VERBOSE = 1

# Force using ld-based resource embedding instead of xxd-generated C arrays
export USE_LDD = 1
# ensure RELRO is applied to linked binaries (fix lintian hardening-no-relro)
LDFLAGS += -Wl,-z,relro
export LDFLAGS

%:
	dh $@

execute_before_dh_auto_build:
	rm -rf rubberband

override_dh_auto_build:
	$(MAKE)
	$(MAKE) vst2
	$(MAKE) clap

override_dh_auto_install:
# Run upstream install directly into debian/tmp with INSTALL=install
# to avoid install-time stripping (prevent --strip-program=true).
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp INSTALL="install" V=1
