File: rules

package info (click to toggle)
plast 2.3.2%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 16,300 kB
  • sloc: cpp: 28,980; ansic: 2,075; sh: 478; makefile: 73
file content (89 lines) | stat: -rwxr-xr-x 2,718 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/make -f

# DH_VERBOSE := 1

include /usr/share/dpkg/default.mk

BUILD_DIR := obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export BDATE=$(shell TZ=UTC LC_ALL=C date -d"@$(SOURCE_DATE_EPOCH)" +'%Y-%m-%d')
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND += -DSIMDE_ENABLE_OPENMP -fopenmp-simd -O3
export DEB_CXXFLAGS_MAINT_APPEND += -DSIMDE_ENABLE_OPENMP -fopenmp-simd -O3

AMD64_SIMDE=sse3
I386_SIMDE=sse2 sse

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure-arch:
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386))
	set -e ; for SIMD in $(AMD64_SIMDE) ; do \
		export CXXFLAGS="$(CXXFLAGS) -m$${SIMD}" && export CFLAGS="$(CFLAGS) -m$${SIMD}" && \
		dh_auto_configure --builddirectory=obj-$${SIMD} ; \
	done
ifeq (i386,$(DEB_HOST_ARCH))
	set -e ; for SIMD in $(I386_SIMDE) ; do \
		export CXXFLAGS="$(CXXFLAGS) -m$${SIMD}" && export CFLAGS="$(CFLAGS) -m$${SIMD}" && \
		dh_auto_configure --builddirectory=obj-$${SIMD} ; \
	done
endif
endif
	dh_auto_configure

override_dh_auto_build-arch:
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386))
	set -e ; for SIMD in $(AMD64_SIMDE) ; do \
		dh_auto_build --builddirectory=obj-$${SIMD} ; \
	done
ifeq (i386,$(DEB_HOST_ARCH))
	set -e ; for SIMD in $(I386_SIMDE) ; do \
		dh_auto_build --builddirectory=obj-$${SIMD} ; \
	done
endif
endif
	dh_auto_build


override_dh_install-arch:
	dh_install -a
	# install binary
	cp -a $(BUILD_DIR)/bin/*/plast debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin/
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386))
	set -e ; for SIMD in $(AMD64_SIMDE) ; do \
		cp -a obj-$${SIMD}/bin/*/plast debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin/plast-$${SIMD} ; \
	done
ifeq (i386,$(DEB_HOST_ARCH))
	set -e ; for SIMD in $(I386_SIMDE) ; do \
		cp -a obj-$${SIMD}/bin/*/plast debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin/plast-$${SIMD} ; \
	done
endif
endif
	# no need for the includes
	rm -rf debian/*/usr/include

override_dh_auto_configure-indep:
override_dh_auto_build-indep:
override_dh_auto_install-indep:
	echo "I: Nothing to do for arch:indep binary"

override_dh_gencontrol-arch:
	dh_gencontrol -- -Vsimde:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W "libsimde-dev")"

override_dh_auto_test-indep:
override_dh_auto_test-arch:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386))
	set -e ; for SIMD in $(AMD64_SIMDE) ; do \
		if lscpu | grep -q $${SIMD} ; then \
		scripts/test-plast.sh obj-$${SIMD} ; fi ; \
	done
ifeq (i386,$(DEB_HOST_ARCH))
	set -e ; for SIMD in $(I386_SIMDE) ; do \
		if lscpu | grep -q $${SIMD} ; then \
		scripts/test-plast.sh obj-$${SIMD} ; fi ; \
	done
endif
endif
	scripts/test-plast.sh
endif