#!/usr/bin/make -f
# -*- makefile -*-

pkg := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')

CXXFLAGS := -Wall $(shell dpkg-buildflags --get CXXFLAGS)
CXXFLAGS += -DWITH_R_PLUGINS
# This would be added by Upstream makefile, but we override CXXFLAGS…
CXXFLAGS += -DUNIX

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -f plink

override_dh_auto_build:
	$(MAKE) CXXFLAGS='$(CXXFLAGS)' FORCE_DYNAMIC=1

override_dh_installexamples:
	dh_installexamples
	chmod 644 debian/$(pkg)/usr/share/doc/$(pkg)/examples/*

get-orig-source:
	. debian/get-orig-source
