#!/usr/bin/make -f

include /usr/share/dpkg/buildtools.mk

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# Uncomment this to force a specific compiler, like 'gcc-9' or 'gcc-10'.
#export CC=gcc-10

# Make sure lintian does not complain about missing hardenings.
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# Make sure the decades-old source code gets compiled by allowing implicit
# function declarations and by setting an early language standard.
export DEB_CFLAGS_MAINT_STRIP=-Werror=implicit-function-declaration
export DEB_CFLAGS_MAINT_APPEND=-std=gnu90

%:
	dh $@

# Remove files generated by execute_after_dh_auto_build.
execute_after_dh_auto_clean:
	$(RM) debian/faq.txt debian/start.txt

# Generate text files from html sources.
execute_after_dh_auto_build:
	LANGUAGE=en && lynx -dump debian/faq.html   | sed 's,file://.*/,,' > debian/faq.txt
	LANGUAGE=en && lynx -dump debian/start.html | sed 's,file://.*/,,' > debian/start.txt
