#! /usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk # DEB_VERSION

#export DEB_BUILD_MAINT_OPTIONS := hardening=+bindnow

%:
	dh $@

override_dh_auto_install:
	dh_auto_install $(DH_BUILD_OPTS) --destdir=debian/tmp
	cp -v repl/repl.js debian/tmp/usr/share/guile-hoot/*/repl/

override_dh_shlibdeps:
	dh_shlibdeps --exclude=.go

execute_after_dh_clean:
	rm -fv doc/hoot.info

B = $(CURDIR)/debian/tmp/usr/bin
M = $(CURDIR)/debian/tmp/usr/share/man/man1

ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
execute_before_dh_installman-arch:
	mkdir -pv $(M)
	env GUILE_LOAD_PATH=$(CURDIR)/debian/guile-hoot/usr/share/guile/site/3.0 \
	help2man --version-string="$(DEB_VERSION)" \
		--name="Hoot WebAssembly toolkit" \
		--output $(M)/hoot.1 \
		$(B)/hoot
endif
