#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all # for SOURCE_DATE_EPOCH include /usr/share/dpkg/pkg-info.mk DATE_MONTH_YEAR=$(shell env LC_ALL=C.UTF-8 date --utc --date=@${SOURCE_DATE_EPOCH} +"%B %Y") # for DEB_HOST_GNU_TYPE include /usr/share/dpkg/architecture.mk %: dh $@ override_dh_auto_configure: dh_auto_configure -- -DPICO_SDK_PATH=/usr/src/pico-sdk execute_before_dh_installman: ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) # native build # verify that the contents of debian/picotool.1.in is up-to-date help2man -n "interact with RP2040 devices or binaries" --no-info --help-option=help --output=picotool.1 ./obj-$(DEB_HOST_GNU_TYPE)/picotool { \ awk 'NR == 1 && /DO NOT MODIFY THIS FILE! It was generated by help2man/ { print }' picotool.1; \ sed 's/@@DATE@@/$(DATE_MONTH_YEAR)/' debian/picotool.1.in; \ } | diff -u - picotool.1 endif # if this was a cross-build, we can just use the cached debian/picotool.1.in # if this was a native build, we verified its contents above sed 's/@@DATE@@/$(DATE_MONTH_YEAR)/' debian/picotool.1.in > picotool.1; execute_after_dh_auto_clean: rm -f picotool.1