#!/usr/bin/make -f
# -*- makefile -*-

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

ifneq (,$(filter $(DEB_HOST_ARCH), ppc64el))
export DEB_CFLAGS_MAINT_APPEND := -Wno-error=stringop-overread
endif

# GCC 15 emits new strict warnings (-Wstringop-overread on the SHA1 code,
# -Wattribute-warning from libcurl >= 8.16's curl_easy_setopt type
# diagnostics, and -Wformat-overflow on the sizebuf sprintf in s3.c which
# GCC's value-range analysis cannot bound via the surrounding if/else
# conditions) which -Werror turns into build failures on all architectures.
# The GNUmakefile keeps/enlarges CFLAGS passed in the environment, so export
# these no-error overrides on every architecture (previously only ppc64el).
export CFLAGS := $(CFLAGS) -Wno-error=stringop-overread -Wno-error=attribute-warning -Wno-error=format-overflow

DESTDIR = $(CURDIR)/debian/tmp/usr/

override_dh_auto_build:
ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
	dh_auto_build -- VERBOSE=true
else
	dh_auto_build
endif

override_dh_auto_install:
	dh_auto_install -- DESTDIR=$(DESTDIR)

%:
	dh $@

.PHONY: override_dh_auto_build override_dh_auto_install
