#!/usr/bin/make -f
#DH_VERBOSE=1

DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS = -O2 -Wall
LDFLAGS = -Wl,--as-needed

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    CFLAGS += -O0
else
    CFLAGS += -O2
endif

%:
	dh --with-autoreconf $@

override_dh_install:
	#Remove .la and .a files.
	find debian/ -name *.a |xargs rm
	find debian/ -name *.la |xargs rm
	dh_install --fail-missing

override_dh_makeshlibs:
	#Pass, the .so is not a shared library.
