#!/usr/bin/make -f

# export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

CFLAGS   := -Wall $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS  := $(shell dpkg-buildflags --get LDFLAGS)

%:
	dh $@

#
# Override dh_auto_build because there were race conditions with
# parallel builds on multi-core machines:
#
# - automake did not seem to understand dependency tracking
#   of Fortran 95 module (".mod") files; automake supports
#   FORTRAN 77 (which does not produce ".mod" files), but does
#   not claim to support later Fortran versions.  It will take
#   further investigation to track down the root cause.
#
# - TeX would stop after its first pass rather than its second
#   (for incorporating indices, etc. in the Texinfo document).
#
# After those changes, ".NOTPARALLEL" directives were added to
# doc/Makefile.am and src/Makefile.am in the upstream source (to
# benefit other GNU make-based distros), and build-aux/texinfo.tex
# was replaced with the latest recommended upstream version (later
# than the version in the latest upstream automake).  Therefore
# the dh_auto_build override may no longer be necessary, but that
# will take further testing.  The current configuration has been
# built over 50 times with consistently correct results, so for
# stability for the upcoming freeze leaving things as they are.
#
override_dh_auto_build:
	make V=1

#
# Exclude installation of ChangeLog as recommended in Debian Policy
# Section 12.7, which as of version 4.2.0 states that installing
# an upstream ChangeLog file is "permitted but deprecated".
#
override_dh_installchangelogs:
	dh_installchangelogs --exclude=ChangeLog
