File: rules

package info (click to toggle)
magma 2.5.4%2Bds-3
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye
  • size: 55,132 kB
  • sloc: cpp: 403,043; fortran: 121,916; ansic: 29,190; python: 25,167; f90: 13,666; makefile: 776; csh: 232; xml: 182; sh: 178; perl: 88
file content (62 lines) | stat: -rwxr-xr-x 1,630 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
54
55
56
57
58
59
60
61
62
#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# misc configs
export OPENBLASDIR=/usr
export CUDADIR=/usr
export DESTDIR=$(pwd)/debian/tmp
export prefix=/usr

# detect ccache
ifneq (,$(shell which ccache))
export NVCC=ccache nvcc
export CC=ccache cuda-gcc
export CXX=ccache cuda-g++
else
export NVCC=nvcc
export CC=cuda-gcc
export CXX=cuda-g++
endif

%:
	dh $@

make.inc:
	cp -v make.inc-examples/make.inc.openblas make.inc
	sed -i -e 's#^\(CC\)\s*=\(.*\)#\1 = $(CC)#' \
		-e 's#^\(CXX\)\s*=\(.*\)#\1 = $(CXX)#' \
		-e 's#^\(NVCC\)\s*=\(.*\)#\1 = $(NVCC)#' \
		-e 's#^\(CFLAGS\)\s*=\(.*\)#\1 = \2 $(CPPFLAGS) $(CFLAGS)#' \
		-e 's#^\(FFLAGS\)\s*=\(.*\)#\1 = \2 $(FFLAGS)#' \
		-e 's#^\(LDLAGS\)\s*=\(.*\)#\1 = \2 $(LDLAGS)#' \
		-e 's#-lopenblas#-lblas -llapack#' \
		-e 's@^#\(OPENBLASDIR\)\s*?=.*@\1 ?= /usr@' \
		-e 's@^#\(CUDADIR\)\s*?=.*@\1 ?= /usr@' \
		make.inc

override_dh_auto_configure: make.inc
	dh_auto_configure

override_dh_auto_build-arch:
	dh_auto_build

override_dh_auto_build-indep:
	$(MAKE) generate
	cd docs; doxygen Doxyfile
#	find docs -type f -name '*.html' -exec sed -i -e \
#		's@http://cdn.mathjax.org/mathjax/latest/MathJax.js@file:///usr/share/javascript/mathjax/MathJax.js@g' \
#		'{}' \;

override_dh_auto_install-arch:
	dh_auto_install
	# upstream install target does not install the test binaries
	for I in $$(find testing -type f -executable -name 'testing_*'); do \
		install -Dm0755 $$I debian/libmagma-test/usr/lib/libmagma-test/$$I; done

override_dh_auto_clean: make.inc
	dh_auto_clean
	-$(RM) make.inc