File: rules

package info (click to toggle)
ahven 2.7-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 948 kB
  • sloc: ada: 4,382; makefile: 220; sh: 79; xml: 59; perl: 30; python: 26
file content (66 lines) | stat: -rwxr-xr-x 2,037 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
59
60
61
62
63
64
65
66
#!/usr/bin/make -f

# Parse debian/control once to extract all values we need.
# Replace eval with error to debug.
$(foreach line,$(shell sed -n '\
  s/^ gnat, gnat-\([0-9.]\+\),$$/         gnat_version:=\1             /p;\
  s/^Package: libahven\([0-9.]\+\)$$/     ahven_soversion:=\1          /p;\
  ' debian/control),$(eval $(line)))

doc_pkg := libahven-doc

DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/buildflags.mk
include /usr/share/ada/debian_packaging-$(gnat_version).mk

conf_args := \
  GNAT_BUILDER=gprbuild \
  GNAT_BUILDER_FLAGS='$(BUILDER_OPTIONS) -Xahven_soversion=$(ahven_soversion)' \
  $(foreach v,ADAFLAGS LDFLAGS,$(v)='$($(v))')

%:
	dh ${@}

override_dh_auto_configure:
	$(MAKE) configure builddir=../obj-dynamic library_type=dynamic $(conf_args)
	$(MAKE) configure builddir=../obj-static library_type=static $(conf_args)
	$(MAKE) configure builddir=../obj-docs $(conf_args)

override_dh_auto_build-arch:
	dh_auto_build -- -C obj-dynamic
	dh_auto_build -- -C obj-static
override_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	SPHINXOPTS=-j$(BUILDER_JOBS) dh_auto_build -- -C obj-docs docs
endif

override_dh_auto_test-arch:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	LD_LIBRARY_PATH=stage/usr/local/lib dh_auto_test -- -C obj-dynamic
endif
override_dh_auto_test-indep:

override_dh_auto_install:

override_dh_auto_clean:
	rm -fr obj-dynamic obj-static obj-docs
	rm -f gnat_linux/comfignat.gpr

# Mimic 'dh --with ada-library', but without adding dh-ada-library to
# Build-Depends.
# dh_ada_library has no -aP option.
override_dh_install-arch:
	dh_install -a
	cp -f obj-dynamic/comfignat.gpr gnat_linux
	dh_ada_library OS_VERSION=unix gnat_linux/build_ahven.gpr
	rm gnat_linux/comfignat.gpr

# Mimic 'dh --with sphinxdoc', but without adding sphinx-common to
# Build-Depends for arch-only builds.
override_dh_installdocs-indep:
	dh_installdocs -i
	dh_sphinxdoc

override_dh_compress:
	dh_compress -p$(doc_pkg) -X.ads -X.adb -XMakefile
	dh_compress --remaining-packages