#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with sphinxdoc

override_dh_auto_configure:
	dh_auto_configure -- --enable-static=no

override_dh_missing-indep:
	dh_missing --list-missing

override_dh_install:
	find debian/tmp/ -name '*.la' -exec rm '{}' ';'
	dh_install -a

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	python3 -m sphinx -b html docs/source \
		$(CURDIR)/debian/libcglm-doc/usr/share/doc/libcglm-doc/html
	rm -f $(CURDIR)/debian/libcglm-doc/usr/share/doc/libcglm-doc/html/.nojekyll
	dh_sphinxdoc
endif
