#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

# generator/test-* requires prettier, which is not packaged in Debian.
export DH_GOLANG_EXCLUDES := docs/ examples/ generator/test- storybook/_example \
	.github CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md SECURITY.md benchmarks \
	lsp/LICENSE lsp/README.md .gitignore storybook/.gitignore 
# Install everything into the build directory since testdata is scattered across the codebase.
export DH_GOLANG_INSTALL_ALL := 1

BUILDFLAGS = -ldflags "-X 'github.com/a-h/templ.version=$(DEB_VERSION)'"

%:
	dh $@ --builddirectory=_build --buildsystem=golang

override_dh_auto_build:
	dh_auto_build -O--buildsystem=golang -- $(BUILDFLAGS)

execute_before_dh_auto_install:
	rm -f $(CURDIR)/_build/bin/testprogram
