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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#!/usr/bin/make -f
# arm-none-eabi-gcc does not support branch protection instructions
# arm-none-eabi-gcc does not support -fstack-check=specific
export DEB_BUILD_MAINT_OPTIONS = hardening=-branch,-stackclash
CFLAGS += -DPICO_PROGRAM_BUILD_DATE="\"$(shell LC_ALL=C date -u --date=@"$(SOURCE_DATE_EPOCH)" +'%b %e %Y')\""
DEB_HOST_GNU_TYPE ?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
# we do not ship the resulting binaries but we want to make sure that the sdk
# can be built on this architecture
CMAKEFLAGS += -DPICO_SDK_TESTS_ENABLED=ON
# other than the source, we ship the docs
CMAKEFLAGS += -DPICO_BUILD_DOCS=ON
# setting PICO_EXAMPLES_PATH=/dev/null to avoid requiring
# a git clone of https://github.com/raspberrypi/pico-examples
CMAKEFLAGS += -DPICO_EXAMPLES_PATH=/dev/null
# to avoid a circular build dependency loop with picotool, it gets disabled
# it will skip anything that requires picotool, i.e UF2s for the test programs
CMAKEFLAGS += -DPICO_NO_PICOTOOL=ON
%:
dh $@
execute_before_dh_auto_configure-indep:
mkdir -p ./lib
ln -s /usr/src/tinyusb ./lib/tinyusb
test -e ./lib/tinyusb/src/portable/raspberrypi/rp2040
override_dh_auto_configure-indep:
dh_auto_configure -- $(CMAKEFLAGS)
override_dh_auto_configure-arch:
dh_auto_configure --sourcedirectory=tools/pioasm --builddirectory=pioasm-obj-$(DEB_HOST_GNU_TYPE)
override_dh_installdocs-indep:
cp -a debian/roboto-debian.css obj-$(DEB_HOST_GNU_TYPE)/docs/doxygen/html/
dh_installdocs obj-$(DEB_HOST_GNU_TYPE)/docs/doxygen/html/
execute_after_dh_auto_build-indep:
dh_auto_build -- docs
execute_after_dh_auto_build-arch:
dh_auto_build --sourcedirectory=tools/pioasm --builddirectory=pioasm-obj-$(DEB_HOST_GNU_TYPE)
# CMakeLists.txt unconditionally runs add_subdirectory(docs) but we don't want
# to ship the documentation source with pico-sdk-source so we create a dummy
override_dh_auto_install-indep:
mkdir -p debian/pico-sdk-source/usr/src/pico-sdk/docs
touch debian/pico-sdk-source/usr/src/pico-sdk/docs/CMakeLists.txt
override_dh_auto_install-arch:
dh_auto_install --sourcedirectory=tools/pioasm --builddirectory=pioasm-obj-$(DEB_HOST_GNU_TYPE)
execute_before_dh_auto_clean:
if [ -d ./lib/tinyusb ]; then rmdir ./lib/tinyusb; else rm -f ./lib/tinyusb; fi
# remove empty directories so they don't get shipped in the binary package
[ ! -d ./lib ] || find ./lib/ -type d -empty -delete
|