#!/usr/bin/make -f
export VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ -Scmake

override_dh_auto_install:
	dh_auto_install
	sed -i 's@#!/usr/bin/env perl@#!/usr/bin/perl@' ./debian/tmp/usr/bin/hipify-perl
	help2man -S'hipify-clang' -n'CUDA to HIP source translator' -m'hipify-clang' -N \
		-o debian/hipify-clang.1 ./debian/tmp/usr/bin/hipify-clang
	sed -i -e 's/Debian/hipify-clang/g' -e 's/DEBIAN/hipify/g' debian/hipify-clang.1
	help2man --no-discard-stderr -S'hipify-perl' -n'CUDA to HIP source translator' -m'hipify-perl' -N \
		-o debian/hipify-perl.1 ./debian/tmp/usr/bin/hipify-perl
	sed -i -e 's/Debian/hipify-perl/g' -e 's/DEBIAN/hipify/g' debian/hipify-perl.1

# dwz does not support DWARF-5
override_dh_dwz:
	:
