#!/usr/bin/make -f

export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

%:
	dh $@ --parallel

override_dh_auto_clean:
	dh_auto_clean
	# clean stray .qm files that are not handled by clean rule in upstream Makefile
	rm -Rf x2goclient_*.qm

override_dh_auto_install:
	mv plugin_build/libx2goplugin.so plugin_build/libx2goplugin.so.unstripped
	strip -s --remove-section=.comment --remove-section=.note \
	         plugin_build/libx2goplugin.so.unstripped -o plugin_build/libx2goplugin.so
	rm -f plugin_build/libx2goplugin.so.unstripped

override_dh_strip:
	dh_strip -p x2goclient --dbg-package=x2goclient-dbg
