#!/usr/bin/make -f export DH_VERBOSE = 1 include /usr/share/dpkg/pkg-info.mk export DEB_VERSION_UPSTREAM export DEB_BUILD_MAINT_OPTIONS = hardening=+all # export DEB_CXXFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_CXXFLAGS_MAINT_APPEND +=-Wno-error=unused-but-set-variable \ -Wno-error=unused-variable \ -Wno-error=sign-compare \ -Wno-error=reorder \ -Wno-error=deprecated-declarations \ -Wno-stringop-overflow \ -Wno-error=maybe-uninitialized \ -Wno-error=overloaded-virtual ifeq ($(DEB_DISTRIBUTION),unstable) DEB_CXXFLAGS_MAINT_APPEND +=-Wno-error=mismatched-new-delete endif BUILDDIR := obj-$(DEB_HOST_GNU_TYPE) BUILD_DKMS ?= false CONFIGURE_ARGS = -DCMAKE_BUILD_TYPE=Debug \ -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) DH_OPTION = ifeq ($(DEB_HOST_ARCH),arm64) CONFIGURE_ARGS += -DXRT_EDGE_BUILD=yes ifeq ($(BUILD_DKMS),true) DH_OPTION = --with dkms endif endif %: dh $@ $(DH_OPTION) override_dh_auto_configure: dh_auto_configure --sourcedir=src -- $(CONFIGURE_ARGS) override_dh_auto_build: ifeq ($(DEB_HOST_ARCH) $(BUILD_DKMS), arm64 true) sed -i 's/^# //' debian/control endif dh_auto_build --sourcedir=src override_dh_auto_install: dh_auto_install --sourcedir=src cd $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/; \ mv libxilinxopencl_static.a libxilinxopencl.a; \ mv libxrt++_static.a libxrt++.a; \ mv libxrt_core_static.a libxrt_core.a; \ mv libxrt_coreutil_static.a libxrt_coreutil.a ifeq ($(DEB_HOST_ARCH),amd64) cd $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/; \ mv libxrt_hwemu_static.a libxrt_hwemu.a; \ mv libxrt_swemu_static.a libxrt_swemu.a endif ifeq ($(DEB_HOST_ARCH) $(BUILD_DKMS), arm64 true) dh_install -p zocl-edge-dkms -Xpcie -Xtools -XCMakeLists.txt \ src/runtime_src/core/* usr/src/zocl-edge-$(DEB_VERSION_UPSTREAM)/ endif rm -rf $(CURDIR)/debian/tmp/usr/bin/unwrapped/ rm -rf $(CURDIR)/debian/tmp/usr/src # Fix lintian: script-with-language-extension ifeq ($(DEB_HOST_ARCH),amd64) mv $(CURDIR)/debian/tmp/usr/bin/plp_program.sh \ $(CURDIR)/debian/tmp/usr/bin/plp_program mv $(CURDIR)/debian/tmp/usr/bin/mpd \ $(CURDIR)/debian/tmp/usr/bin/xrt_mpd endif override_dh_missing: override_dh_auto_test: -dh_auto_test override_dh_dkms: ifeq ($(DEB_HOST_ARCH) $(BUILD_DKMS), arm64 true) dh_dkms -p zocl-edge-dkms -V $(DEB_VERSION_UPSTREAM) endif