#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

include /usr/share/hardening-includes/hardening.make

LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS+=$(HARDENING_LDFLAGS) -Wl,-z,defs -Wl,--as-needed -Wl,-O1
CFLAGS+=$(HARDENING_CFLAGS)

export CFLAGS LDFLAGS

post-patches::
	NOCONFIGURE=1 xdt-autogen

clean::
	rm -f $$(find -name 'Makefile.in*')
	rm -f INSTALL aclocal.m4 config.h.in configure depcomp install-sh
	rm -f intltool-extract.in intltool-merge.in intltool-update.in ltmain.sh
	rm -f missing mkinstalldirs

binary-post-install/xfce4-smartbookmark-plugin::
	-rm -rf debian/`dh_listpackages`/usr/lib/xfce4/panel-plugins/*.a
	-rm -rf debian/`dh_listpackages`/usr/lib/xfce4/panel-plugins/*.la
