#!/usr/bin/make -f
%:
	dh $@

override_dh_strip:
	# dh_strip is skipped because objcopy is failing on the flm binary

override_dh_dwz:
	# dh_dwz is skipped because it causes issues with the binary structure

override_dh_auto_configure:
	cmake -S src -B build --preset linux-default

override_dh_auto_build:
	cmake --build build

override_dh_auto_install:
	DESTDIR=$(CURDIR)/debian/fastflowlm cmake --install build --prefix=/opt/fastflowlm
	rmdir --ignore-fail-on-non-empty debian/fastflowlm/opt/fastflowlm/bin
	install -d debian/fastflowlm/opt/fastflowlm debian/fastflowlm/usr/bin
	ln -sf /opt/fastflowlm/bin/flm debian/fastflowlm/usr/bin/flm

	# Remove include directories
	rm -rf debian/fastflowlm/opt/fastflowlm/include
