File: rules

package info (click to toggle)
pike8.0 8.0.388-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 78,428 kB
  • ctags: 38,901
  • sloc: ansic: 265,343; xml: 184,899; makefile: 3,403; sh: 1,712; cpp: 1,328; lisp: 655; awk: 265; asm: 242; objc: 240; pascal: 157; perl: 34; sed: 34
file content (256 lines) | stat: -rwxr-xr-x 8,007 bytes parent folder | download | duplicates (2)
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.
#
# $Id: rules,v 1.64 2006/08/05 15:49:18 grendel Exp $
#

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

ifdef CCVER
CC=gcc-$(CCVER)
else
CC=gcc
endif

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFARGSEXTRA := --with-cdebug

ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
export CC=$(DEB_HOST_GNU_TYPE)-gcc
CFARGSEXTRA += --host=$(DEB_HOST_GNU_TYPE)
endif

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
CFARGSEXTRA += --without-copt
else
  ifneq (,$(filter $(DEB_HOST_ARCH), i386))
    CFARGSEXTRA += --without-copt
    export DEB_CFLAGS_MAINT_STRIP := -O2 -O3
    export DEB_CFLAGS_MAINT_PREPEND := -O1
  else
    CFARGSEXTRA += --with-copt
  endif
endif

ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
CFARGSEXTRA += --with-rtldebug
else
CFARGSEXTRA += --without-rtldebug
endif

# Temporary workaround for hppa linker issues
ifeq ($(DEB_BUILD_ARCH),hppa)
export DEB_CFLAGS_MAINT_APPEND += -ffunction-sections
endif

EXTRA_ARGS=

export DEB_CPPFLAGS_MAINT_APPEND := -DDEBIAN
export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed

DO_MACHINE_CODE=no
ifeq ($(DEB_HOST_ARCH),i386)
DO_MACHINE_CODE=yes
endif
ifeq ($(DEB_HOST_ARCH),powerpc)
DO_MACHINE_CODE=yes
endif
ifeq ($(DEB_BUILD_ARCH),sparc)
DO_MACHINE_CODE=no
endif

ifeq ($(DO_MACHINE_CODE),yes)
MACHINE_OPTS=--with-machine-code
else
MACHINE_OPTS=--without-machine-code
endif

#DEBVERSION:=$(shell dpkg-parsechangelog | sed -ne 's/Version: *\(.*\)-.*$$/\1/p')
DEBVERSION:=$(shell dpkg-parsechangelog | grep "Version:" | cut -d" " -f2 | cut -d"-" -f1)
MAJOR:=$(shell sed -ne 's/major://p' buildid.txt)
MINOR:=$(shell sed -ne 's/minor://p' buildid.txt)
BUILD:=$(shell sed -ne 's/build://p' buildid.txt)
PIKEV:=$(MAJOR).$(MINOR)
VERSION:=$(MAJOR).$(MINOR).$(BUILD)
PIKE:=pike$(PIKEV)

ifneq ($(VERSION),$(DEBVERSION))
$(error Version mismatch; buildid.txt: $(VERSION), debian/changelog: $(DEBVERSION))
endif

# --with-lib-path is just to stop configure from adding all the
# standard library directories with -L as well as -R to LDFLAGS
CFARGS=$(CFARGSEXTRA) \
       --with-cflags='`dpkg-buildflags --get CFLAGS`' \
       --with-cppflags='`dpkg-buildflags --get CPPFLAGS`' \
       --with-ldflags='`dpkg-buildflags --get LDFLAGS`' \
       --prefix=/usr \
       --with-bignums \
       --with-gmp \
       --with-poll \
       --with-zlib \
       --with-freetype \
       --without-ttflib \
       --with-libnettle \
       --without-sybase \
       --without-java \
       --with-odbc \
       --with-sane \
       --with-postgres \
       --with-postgres-include-dir=`pg_config --includedir` \
       --with-libpq-dir=/usr/lib \
       --without-ffmpeg \
       --without-fftw \
       --without-libpdf \
       --without-libpanda \
       --without-GTK \
       --with-GTK2 \
       --without-bundles \
       --without-oracle \
       --without-dvb \
       --with-sqlite \
       --disable-rpath \
       --disable-smartlink_binary \
       $(MACHINE_OPTS) $(EXTRA_ARGS)

include_prefix=/usr/include/pike$(PIKEV)/pike
lib_prefix=/usr/lib/pike$(PIKEV)

MODULE_PACKAGES=$(shell dh_listpackages -a -N $(PIKE)-core)
#{ADT,Array,Audio,Cache,Calendar,Calendar_I,COM,Colors,CommonLog,Crypto,Debug,Filesystem,Error,Float,Function,Geography,Getopt,Gettext,Gmp,Graphics,Gz,HTTPAccept,Int,Kerberos,Languages,Local,Locale,Mapping,Math,MIME,Mird,Multiset,Nettle,Parser,Pike,Pipe,Process,Program,Protocols,Regexp,Remote,SSL,Shuffler,Standards,Stdio,String,System,Thread,Tools,Unicode,Web,Yabu,Yp,_ADT,_Charset,_Roxen,___Gz,___MIME,___Math,___Mird,___Regexp,___Yp,____Charset,__builtin*,spider}.
#usr/lib/pike/*/modules/Sql.pmod/{module,Sql,rsql,sql_*}.*

excluded_modules:=Ssleay Mird Msql msql PDF Ffmpeg Oracle oracle sybase DVB Java TTF Gnome GDK GTKSupport ZXID
# This is tricky. Note that it's only possible for an exclusion to match the last
# component specified in an .install file or on the command line, and below.
DH_EXCLUDE:=$(addprefix -X,$(excluded_modules) README NEWS LICENSE CONTRIBUTING Makefile)
DH_ALREADY=`for p in $(MODULE_PACKAGES); do \
	      find debian/$$p/usr/lib/pike?.?/* -type f -printf "-X%P "; done`

TMP=$(CURDIR)/debian/tmp

#export CFLAGS CC PIKE VERSION
export CC

configure: configure-stamp
configure-stamp:
	dh_autoreconf src/run_autoconfig
	$(MAKE) force_configure CONFIGUREARGS="$(CFARGS)"
	touch configure-stamp

build-arch: build-arch-stamp
build-arch-stamp: configure
	dh_testdir
	$(MAKE) compile
	touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp: configure
	dh_testdir
	$(MAKE) documentation
	touch build-indep-stamp

build: build-arch build-indep

clean:
	dh_testdir
	dh_testroot
	$(MAKE) distclean
	rm -rf refdoc/modref refdoc/traditional_manual
	dh_autoreconf_clean
	dh_clean

install: build-arch
	dh_testdir
	dh_testroot
	dh_prep
	$(MAKE) INSTALLARGS=--traditional \
		buildroot=$(TMP) \
		prefix=/usr \
		man_prefix=/usr/share/man \
		lib_prefix="$(lib_prefix)" \
		include_prefix="$(include_prefix)" \
		pike_name=/usr/bin/$(PIKE) \
		install_nodoc

#	Some cleaning
	find "$(TMP)$(lib_prefix)" -name '.autodoc' -type f -exec rm -f '{}' ';'

	install -d -m755 $(TMP)/usr/share/pixmaps
	install -m644 debian/pike.xpm $(TMP)/usr/share/pixmaps/$(PIKE).xpm
	mv $(TMP)/usr/bin/pike $(TMP)/usr/bin/$(PIKE)
	mv $(TMP)/usr/share/man/man1/pike.1 $(TMP)/usr/share/man/man1/$(PIKE).1

#	Simply strip exec permissions and shebangs from all pike scripts.
	find $(TMP)/usr -type f '(' -name '*.p*' -o -name '*.h' ')' \
		-execdir chmod -x '{}' + \
		-execdir sed -rsi -e '1!b;/^#!/d' '{}' +

#	Install our own, simpler specs file.
	sed -e "s;@include_prefix@;$(include_prefix);g" \
	    -e "s;@CONFIGURE_ARGS@;$(CFARGS);g" \
	    debian/specs.in > $(TMP)$(include_prefix)/specs

#	Fix precompike.pike
	sed -i -e "s%\.\./lib%$(lib_prefix)%" $(TMP)$(include_prefix)/precompile.pike

# 	# pike -x module fix
#	sed -i -e 's;\$$(MODULE_BASE)/dynamic_module_makefile;\$$(PIKE_SRC_DIR)/modules/dynamic_module_makefile;g' \
#		$(TMP)$(include_prefix)/modules/dynamic_module_makefile

# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build-indep
	dh_testdir -i
	dh_testroot -i
	# install the docs
	dh_install -p$(PIKE)-doc -Ximages refdoc/traditional_manual/* usr/share/doc/$(PIKE)-doc/html/manual
	dh_install -p$(PIKE)-doc refdoc/modref/* usr/share/doc/$(PIKE)-doc/html/reference
	dh_link -p$(PIKE)-doc usr/share/doc/$(PIKE)-doc/html/reference/images usr/share/doc/$(PIKE)-doc/html/manual/images
	dh_install -i
	dh_installdocs -i
	dh_installchangelogs -i -k CHANGES
	dh_lintian -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build-arch install
	dh_testdir -a
	dh_testroot -a
	dh_install -a -N$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE)
	dh_install -p$(PIKE)-core --sourcedir=debian/tmp $(DH_EXCLUDE) $(DH_ALREADY)
	for p in $(MODULE_PACKAGES); do \
		sed "s/#PACKAGE#/$$p/" debian/prerm-snippet >> debian/$$p.prerm.debhelper; \
	done
	dh_installdocs -a --link-doc=$(PIKE)-core
	dh_installmenu -a
	dh_installchangelogs -a -k CHANGES
	dh_lintian -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a -X/run_autoconfig -X/precompile.sh -X/smartlink -X/fixdepends.sh -X/install_module -X/mktestsuite
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean build-indep build-arch binary binary-indep binary-arch install configure