#!/usr/bin/make -f

export DH_VERBOSE=1

# Give us all the O's
export DEB_CFLAGS_MAINT_STRIP=-O2
export DEB_CPPFLAGS_MAINT_STRIP=-O2
export DEB_CXXFLAGS_MAINT_STRIP=-O2

# Build with clang since it produces faster binaries
export CC=clang-13
export CXX=clang++-13

# Create a giant statically linked blob that contains all of our dependencies.
override_dh_auto_configure:
	dh_auto_configure -- --default-library=static --wrap-mode=forcefallback --buildtype=release --debug

override_dh_strip:
	dh_strip --no-automatic-dbgsym

override_dh_auto_install:
	DESTDIR=$(PWD)/debian/iptsd meson install -C $(shell dirname `find ./obj-* -maxdepth 1 -name 'build.ninja' -print -quit`) --skip-subprojects

override_dh_dwz:
	true

%:
	dh $@
