#!/usr/bin/make -f
# crmvec: build the libraries (make lib), then make check: a few minutes of
# the checks, on the library being packaged (skipped with nocheck); the
# full list runs from the source tree (docs/checking.md)
# no LTO: it would optimize across crmvec.c and CORE-MATH, code no check has run on
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
include /usr/share/dpkg/architecture.mk
%:
	dh $@
# through dh_auto_*, which pass the cross compiler (CC) when cross-building
# (until 2026-09-29 a cross build compiled for the build machine)
override_dh_auto_build:
	dh_auto_build -- lib
# crmvec-run names both architectures' directories, so that it is the same
# file in each (Multi-Arch: same)
override_dh_auto_install:
	dh_auto_install -- PREFIX=/usr LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	  CRMRUN=/usr/lib/x86_64-linux-gnu/crmvec:/usr/lib/aarch64-linux-gnu/crmvec
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
	$(MAKE) check
endif
endif
override_dh_auto_clean:
	$(MAKE) clean
# private libraries in their own directory: nothing for ldconfig or shlibs
override_dh_makeshlibs:
