#!/usr/bin/make -f

export DH_VERBOSE = 1

%:
	exec dh $@ --parallel --builddirectory=build

override_dh_update_autotools_config:
	# Nope, do not touch config.sub or config.guess .

override_dh_auto_configure:
	exec dh_auto_configure -O--parallel -- \
	    --target=ia16-elf --infodir=/usr/ia16-elf/info \
	    --without-headers --with-newlib --enable-languages=c \
	    --disable-libssp --disable-libquadmath

override_dh_auto_build-arch:
	dh_auto_build -a -O--parallel -O--builddirectory=build
	# See redist-ppa.sh .
	mkdir -p build/gcc/include-fixed
	cp gcc/glimits.h build/gcc/include-fixed/limits.h
	echo timestamp >build/gcc/stmp-fixinc

override_dh_auto_test:
	# Do not run the test suite at this stage.

override_dh_strip:
	# Stock GNU Binutils's strip(1) will fail on the new (September
	# 2019) libgcc2, as it does not understand the IA16-specific segment
	# relocations.
	dh_strip -X.a
