#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export PYBUILD_NAME=pygalmesh

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# some arches (mostly 32 bit) don't provide enough memory to build with debug symbols
ARCH_NO_DEBUG_SYMBOLS := armhf i386 mips mipsel hppa hurd-i386 kfreebsd-i386 powerpcspe x32
ifneq ($(findstring $(DEB_BUILD_ARCH),$(ARCH_NO_DEBUG_SYMBOLS)),)
# disable debugging symbols (replace -g with -g0 in build flags) on weak arches
  CFLAGS := $(shell dpkg-buildflags --get CFLAGS | sed 's/-g /-g0 /' )
endif

%:
	dh $@ --with python3 --buildsystem=pybuild

