File: rules

package info (click to toggle)
libhmsbeagle 2.1.2%2B20160831-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,764 kB
  • ctags: 2,366
  • sloc: cpp: 17,464; ansic: 5,842; java: 1,715; sh: 1,338; python: 486; makefile: 355; xml: 299
file content (68 lines) | stat: -rwxr-xr-x 2,011 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
#!/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=+bindnow

pkg := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
lib := $(pkg)1v5
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)

%:
	dh $@ --with autoreconf --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_install:
	dh_install
	jniso=`find debian/$(lib) -name $(pkg)-jni.so` ; \
	mkdir -p `dirname $$jniso`/jni ; \
	mv $$jniso `dirname $$jniso`/jni

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/$(pkg)-dev -name jquery.js -delete
	find debian/$(pkg)-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/")

ifeq ($(num_opencl_platforms),  0)
override_dh_auto_test:
	@echo "No OpenCL platform available, skipping test"	
else
override_dh_auto_test:
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
	HOME=/tmp make check VERBOSE=1
else
	echo "Pocl works only on amd64 properly - skip the tests on $(BUILDARCH)."
endif
endif

override_dh_link:
	dh_link
	dh_link -plibhmsbeagle-dev usr/lib/$(BUILDGNUTYPE)/libhmsbeagle-opencl.so.21 usr/lib/$(BUILDGNUTYPE)/libhmsbeagle-opencl.so

get-orig-source:
	. debian/get-orig-source