#!/usr/bin/make -f

export CC = gcc-10
export LDSHARED = gcc-10 -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro

export PYBUILD_DESTDIR_python3=debian/python3-gccjit/

%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
ifneq (,$(filter python-gccjit-doc, $(shell dh_listpackages)))
	$(MAKE) -C doc html
endif

override_dh_auto_test:
	-dh_auto_test

override_dh_auto_clean:
	dh_auto_clean
	rm -f *.exe gccjit/*.so gccjit/gccjit.c
	rm -rf doc/_build
