File: rules

package info (click to toggle)
libncursesada 6.3.20211021-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,428 kB
  • sloc: ada: 9,968; sh: 3,382; makefile: 893; ansic: 702; awk: 68
file content (72 lines) | stat: -rwxr-xr-x 2,451 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
#!/usr/bin/make -f

DEB_BUILD_MAINT_OPTIONS := hardening=+all
# Set C and LD flags here, so that they also affect the upstream build
# system when it compiles the source generator.
# For now, all other compilations are driven by the project.
DEB_CFLAGS_MAINT_APPEND := -Wall -Wextra
DEB_LDFLAGS_MAINT_APPEND := \
  -Wl,--no-allow-shlib-undefined \
  -Wl,--no-copy-dt-needed-entries \
  -Wl,--no-undefined
DPKG_EXPORT_BUILDFLAGS := 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/ada/packaging.mk

%:
	dh $@

override_dh_autoreconf:
# The ncurses maintainer maintains his own fork of autoconf, which
# refuses the -f option (checked on 2020/04).
	rm -f configure
	dh_autoreconf autoconf-dickey

# TODO: is it now possible to use upstream build system?

# For ./configure:
export CC := gcc-$(DEB_GNAT_VERSION)

NCURSES_MODULES := form menu panel ncurses
NCURSES_CFLAGS  := `pkg-config --cflags $(NCURSES_MODULES)`
LDLIBS          := `pkg-config --libs $(NCURSES_MODULES)`
PROJECT := debian/ncursesada.gpr
shared := -XSOVERSION=$(ncursesada_SO_VERSION) -XLDLIBS="$(LDLIBS)"
static := -XSOVERSION=

override_dh_auto_build: default.cgpr
	$(MAKE) -Cinclude ncurses_def.h
	$(MAKE) -Cgen
 # The src/ build system ignores CFLAGS when building two versions of
 # the library. We only call it to generate a needed file.
 # TODO: the NEWS changelog seems to tell that this has been fixed.
 # Is it possible to pass ADAFLAGS?
	$(MAKE) -Csrc terminal_interface-curses-trace.adb

	gprbuild $(PROJECT) $(GPRBUILDFLAGS) -p $(static) \
	  -XNCURSES_CFLAGS="$(NCURSES_CFLAGS)"
	gprbuild $(PROJECT) $(GPRBUILDFLAGS) -p $(shared) \
	  -XNCURSES_CFLAGS="$(NCURSES_CFLAGS)"

 # The HTML pages must be rebuilt from source, but cannot go to a -doc
 # package because their contents varies accross architectures.
	$(MAKE) -Cgen html GNATHTML='gnathtml -I../debian/build/obj-dynamic'

 # A generated source installed as an example and built by autopkgtests.
	$(MAKE) -Csamples sample-explanation.adb

default.cgpr:
	gprconfig --batch $(GPRCONFIGFLAGS)

override_dh_auto_install:
	gprinstall $(PROJECT) $(static) $(static_GPRINSTALLFLAGS)
	gprinstall $(PROJECT) $(shared) \
	  $(call shared_GPRINSTALLFLAGS,ncursesada)

# doc/ provides a -config script giving build flags for
# reverse dependencies. We ignore it as per Debian Ada Policy
# we prefer project files.

.PHONY: override_dh_installchangelogs
override_dh_installchangelogs:
	dh_installchangelogs --all NEWS