#!/usr/bin/make -f

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

configure_flags += \
			-DCMAKE_INSTALL_PREFIX="/usr" \
			-DCMAKE_SKIP_RPATH=true \
			-DLIB_SUFFIX= \
			-DUSB_PKGCONF_INCLUDE_DIRS="/usr/include/libusb-1.0"

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- 	$(configure_flags)

override_dh_install:
	dh_install --fail-missing

override_dh_strip:
	dh_strip --dbg-package=libusbmuxd1-dbg
