#!/usr/bin/make -f

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

include /usr/share/dpkg/architecture.mk

export CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -Wall -Wunused -Wno-error=format-security -fcommon

CONFIGURE_FLAGS = --disable-mpg123-symlink
ifeq ($(DEB_HOST_ARCH_OS),linux)
CONFIGURE_FLAGS += --enable-alsa=yes
else
CONFIGURE_FLAGS += --enable-alsa=no
endif

LDFLAGS += -Wl,-z,defs -Wl,--as-needed

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(CONFIGURE_FLAGS)

override_dh_auto_install:
	# mandir here has DESTDIR prepended to it
	dh_auto_install -- DESTDIR=$(CURDIR)/debian/mpg321 mandir=/usr/share/man
