#!/usr/bin/make -f
# -*- makefile -*-
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

.PHONY: override_dh_auto_test

# Not using DEB_HOST_MULTIARCH since it generates i386 for arch instead
# of i686 which is the path used by gcc
DEB_TARGET_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_TARGET_GNU_TYPE)

export DH_OPTIONS=-v --buildsystem=cmake

override_dh_auto_configure:
	# Workaround for bug: 
	# https://github.com/PrismTech/opensplice/issues/18
	find /usr/lib -name liblto_plugin.so
	mkdir -p /usr/lib/bfd-plugins
	ln -s /usr/lib/gcc/$(DEB_TARGET_GNU_TYPE)/5/liblto_plugin.so /usr/lib/bfd-plugins/
	dh_auto_configure

%:
	dh $@ --max-parallel=1

# No tests yet
override_dh_auto_test:
	true
