File: rules

package info (click to toggle)
primesieve 12.12%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,952 kB
  • sloc: cpp: 16,515; ansic: 723; sh: 531; makefile: 91
file content (68 lines) | stat: -rwxr-xr-x 1,697 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
63
64
65
66
67
68
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

XDEB_VERSION_UPSTREAM_MAJOR=$(firstword $(subst ., ,$(DEB_VERSION_UPSTREAM)))

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

## see preamble in `Changes in version 11.0' section of the ChangeLog
XDEB_SONAME=$(XDEB_VERSION_UPSTREAM_MAJOR)

## inspired from mpfr material
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS    += -O0
	CXXCFLAGS += -O0
else ifeq ($(DEB_HOST_ARCH),alpha)
	CFLAGS   += -mieee
	CXXFLAGS += -mieee
else ifeq ($(DEB_HOST_ARCH),sha4)
	CFLAGS   += -mieee
	CXXFLAGS += -mieee
else
	CFLAGS   := $(subst -O2,-O3,$(CFLAGS))
	CXXFLAGS := $(subst -O2,-O3,$(CXXFLAGS))
endif

BUILDDIR=_build

default:
	@uscan --no-conf --dehs --report || true

%:
	dh $@ --builddirectory=$(BUILDDIR)

override_dh_auto_configure:
	dh_auto_configure -- \
		-DBUILD_TESTS=ON \
		-DBUILD_EXAMPLES=ON \
		-DBUILD_DOC=ON \
		-DBUILD_MANPAGE=ON

override_dh_auto_build-indep: README.implementation.md
	$(MAKE) -f debian/adhoc/Makefile doc

override_dh_auto_test-indep:
	true

override_dh_prep-arch: README.implementation.md

override_dh_auto_install-indep:
	DESTDIR=$(CURDIR)/debian/tmp $(CMAKE) \
			-DCMAKE_INSTALL_COMPONENT=libprimesieve-headers \
		-P $(BUILDDIR)/cmake_install.cmake

override_dh_installdocs:
	dh_installdocs -pprimesieve-bin    --link-doc=libprimesieve$(XDEB_SONAME)
	dh_installdocs -plibprimesieve-dev --doc-main-package=libprimesieve-dev-common
	dh_installdocs --remaining-packages

override_dh_installexamples-indep:
	dh_installexamples -XCMakeLists.txt -XREADME.md

override_dh_compress-indep:
	dh_compress -X.pdf -Xexamples

README.implementation.md:
	cp -p src/README.md README.implementation.md

CMAKE ?= cmake