#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
SONAME=5

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
LIBOMP_ARCH = mips
endif

ifneq (,$(filter $(DEB_HOST_ARCH), mips64 mips64el))
LIBOMP_ARCH = mips64
endif

%:
	dh $@

override_dh_auto_build:
	cd obj-* && make compiler=gcc
	cd runtime && doxygen doc/doxygen/config
	cd runtime/doc/doxygen/generated/html/ && rm jquery.js && ln -s /usr/share/javascript/jquery/jquery.js

override_dh_install:
	cd debian/tmp/usr/lib && \
		ln -s libomp.so.$(SONAME) libomp.so
	dh_install

override_dh_clean:
	rm -rf obj-*
	dh_clean

override_dh_strip:
	dh_strip -plibomp5 --dbg-package=libomp5-dbg
