File: rules

package info (click to toggle)
libhmsbeagle 4.0.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 46,424 kB
  • sloc: xml: 133,356; cpp: 36,477; ansic: 5,842; java: 2,400; python: 643; sh: 342; makefile: 50
file content (53 lines) | stat: -rwxr-xr-x 1,678 bytes parent folder | download | duplicates (2)
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
#!/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_HOST_MULTIARCH)
BUILDARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)

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

override_dh_auto_configure:
	dh_auto_configure -- \
	    -DBUILD_CUDA=OFF \
	    -DBUILD_OPENCL=OFF \
	    -DBUILD_SSE=OFF

override_dh_auto_build:
	dh_auto_build
	# Building the jar
	ant -Duser.name debian

# 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