#!/usr/bin/make -f

BUILD_DIR := obj-$(DEB_BUILD_GNU_TYPE)
export DH_GOLANG_EXCLUDES := internal/report/testdata/sample.bin internal/binutils/testdata/
export DH_GOLANG_EXCLUDES_ALL := 1

%:
	dh $@ --buildsystem=golang --with=golang

override_dh_auto_build:
	cd $(BUILD_DIR)/src/github.com/google/pprof/internal/report/testdata && \
		GOCACHE=$(CURDIR)/$(BUILD_DIR)/go-build \
		go build -o sample.bin ./sample && ./sample.bin -cpuprofile sample.cpu
	dh_auto_build
	rm $(BUILD_DIR)/bin/pprof
