File: rules

package info (click to toggle)
lib1305 0~20250415-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,096 kB
  • sloc: asm: 21,226; ansic: 10,838; python: 4,340; sh: 178; makefile: 40
file content (54 lines) | stat: -rwxr-xr-x 1,452 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
#!/usr/bin/make -f

# export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,noexecstack

# Disable hardening-stackclash on armhf.
# On armhf, valgrind test dies with a SIGSEGV when
# built with either -fstack-clash-protection or -fstack-check.
ifeq ($(DEB_TARGET_ARCH), armhf)
export DEB_BUILD_MAINT_OPTIONS = hardening=hardening=+all,-stackclash
endif

# crossbuild
ifneq  ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
include /usr/share/dpkg/buildtools.mk
endif

%:
	dh $@ --with python3

# The debian/compiler directory contains gcc and clang wrappers.
# It adds Debian specifific options distributed in
# $CC, $CFLAGS, $CPPFLAGS and $LDFLAGS
export PATH := $(shell pwd)/debian/compiler:$(PATH)

# Detects the correct ABINAME from the DEB_BUILD_ARCH
# instead of run-time detection. Fixes FTBR.
ABINAME=$(DEB_BUILD_ARCH)
ifeq ($(ABINAME), x32)
ABINAME=amd64
endif

COMMAND_VALGRIND = $(shell command -v valgrind)

ifeq ($(filter /usr/bin/valgrind,$(COMMAND_VALGRIND)),)
DISABLE_VALGRIND += --no-valgrind
endif

override_dh_auto_configure:
	./configure --host=$(ABINAME) --prefix=/usr $(DISABLE_VALGRIND)

override_dh_auto_clean:
	rm -rf ./build

# disable auto installation
override_dh_auto_install:

# run lib1305-test
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	env "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:./build/0/package/lib" ./build/0/package/bin/lib1305-test
endif