#!/usr/bin/make -f

%:
	dh $@ --sourcedirectory=fru_tools

override_dh_auto_build:
	dh_auto_build
# Build device trees
	make -C device-tree

override_dh_auto_install:
	dh_auto_install -- DESTDIR=$$PWD/debian/xlnx-kria-firmware/usr
# Remove empty /usr/lib/fmc-tools folder
	rm -rf $$PWD/debian/xlnx-kria-firmware/usr/lib/
# Install device trees
	make -C device-tree DESTDIR=$$PWD/debian/xlnx-kria-firmware prefix=/usr install

override_dh_auto_clean:
	dh_auto_clean
	make -C device-tree clean

# fru_tools tests tries to use valgrind, prevent that
override_dh_auto_test:
	:
