#!/usr/bin/make -f

# -as--needed is enabled by default in gcc 9
# Needed symbol are lost since gcc 9
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--no-as-needed

# See upstream changelog 2023.06.16
export DEB_CXXFLAGS_MAINT_APPEND=-DNO_STD_LIB
# or
#export DEB_CXXFLAGS_MAINT_APPEND=-std=c++20

include /usr/share/dpkg/architecture.mk

ifeq ($(origin CC),default)
	CC := $(DEB_HOST_GNU_TYPE)-gcc
endif
export CC

ifeq ($(origin CXX),default)
	CXX := $(DEB_HOST_GNU_TYPE)-g++
endif
export CXX

%:
	dh $@

override_dh_auto_configure:
	./genMakefiles linux-with-shared-libraries

#	exit 1

override_dh_auto_install:
	dh_auto_install -- \
	PREFIX=/usr \
	LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)

override_dh_installchangelogs:
#ifneq (,$(findstring marillat,$(DEB_BUILD_OPTIONS)))
#	wget -qN https://download.live555.com/changelog.txt -O debian/upstream-changelog.txt
#endif

	dh_installchangelogs debian/upstream-changelog.txt

override_dh_clean:
	dh_clean testProgs/whiteroom.mp3
