File: rules

package info (click to toggle)
libcpucycles 0~20260105-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 588 kB
  • sloc: ansic: 1,174; python: 404; sh: 62; makefile: 41
file content (58 lines) | stat: -rwxr-xr-x 1,626 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
#!/usr/bin/make -f

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

# disable hardening-pie on x32
# fixes compilation problem: relocation R_X86_64_PC32 against symbol `cpucycles'
# can not be used when making a shared object
ifeq ($(DEB_HOST_ARCH), x32)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
endif

# disable hardening-pie on alpha
# fixes compilation problem: gp-relative relocation against dynamic symbol cpucycles
ifeq ($(DEB_HOST_ARCH), alpha)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
endif


%:
	dh $@

# 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)

# Print debug information
.PHONY: debugprint
debugprint:
	@echo "=== debug: ==="
	@echo "CFLAGS: ${CFLAGS}"
	@echo "CPPFLAGS: ${CPPFLAGS}"
	@echo "LDFLAGS: ${LDFLAGS}"
	@echo "=============="
	@echo "dpkg-architecture:"
	@dpkg-architecture
	@echo "=============="

override_dh_auto_configure: debugprint
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	head -v $(shell find . -name cpucycles.3)
	(! command -v pandoc) || autogen/man
	head -v $(shell find . -name cpucycles.3)
endif
	./configure --host=$(DEB_HOST_ARCH_CPU) --prefix=/usr

override_dh_auto_clean:
	rm -rf ./build

# disable auto installation
override_dh_auto_install:

# run cpucycles-info
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/cpucycles-info
endif