#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto

export PREFIX="/usr"
export LIBEXECDIR="/usr/lib/crac-criu"

# -march:x86-64-v3 is not a valid LDFLAG
export DEB_LDFLAGS_MAINT_STRIP=-march=x86-64-v3

%:
	dh ${@}

# gcc-15's const-preserving builtin strrchr turns
# 'char *pos = strrchr(link->name, ...)' (link is const) in criu/tty.c
# into a -Wdiscarded-qualifiers error under -Werror. Upstream's Makefile
# provides WERROR=0 to disable -Werror; use it instead of patching sources.
override_dh_auto_build:
	dh_auto_build -- WERROR=0

override_dh_auto_test:
	# disabled: doesn't work yet, upstream criu tests fail to build
