File: rules

package info (click to toggle)
beignet 1.3.0-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,308 kB
  • sloc: cpp: 65,388; ansic: 27,365; lisp: 17,421; python: 1,129; sh: 882; makefile: 24
file content (42 lines) | stat: -rwxr-xr-x 2,381 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
#!/usr/bin/make -f
# -*- makefile -*-

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND = -DGBE_DEBUG=1

%:
	dh $@ --buildsystem cmake --parallel

# We build with the headers from opencl-headers.
SUPERFLUOUS=cl.h cl_d3d10.h cl_dx9_media_sharing.h cl_ext.h cl_gl_ext.h cl_platform.h cl.hpp cl_d3d11.h cl_egl.h cl_gl.h opencl.h

# Use the same LLVM version as mesa (build will fail if this version is not available; this is intentional, as mixing versions may cause crashes)
# http://lists.alioth.debian.org/pipermail/pkg-opencl-devel/Week-of-Mon-20160418/000963.html
LLVM_VERSION_MESA	:= $(shell dpkg-query -f '$${Depends} \n' -W libgl1-mesa-dri:$(DEB_HOST_ARCH) | sed -r 's/.*libllvm([0-9.]+).*/\1/p;d')
#x32 mesa doesn't use libllvm - use 3.8 there, as their "3.9" snapshot doesn't work for us https://buildd.debian.org/status/fetch.php?pkg=beignet&arch=x32&ver=1.3.0-2&stamp=1489907158&raw=0
LLVM_VERSION_DEFAULT	 = 3.8
LLVM_VERSION		 = $(or $(LLVM_VERSION_MESA),$(LLVM_VERSION_DEFAULT))
#this looks the wrong way round because --compare-versions uses success=0 and we need on=1
CAN_ENABLE_OPENCL2	:= $(if $(findstring amd64,$(DEB_HOST_ARCH)),$(shell dpkg --compare-versions $(LLVM_VERSION) lt 3.9 || dpkg --compare-versions `dpkg-query -f '$${Version}' -W libdrm-dev:$(DEB_HOST_ARCH)` lt 2.4.66 ; echo $$?),0)

override_dh_auto_configure:
	$(RM) $(patsubst %,include/CL/%,$(SUPERFLUOUS))
	ls -la include/CL
	dh_auto_configure --buildsystem cmake -- -DLLVM_INSTALL_DIR=/usr/lib/llvm-$(LLVM_VERSION)/bin -DENABLE_OPENCL_20=$(CAN_ENABLE_OPENCL2)

#Include the documentation, without timestamps (which break multiarch because debian/patches/update-docs.patch etc are applied at build time - #840678)
override_dh_auto_build:
	dh_auto_build
	ikiwiki --verbose --no-usedirs --underlaydir docs --plugin map --rebuild docs docs_build
	rm -rf docs_build/ikiwiki
	for HTMLFILE in `find $(CURDIR)/docs_build/ -name *.html` ; do \
	  sed -e "s;Last edited <span class=.date.>.*;;" $$HTMLFILE > $$HTMLFILE.tmp ; \
	  sed -e "s;<!-- Created <span class=.date.>.*;;" $$HTMLFILE.tmp > $$HTMLFILE ; \
	  rm $$HTMLFILE.tmp ; \
	done

override_dh_gencontrol:
	dh_gencontrol -- -VBuilt-Using:clang="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), \n' -W libclang-$(LLVM_VERSION)-dev)"