1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#!/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 -DUSE_PRECOMPILED=0
# CFLAGS are intentionally missing because 32 bit arm eabi5 firmware files are
# not given the hardening flags (which would not be supported)
execute_before_dh_auto_build:
@echo 'blhc: ignore-line-regexp: .* -c /.*/xip_ram_perms/set_perms.c'
@echo 'blhc: ignore-line-regexp: .* -c /.*/otp_header_parser/otp_header_parse.cpp'
@echo 'blhc: ignore-line-regexp: .* -c /usr/src/pico-sdk/.*'
override_dh_dwz:
dh_dwz --exclude=/usr/share/picotool/xip_ram_perms.elf
override_dh_strip:
dh_strip --exclude=/usr/share/picotool/xip_ram_perms.elf
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 ./xip_ram_perms/xip_ram_perms.elf
|