#!/usr/bin/make -f

include /usr/share/octave/debian/defs.make

%:
	dh $@ --with elpa

# Disable multi-arch path
override_dh_auto_configure:
	dh_auto_configure -- --libdir=/usr/lib

# Also build PDF and HTML docs (unless nodoc is given)
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
override_dh_auto_build:
	dh_auto_build -- all pdf html
else
override_dh_auto_build:
	dh_auto_build
	mkdir -p doc/dynare.html/
	touch doc/dynare.pdf doc/guide.pdf doc/macroprocessor/macroprocessor.pdf doc/bvar-a-la-sims.pdf doc/preprocessor/preprocessor.pdf doc/userguide/UserGuide.pdf doc/dr.pdf doc/gsa/gsa.pdf doc/parallel/parallel.pdf dynare++/doc/dynare++-tutorial.pdf dynare++/doc/dynare++-ramsey.pdf dynare++/sylv/sylvester.pdf dynare++/tl/cc/tl.pdf dynare++/integ/cc/integ.pdf dynare++/kord/kord.pdf
endif

# Don't run the testsuite
override_dh_auto_test:

override_dh_link:
	dh_link --package=dynare /usr/lib/dynare/matlab/dynare.m $(MDIR)/dynare.m

get-orig-source:
	uscan --force-download --rename --destdir .
.PHONY: get-orig-source
