File: rules

package info (click to toggle)
dumpasn1 20210212-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 436 kB
  • sloc: ansic: 2,609; makefile: 28; sh: 22
file content (41 lines) | stat: -rwxr-xr-x 1,147 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
#!/usr/bin/make -f
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

VALGRIND_ARCHS=amd64 arm64 armhf i386 ppc64el s390x powerpc ppc64

-include /usr/share/dpkg/buildtools.mk

%:
	dh $@

dumpasn1: dumpasn1.o
	$(CC) -o dumpasn1 dumpasn1.o $(CFLAGS) $(LDFLAGS)

dumpasn1.o: dumpasn1.c
	$(CC) -o dumpasn1.o -DDEBIAN $(CPPFLAGS) $(CFLAGS) -c dumpasn1.c

override_dh_auto_build: dumpasn1 debian/dumpasn1.1

override_dh_auto_test: dumpasn1
ifeq ($(DEB_BUILD_ARCH),$(filter $(DEB_BUILD_ARCH),$(VALGRIND_ARCHS)))
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	debian/tests/unicode-strings ./dumpasn1
	debian/tests/bmp-strings ./dumpasn1
endif
else
	echo "Arch $(DEB_BUILD_ARCH) cannot run valgrind test"
endif

debian/control: debian/control.in
	sed -e "s/@VALGRIND_ARCHS@/$(VALGRIND_ARCHS)/g" $< > $@

get-orig-source:
	./debian/get-orig-source

VER_FULL = $(shell dpkg-parsechangelog | grep '^Version' | cut -d' ' -f2 | cut -f1 -d-)
debian/dumpasn1.1: debian/dumpasn1.1.in dumpasn1
	help2man --include=$< --output=$@ \
		--name="ASN.1 object dump/syntax check program" \
		--no-info ./`basename $@ .1` --version-string=$(VER_FULL)