File: rules

package info (click to toggle)
xrt 202210.2.13.466%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 81,288 kB
  • sloc: cpp: 410,100; ansic: 134,206; sh: 6,503; python: 5,564; lisp: 1,345; makefile: 902; xml: 256; csh: 220; perl: 48; tcl: 5
file content (89 lines) | stat: -rwxr-xr-x 2,318 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/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

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