#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

export DH_GOLANG_INSTALL_EXTRA := pkg/dwarf/line/_testdata _fixtures
export DH_GOLANG_GO_GENERATE := 1
export MAN_OUTPUT := $(CURDIR)/debian/

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

execute_before_dh_auto_configure:
	echo "package main" > cmd/dlv/generate_man.go
	echo "//go:generate go run $(CURDIR)/debian/generate_man.go" >> cmd/dlv/generate_man.go

override_dh_auto_build:
	DH_GOLANG_BUILDPKG=github.com/go-delve/delve/cmd/dlv \
	dh_auto_build

override_dh_auto_install:
	dh_auto_install -- --no-source
