File: rules

package info (click to toggle)
libhmsbeagle 3.1.2%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 45,696 kB
  • sloc: xml: 133,356; cpp: 24,224; ansic: 5,842; java: 2,050; python: 570; makefile: 354; sh: 268
file content (66 lines) | stat: -rwxr-xr-x 2,196 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
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules of libhmsbeagle

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/default.mk

lib := $(shell grep Package: debian/control | grep -v -e "$(DEB_SOURCE)-" | sed 's/Package: \+//')
use_sse := $(shell if [ `dpkg-architecture -qDEB_BUILD_ARCH` = amd64 ] ; then echo yes ; else echo no ; fi)
BUILDGNUTYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
BUILDARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)

%:
	LC_ALL=C.UTF-8 dh $@ --with javahelper

override_dh_auto_configure:
	./autogen.sh
	dh_auto_configure -- --enable-doxygen-man --enable-march-native=no --enable-sse=$(use_sse) --with-opencl=/usr/include/CL

override_dh_auto_build:
	$(MAKE)
	$(MAKE) doxygen-doc
	ant

override_dh_auto_clean:
	$(MAKE) -f Makefile distclean || true
	rm -rf doc .config configure
	rm -rf lib build

override_dh_installdocs:
	dh_installdocs
	find debian/$(DEB_SOURCE)-dev -name jquery.js -delete
	find debian/$(DEB_SOURCE)-dev -name "*.md5" -delete

# run tests only on platforms supporting opencl
# see https://lists.debian.org/debian-mentors/2015/08/msg00081.html
num_opencl_platforms := $(shell clinfo | head -n1 | sed -e "s/.*[^0-9]\([0-9]\+\)[^0-9]*$$/\1/")

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(num_opencl_platforms),  0)
	@echo "No OpenCL platform available, skipping test"
else
ifeq ($(BUILDARCH),amd64)
	# VERBOSE=1 dh_auto_test
	# pbuilder has set HOME=/nonexistent.  Since some valid HOME is needed
	# to pass the test this is set to /tmp
	#
	#    Ignore test failures which are most probably not relevant on real
	#    hardware but occur in restricted Debian build environment
	#      https://github.com/beagle-dev/beagle-lib/issues/121
	HOME=/tmp make check VERBOSE=1 || true
else
	echo "Pocl works only on amd64 properly - skip the tests on $(BUILDARCH)."
endif
endif
endif

override_dh_link:
	dh_link
	opencllib=`find debian/$(lib)/usr/lib -name "libhmsbeagle-opencl.so.*" | sed 's?debian/$(lib)/??' | grep -v '\.0$$'` ; \
	dh_link -plibhmsbeagle-dev $${opencllib} usr/lib/$(BUILDGNUTYPE)/libhmsbeagle-opencl.so