#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

override_dh_auto_build:
ifeq (,$(filter nobootstrap,$(DEB_BUILD_OPTIONS)))
	-ln -s /usr/bin/picolisp $(CURDIR)/bin/picolisp
	-rm src/base.ll src/ext.ll src/ht.ll
	make -C src ../lib/sysdefs
	make -C src base.ll
	make -C src ext.ll
	make -C src ht.ll
endif
	make -C src
	mkdir -p build/bash_completion.d
	cp lib/bash_completion build/bash_completion.d/pil

override_dh_auto_test:
	HOME=$(CURDIR)/build $(CURDIR)/pil test/lib.l -bye + < /dev/null

override_dh_auto_install:
	chmod a-x lib/replica.l
	dh_install -X.bc src   usr/lib/picolisp

override_dh_installdocs:
	dh_installdocs

override_dh_auto_clean:
	-rm -rf build
	make -C src clean

override_dh_compress:
	dh_compress -X.l

override_dh_strip:
	dh_strip --no-automatic-dbgsym

override_dh_dwz: ;

%:
	dh $@
