File: rules

package info (click to toggle)
harec 0.24.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,412 kB
  • sloc: ansic: 20,221; asm: 247; makefile: 118; lisp: 80; sh: 45
file content (33 lines) | stat: -rwxr-xr-x 952 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
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_clean:
	-dh_auto_clean
	-rm -f ./config.mk ./tests/*.o

override_dh_auto_configure:
	sed -e 's/^\s*ARCH\s*=\s.*/ARCH = $(DEB_BUILD_GNU_CPU)/' ./configs/linux.mk > ./config.mk || ($(RM) ./config.mk; false)

override_dh_auto_build:
	dh_auto_build -- VERSION=$(DEB_VERSION)

override_dh_auto_install:
	dh_auto_install -- PREFIX=/usr

override_dh_auto_test:
# On x86_64, run tests only on amd64 (linux), as this is the only linux x86_64
# target supported by upstream.
ifeq (amd64,$(DEB_TARGET_ARCH))
	dh_auto_test
endif
# On non x86_64 archs, run tests only on targets supported by upstream
# (e.g. arm64, riscv64).
ifneq (x86_64,$(DEB_BUILD_GNU_CPU))
	if ! (.bin/harec -a $(DEB_BUILD_GNU_CPU) 2>&1 || true) | grep 'Unsupported or unrecognized target:'; then dh_auto_test; fi
endif