#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) export DEB_HOST_MULTIARCH export DEB_BUILD_MAINT_OPTIONS = hardening=+all py3default = $(subst .,,$(shell py3versions -dv)) HAS_LIBDPDK_DEV=$(shell if [ -f /usr/include/dpdk/rte_version.h ] ; then echo "YES" ; else echo "NO" ; fi) DEB_NEON_SIMD_OPTION=$(shell if [ $(DEB_BUILD_ARCH) = armhf ]; then echo "-DNEON_SIMD_ENABLE=OFF" ; else echo "" ; fi) DEB_UHD_PACKAGE_CONFIGURATION=$(shell echo "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=\"\" \ -DENABLE_STATIC_LIBS=OFF -DENABLE_RFNOC_DEV=ON -DENABLE_MANUAL=ON \ -DUHD_VERSION=$(DEB_VERSION) -DENABLE_PYTHON_API=ON \ -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \ -DBOOST_PYTHON_COMPONENT=python$(py3default) \ -DPKG_LIB_DIR="/usr/libexec/uhd" $(DEB_NEON_SIMD_OPTION)") ifneq (,$(filter $(DEB_HOST_ARCH), mipsel)) export DEB_CXXFLAGS_MAINT_APPEND = -g1 endif %: dh $@ --sourcedirectory=host --with python3 --with numpy3 --buildsystem=cmake+ninja override_dh_auto_configure: dh_auto_configure $@ -- $(DEB_UHD_PACKAGE_CONFIGURATION) -DENABLE_DOXYGEN=ON -DENABLE_LATEX_DOCS=OFF \ -DENABLE_DOXYGEN_DOT=ON -DDOXYGEN_HAVE_DOT=True if [ $(HAS_LIBDPDK_DEV) = YES ] ; then dh_auto_configure $@ --builddirectory=uhdplain -- \ $(DEB_UHD_PACKAGE_CONFIGURATION) -DENABLE_DOXYGEN=OFF -DENABLE_DPDK=OFF ; fi override_dh_auto_build-arch: dh_auto_build $@ if [ $(HAS_LIBDPDK_DEV) = YES ] ; then dh_auto_build $@ --builddirectory=uhdplain ; fi override_dh_auto_build-indep: dh_auto_build $@ override_dh_auto_test-arch: echo "Some tests expected to fail in 4.9.0.0~rc*" - dh_auto_test override_dh_auto_test-indep: echo "Not testing - docs only build" override_dh_auto_install: - cp debian/uhd-host.limits debian/uhd-host/etc/security/limits.d/uhd.conf - cp debian/uhd-host.sysctl debian/uhd-host/usr/lib/sysctl.d/50-uhd-usrp2.conf dh_auto_install $@ - mv debian/tmp/usr/bin/usrp_hwd.py debian/tmp/usr/bin/usrp_hwd - if [ $(HAS_LIBDPDK_DEV) = YES ] ; then \ dh_auto_install $@ --builddirectory=uhdplain --destdir=debian/tmp/plain ;\ mv debian/tmp/plain/usr/bin/usrp_hwd.py debian/tmp/plain/usr/bin/usrp_hwd ;\ mkdir -p debian/tmp/dpdk/usr/lib ;\ mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) debian/tmp/dpdk/usr/lib/$(DEB_HOST_MULTIARCH) ;\ rm -rf debian/tmp/dpdk/usr/lib/$(DEB_HOST_MULTIARCH)/cmake ;\ rm debian/tmp/dpdk/usr/lib/$(DEB_HOST_MULTIARCH)/libuhd.so ;\ rm -rf debian/tmp/dpdk/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig ;\ mv debian/tmp/plain/usr/lib/$(DEB_HOST_MULTIARCH) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) ;\ mkdir -p debian/tmp/dpdk/usr/bin ;\ mv debian/tmp/usr/libexec/uhd/tests/dpdk_test debian/tmp/dpdk/usr/bin/dpdk_test ;\ mv debian/tmp/usr/libexec/uhd/tests/dpdk_port_test debian/tmp/dpdk/usr/bin/dpdk_port_test ;\ fi rm -rf debian/tmp/usr/share/doc/uhd/LICENSE - find debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/x400 -type d -empty -delete rm -rf debian/uhd-host/usr/libexec/uhd/tests/dpdk* # Remove source files used to generate documentation rm -rf debian/tmp/usr/share/doc/uhd/doxygen/latex chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/export/x300/radio/setupenv.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/lib/rfnoc/crossbar/synth/axis_ctrl_crossbar_nxn_top.tcl chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/lib/rfnoc/crossbar/synth/chdr_crossbar_nxn_top.tcl chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/tools/scripts/git-hash.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/tools/scripts/launch_modelsim.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/tools/scripts/launch_vcom.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/tools/scripts/launch_vivado.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/tools/scripts/setupenv_base.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/tools/scripts/shared-ip-loc-manage.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/e31x/setupenv.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/e320/setupenv.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/n3xx/setupenv.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/python/batch-build chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/x300/setupenv.sh chmod +x debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/x400/setupenv.sh rm -f debian/*/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/LICENSE.md rm -f debian/tmp/usr/libexec/uhd/utils/uhd-usrp.rules # install UTF-8 instead of ISO-8859 encoding iconv -f ISO-8859-1 -t utf8 debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/lib/zpu/wishbone/wishbone_pkg.vhd > wishbone_pkg.vhd.new mv -f wishbone_pkg.vhd.new debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/lib/zpu/wishbone/wishbone_pkg.vhd iconv -f ISO-8859-1 -t utf8 debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/lib/zpu/wishbone/zpu_system.vhd > zpu_system.vhd.new mv -f zpu_system.vhd.new debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/lib/zpu/wishbone/zpu_system.vhd iconv -f ISO-8859-1 -t utf8 debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/lib/zpu/wishbone/zpu_wb_bridge.vhd > zpu_wb_bridge.vhd.new mv -f zpu_wb_bridge.vhd.new debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/lib/zpu/wishbone/zpu_wb_bridge.vhd iconv -f ISO-8859-1 -t utf8 debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/x400/rf/400m/adc_gearbox_2x4.vhd > adc_gearbox_2x4.vhd.new mv -f adc_gearbox_2x4.vhd.new debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/x400/rf/400m/adc_gearbox_2x4.vhd iconv -f ISO-8859-1 -t utf8 debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/x400/rf/400m/dac_gearbox_12x8.vhd > dac_gearbox_12x8.vhd mv -f dac_gearbox_12x8.vhd debian/tmp/usr/share/uhd/4.9.0/rfnoc/fpga/usrp3/top/x400/rf/400m/dac_gearbox_12x8.vhd override_dh_shlibdeps: dh_shlibdeps --package=uhd-host --libpackage=libuhd4.9.0 dh_shlibdeps --package=libuhd4.9.0 --libpackage=libuhd4.8.0 dh_shlibdeps --package=libuhd4.9.0-dpdk --libpackage=libuhd4.8.0-dpdk dh_shlibdeps --package=libuhd4.9.0-dpdk-tests --libpackage=libuhd4.8.0-dpdk dh_shlibdeps --package=libuhd-dev --libpackage=libuhd4.9.0 dh_shlibdeps --package=python3-uhd --libpackage=libuhd4.9.0 override_dh_auto_clean: rm -rf host/tests/__pycache__ rm -rf host/tests/common/chdr_resource/__pycache__ rm -rf host/utils/__pycache__ rm -rf uhdplain dh_auto_clean $@