#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# 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.

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# include /usr/share/quilt/quilt.make



LDFLAGS = -shared -fPIC,-Wl,--as-needed
LIBS += -lrt -pthread

DEB_HOST_ARCH_CPU   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

DEB_BUILD_MAINT_OPTIONS=hardening=-fortify

# Handle DEB_BUILD_OPTIONS=parallel=N
, := ,
ifneq (,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS))))
  NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS))))
  MAKEFLAGS += -j$(NUMJOBS)
endif

CFLAGS += -fPIC -Wall -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2) 
CPPFLAGS =

ifeq ($(DEB_HOST_ARCH_CPU),arm)
CFLAGS += -fno-var-tracking
endif


%:
	dh $@
