#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

# Ubuntu uses lto flags. This does, however, break the garbage collector in some way
# (Storm crashes on startup). Disable them for now. Note: -ffat-lto-objects need to
# appear twice for the flag to disappear completely.
export DEB_CFLAGS_MAINT_STRIP = -flto=auto -ffat-lto-objects -ffat-lto-objects
export DEB_CXXFLAGS_MAINT_STRIP = -flto=auto -ffat-lto-objects -ffat-lto-objects

# Remove some extra files that gbp buildpackage sometimes fails to clean up on a broken build.
# Seems we need to remove the .pc dir to make quilt work well.
clean:
	dh clean
	rm -f Compiler/COMPILER.version
	rm -f .mymake
	rm -rf .pc
	[ ! -d mps/test/test/script/ntx86bin/ ] || rm -rf mps/test/test/script/ntx86bin/

# We don't need the autotools config etc.
# These rules will find some autotools configuration files and configure them.
# This is not at all needed, and only makes it much more inconvenient to restore
# the repository into a state where we can build from again (e.g. changes inside
# submodules).
override_dh_update_autotools_config:

override_dh_autoreconf:

override_dh_auto_configure:

# Default rule.
%:
	dh $@

