#!/usr/bin/make -f

# Don't build an example binary
export DH_GOLANG_EXCLUDES := github.com/osrg/gobgp/tools/config
export DH_GOLANG_INSTALL_EXTRA = docs/sources

%:
	dh $@ --buildsystem=golang --with=golang,bash-completion

PB_GO_FILES = $(patsubst %.proto, %.pb.go, $(wildcard api/*.proto))

execute_before_dh_auto_configure:
	protoc -Iapi/ --go_out=api --go_opt=paths=source_relative \
		--go-grpc_out=api --go-grpc_opt=paths=source_relative $(PB_GO_FILES:.pb.go=.proto)
