#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+pie
export DEB_CFLAGS_MAINT_APPEND=-Wall
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed -Wl,-z,now

# Disable optimisations if noopt found in $DEB_BUILD_OPTIONS
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	DEB_LDFLAGS_MAINT_APPEND += -Wl,-O0
else
	DEB_CFLAGS_MAINT_APPEND += -Os
	DEB_LDFLAGS_MAINT_APPEND += -Wl,-O1
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --exec-prefix= --libdir=/lib
	make -C po update-po
