#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_CONFIGURE_SCRIPT := $(CURDIR)/src/configure
# Some architectures don't like the 3m garbage collector, so use Boehm (aka
# cgc)
ifneq (,$(filter alpha powerpc ppc64 mips mipsel,$(DEB_HOST_ARCH)))
    DEB_CONFIGURE_EXTRA_FLAGS := --enable-cgcdefault
endif
# Upstream does funky things with assembly, so we'll have to trust their 
# compilation settings and override cdbs/dpkg-buildpackage defaults for
# configure and make
DEB_CONFIGURE_SCRIPT_ENV = CFLAGS="-g" CXXFLAGS=""
DEB_MAKE_ENVVARS = CFLAGS="-g" CXXFLAGS=""

DEB_BUILDDIR := $(DEB_SRCDIR)/build

binary-post-install/plt-scheme-doc::
	# release-notes get installed into plt-scheme
	rm -rf debian/plt-scheme-doc/usr/share/plt/doc/release-notes

cleanbuilddir/plt-scheme::
	rm -rf build
	rm -rf include # This got created at build-time
