File: rules

package info (click to toggle)
libaunit 18-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,100 kB
  • sloc: ada: 5,325; makefile: 152; sh: 94; xml: 13
file content (55 lines) | stat: -rwxr-xr-x 1,739 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
#!/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;\
  s/^Package: \(lib[a-z-]\+[0-9.]\+-dev\)$$/ \
    DEV_PKG:=\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
ADAFLAGS += -gnatfno -gnatwa -gnatVa

%:
	dh $@ --with ada-library

######################################################################
# Ignore upstream Makefile/configure.
.PHONY: $(addprefix override_dh_auto_,configure build test install)
# clean target is OK.

gpr_args = 'USER_GPR_ARGS=$(BUILDER_OPTIONS) $(foreach v,$(1),"-X$(v)=$($(v))")'
override_dh_auto_build:
	$(MAKE) \
	  $(call gpr_args, ADAFLAGS)

	$(MAKE) \
	  $(call gpr_args, ADAFLAGS LDFLAGS SOVERSION)

######################################################################
# The order in this list matters for rdfind.
INSTALLED_EXAMPLES := \
  $(subst examples/,debian/$(DEV_PKG)/usr/share/doc/$(DEV_PKG)/examples/, \
    $(wildcard examples/*))

.PHONY: override_dh_installexamples
override_dh_installexamples:
	dh_installexamples --all
  # Replace duplicate files with symlinks.
	rdfind -outputname /dev/null -makesymlinks true $(INSTALLED_EXAMPLES)
  # symlinks to make them relative (only if -indep build).
	symlinks -r -s -c $(INSTALLED_EXAMPLES)

######################################################################
.PHONY: override_dh_compress
override_dh_compress:
	dh_compress --package=$(DEV_PKG) --exclude=usr/share/doc/$(DEV_PKG)/examples/
# Check calculator/tests/stack-test.adb.gz
	dh_compress --remaining-packages