File: rules

package info (click to toggle)
libgnatcoll 23.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,460 kB
  • sloc: ada: 54,839; python: 1,268; ansic: 720; makefile: 229; sh: 149
file content (76 lines) | stat: -rwxr-xr-x 2,704 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
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/make -f
# Build script for GNATColl in Debian.
# Copyright (c) 2014-2022 Nicolas Boulenguez <nicolas@debian.org>

# This build script is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

# On Debian systems, the full text of the GPL is in the file
# /usr/share/common-licenses/GPL-3.

DPKG_EXPORT_BUILDFLAGS := 1
DEB_BUILD_MAINT_OPTIONS := hardening=+all
DEB_LDFLAGS_MAINT_APPEND := \
  -Wl,--no-allow-shlib-undefined \
  -Wl,--no-copy-dt-needed-entries \
  -Wl,--no-undefined
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/buildopts.mk
include $(wildcard /usr/share/ada/packaging.mk)
# wildcard means: not during -indep builds.

%:
	dh $@

.PHONY: $(addprefix override_dh_auto_,configure clean build-arch \
  build-indep test install-arch install-indep)
# Disable autodetection of upstream targets.
# We want to avoid clean and install.  Moreover, test does not exist,
# but while figuring this during -indep builds, debhelper
# would run Make and Make would fail to run gprconfig.

gpr_vars := \
  -XGNATCOLL_VERSION=$(gnatcoll_SO_VERSION) \
  -XGNATCOLL_BUILD_MODE=PROD \
  # EOL

# Prevent Makefile from messing with gprconfig
# (NORMALIZED_TARGET is wrong at least for i386 and hurd-i386).
override_dh_auto_build-arch:
	gprconfig --batch $(GPRCONFIGFLAGS)
	gprbuild gnatcoll.gpr $(GPRBUILDFLAGS) $(gpr_vars) \
	  -XLIBRARY_TYPE=static
	gprbuild gnatcoll.gpr $(GPRBUILDFLAGS) $(gpr_vars) \
	  -XLIBRARY_TYPE=relocatable

override_dh_auto_install-arch:
	gprinstall gnatcoll.gpr $(gpr_vars) \
	  -XLIBRARY_TYPE=static $(static_GPRINSTALLFLAGS)
	gprinstall gnatcoll.gpr $(gpr_vars) \
	  -XLIBRARY_TYPE=relocatable $(call shared_GPRINSTALLFLAGS,gnatcoll)

override_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -Cdocs html latexpdf text \
	  $(DEB_BUILD_OPTION_PARALLEL:%=SPHINXOPTS=-j%)
endif

# Force regeneration of distrib/gnatcoll/runtime.py.
override_dh_auto_build-indep: runtime-stamp
runtime-stamp:
	cd distrib && python3 gen_gps.py
	touch $@

# Avoid a warning about doc-main-package.
doc_pkg := libgnatcoll-doc
execute_before_dh_installdocs:
	dh_installdocs --package=$(doc_pkg) --doc-main-package=$(doc_pkg)
execute_before_dh_installexamples:
	dh_installexamples --package=$(doc_pkg) --doc-main-package=$(doc_pkg)