#!/usr/bin/make -f

export DEB_CPPFLAGS_MAINT_APPEND = -std=c++17 -flto
export DEB_CFLAGS_MAINT_APPEND = -std=gnu11 -flto
export DEB_LDFLAGS_MAINT_APPEND  = -flto

%:
	dh $@ --builddirectory=build

override_dh_auto_configure:
	dh_auto_configure
	(cd debian/scripts; \
	  for i in *.in; do\
	  o=`basename $$i .in`;\
	  sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' "$$i" > "$$o"; \
	  done )

override_dh_fixperms:
	dh_fixperms
	find debian -type f -name 'soh.sh' -exec chmod 0644 {} +
