File: rules

package info (click to toggle)
gnat-gps 5.3dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 50,360 kB
  • ctags: 11,617
  • sloc: ada: 374,346; ansic: 92,327; python: 15,979; xml: 12,186; sh: 3,277; makefile: 1,113; awk: 154; perl: 128; java: 17
file content (173 lines) | stat: -rwxr-xr-x 5,885 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/usr/bin/make -f

##############
# Legal stuff
##############

# Copyright (c) 2003-2006, 2011-2014 Ludovic Brenta <lbrenta@debian.org>
# Copyright (c) 2010-2014 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.

.SUFFIXES:

########################
# Guess some variables.
########################

include /usr/share/dpkg/default.mk
# Set CFLAGS (handling noopt from DEB_BUILD_OPTIONS), LDFLAGS,
# DEB_HOST_GNU_TYPE, DEB_HOST_ARCH, DEB_VERSION...

include /usr/share/ada/debian_packaging.mk

######################################################################
POLICY_TARGETS := binary binary-arch binary-indep build build-arch \
  build-indep clean
.PHONY: $(POLICY_TARGETS)
$(POLICY_TARGETS):
	dh $@ --with linktree --with sphinxdoc

# Do not try to call an upstream configure or Makefile.
.PHONY: $(addprefix override_dh_auto_, \
  clean configure build-arch build-indep test install)

######################################################################
# See gnat-gps-doc.TODO and the share/* part of gnat-gps-common.install.
GNAT_SWITCHES_PY := share/plug-ins/gps_utils/gnat_switches.py
binary-indep: $(GNAT_SWITCHES_PY)
$(GNAT_SWITCHES_PY):
	touch $@
override_dh_auto_clean::
	rm -f $(GNAT_SWITCHES_PY)

######################################################################
override_dh_auto_build-arch: gnat-gps

# gnatmake knows if the file needs recompilation.
.PHONY: gnat-gps
gnat-gps:
	gnatmake $(BUILDER_OPTIONS) -k -a -m -Pdebian/build_gps.gpr \
          -XADAFLAGS="$(ADAFLAGS)" \
          -XLDFLAGS="$(LDFLAGS)" \
          -XLDLIBS="$(LDLIBS)" \
          -XC_OBJECTS="$(addprefix ../,$(C_OBJECTS))"

# C_OBJECTS prerequisite is defined later, but may be used in the recipe now.

gnat-gps: LDLIBS := `pkg-config --libs gtk+-2.0 cairo-xlib-xrender`

gnat-gps: LDLIBS += -lutil
# common/tty/terminals.c calls openpty, needing -lutil on FreeBSD

override_dh_auto_clean::
	rm -f gnat-gps obj/*

######################################################################
CONFIG_ADS := common/core/src/config.ads
gnat-gps: $(CONFIG_ADS)
$(CONFIG_ADS): %: %.in
	sed -e 's/@GPS_VERSION@/$(DEB_VERSION)/' \
	    -e 's/@TARGET@/$(DEB_HOST_GNU_TYPE))/' \
	    -e 's!@prefix@!/usr!' \
	    -e 's/@HOST_TYPE@/Unix/' \
	    -e 's/@STRIP_CR@/False/' \
	    -e 's/@CAN_OUTPUT@/True/' \
	    -e 's!@EXEC_COMMAND@!/bin/sh -c!' \
	    -e 's/@DEFAULT_FONT@/Sans 9/' \
	    -e 's/@DEFAULT_FIXED_FONT@/Mono 9/' \
	    -e 's/@DEFAULT_PS@/ps/' \
	    -e 's/@PRINT_CMD@/lpr/' \
	    -e 's/@OPAQUE_MDI@/True/' \
	    -e 's/@DIFF_CMD@/diff -u/' \
	    -e 's/@DIFF3_CMD@/diff3/' \
	    -e 's/@PATCH_CMD@/patch/' \
	    -e 's/@EXECUTION_WINDOW@/True/' \
	    -e "s/unknown date/Debian/" \
	    -e 's/@CHARSET@/UTF-8/' $< > $@
override_dh_auto_clean::
	rm -f $(CONFIG_ADS)

######################################################################
C_SOURCES := \
 common/tty/terminals.c \
 gvd/pixmaps/pixmaps.c \
 prj_editor/src/env.c \
 vcs/pixmaps/pixmaps_vcs.c \
 vdiff/src/pixmaps_vdiff.c \
 widgets/src/check_button.c \
 widgets/src/gtkada_terminal.c \
 widgets/src/native_file_selection.c \

C_OBJECTS := $(patsubst %.c,%.o,$(C_SOURCES))

gnat-gps: $(C_OBJECTS)

# Default rule, sufficient for most C files. We repeat it here so that it
# is not erased when we add prerequisites to some specific sources.
$(C_OBJECTS): %.o: %.c
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@

# Use pkg-config to figure the exact cflags needed.
pkg_config_depends = $(1).o: CFLAGS += `pkg-config --cflags $(2)`
$(call pkg_config_depends,widgets/src/check_button,gtk+-2.0)
$(call pkg_config_depends,widgets/src/gtkada_terminal,gtk+-2.0)

override_dh_auto_clean::
	rm -f $(C_OBJECTS)

######################################################################

override_dh_auto_build-indep: docs
.PHONY: docs
docs: docs/Makefile
	$(MAKE) -C docs

docs/Makefile: docs/Makefile.in
	sed -e 's,@prefix@,/usr,' -e 's,@MAKEINFO@,makeinfo,' \
	    -e 's,@TEXI2DVI@,texi2dvi,' -e 's,@INSTALL@,install,' \
	    -e 's,@INSTALL_DATA@,install -m 644,' $< > $@
override_dh_auto_clean::
	if test -f docs/Makefile; then $(MAKE) -C docs clean; fi
	rm -f docs/users_guide/GPS.pyc
	rm -f docs/Makefile

######################################################################
# Replacing documentation directories with symbolic links would spare
# 10Kb but creates too much maintainance, see #684194 and #655383.
# From 4.3-1 to 5.0-12, every binary package has created at least a
# link, that dpkg may never have removed since (policy 6.6.4).
# Generated preinst scripts will remove them.
PREINST_ARCH  := debian/gnat-gps.preinst \
                 debian/gnat-gps-dbg.preinst
PREINST_INDEP := debian/gnat-gps-common.preinst \
                 debian/gnat-gps-doc.preinst
binary-arch: $(PREINST_ARCH)
binary-indep: $(PREINST_INDEP)
clean: clean_preinst
$(PREINST_ARCH) $(PREINST_INDEP): debian/%.preinst: debian/rm_doc_symlink.preinst.sed
	sed s/PKGNAME/$*/ $< > $@
.PHONY: clean_preinst
clean_preinst:
	rm -f $(PREINST_ARCH) $(PREINST_INDEP)

######################################################################
.PHONY: override_dh_compress
override_dh_compress:
	dh_compress --all -X.xml -X.ads -X.adb -X.c -X.py

.PHONY: override_dh_strip
override_dh_strip:
	dh_strip --package=gnat-gps --dbg-package=gnat-gps-dbg
	dh_strip --remaining-packages