File: rules

package info (click to toggle)
libgmpada 1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 544 kB
  • sloc: ada: 4,956; makefile: 142; ansic: 55; sh: 15; sed: 11
file content (41 lines) | stat: -rwxr-xr-x 1,128 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

$(foreach line,$(shell sed -n '\
  s/^ gnat, gnat-\([0-9.]\+\),$$/ \
    GNAT_VERSION:=\1 \
  /p;\
  s/^Package: lib[a-z-]\+\([0-9.]\+\)$$/ \
    SOVERSION:=\1 \
  /p;\
  ' debian/control),$(eval $(line)))

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

%:
	dh $@ --with ada-library

.PHONY: override_dh_auto_build
override_dh_auto_build:
  # -gnatn is very useful for the thin binding.
	dh_auto_build -- \
	  $(foreach v,CFLAGS CPPFLAGS LDFLAGS SOVERSION,$(v)='$($(v))') \
	  ADAFLAGS='$(ADAFLAGS) -gnatn' \
	  GNATMAKE_OPTIONS='$(BUILDER_OPTIONS)'

.PHONY: override_dh_auto_test
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test -- \
	  $(foreach v,CFLAGS CPPFLAGS LDFLAGS SOVERSION,$(v)='$($(v))') \
	  ADAFLAGS='$(ADAFLAGS) -gnata' \
	  GNATMAKE_OPTIONS='$(BUILDER_OPTIONS)'
endif

# Ignore this target from upstream Makefile.
.PHONY: override_dh_auto_install

.PHONY: override_dh_compress
override_dh_compress:
	dh_compress --all $(addprefix --exclude=,.ads .adb Makefile .c .h)