#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DOPACKAGES = $(shell dh_listpackages)

%:
	dh $@

ifeq (,$(filter oaklisp-doc,$(DOPACKAGES)))
override_dh_auto_configure:
	dh_auto_configure -- --disable-docs
endif

# Build from source alone with Guile (the tarball has no prebuilt
# material, and make never looks for an installed Oaklisp), then
# bootstrap to self-hosting: rebuild the world with itself twice and
# check that it reaches a fixpoint.
override_dh_auto_build:
	dh_auto_build -- bootstrap

override_dh_auto_install:
	dh_auto_install
	-rm --verbose debian/tmp/usr/share/doc/oaklisp/ChangeLog
	-rm --verbose debian/tmp/usr/share/doc/oaklisp/COPYING

override_dh_compress:
	dh_compress --exclude=.pdf
