]> git.saurik.com Git - wxWidgets.git/blame - debian/rules
Remove calls to a couple of deprecated methods, fix wxMotif build with
[wxWidgets.git] / debian / rules
CommitLineData
e4c4c1c6
RL
1#!/usr/bin/make -f
2# debian/rules file to build packages from wxWindows CVS source
3#
4# Sculpted 13/2/2000 by Ron Lee <ron@debian.org> from new and
5# variously stolen code :-)
f6bcfd97
BP
6# It makes copious use of the debhelper utilities written by
7# Joey Hess and others.
e4c4c1c6
RL
8
9#export DH_VERBOSE=1
10export DH_COMPAT=2
f6bcfd97 11export DH_OPTIONS
e4c4c1c6 12
e0a4aa8a 13release:=$(shell dpkg-parsechangelog | sed -n 's/^Source: wxwindows//p')
050207ec 14python_dir:=python$(shell python -c "import sys;print sys.version[:3]")
e4c4c1c6 15
3a922bb4
RL
16cross_host=i586-mingw32msvc
17cross_build=$(shell ./config.guess)
18
a0b03701
RL
19config_cache=../config_deb.cache
20config_cache_cross=../config_deb_cross.cache
21
e0a4aa8a 22# Packages to build:
5c0e67b2
RL
23package_wxbase_lib=libwxbase$(release)
24package_wxbase_dev=libwxbase$(release)-dev
f6bcfd97 25package_wxbase_dbg=libwxbase$(release)-dbg
e4c4c1c6
RL
26package_gtk_lib=libwxgtk$(release)
27package_gtk_dev=libwxgtk$(release)-dev
f6bcfd97 28package_gtk_dbg=libwxgtk$(release)-dbg
e0a4aa8a 29package_gtk_py=libwxgtk$(release)-python
f6bcfd97
BP
30package_gtk_contrib=libwxgtk$(release)-contrib
31package_gtk_contrib_dev=libwxgtk$(release)-contrib-dev
32package_headers=wxwin$(release)-headers
3ca6a5f0 33package_i18n=wxwin$(release)-i18n
e0a4aa8a 34package_doc=wxwin$(release)-doc
5c0e67b2 35package_examples=wxwin$(release)-examples
e4c4c1c6 36
7b7a7637
RL
37package_gtk_univ=libwxgtk$(release)-univ
38
3a922bb4 39package_wxbase_msw_dev=libwxbase-msw$(release)-dev
4fb788e4 40package_wxbase_msw_dbg=libwxbase-msw$(release)-dbg
3a922bb4 41package_msw_dev=libwxmsw$(release)-dev
4fb788e4 42package_msw_dbg=libwxmsw$(release)-dbg
3a922bb4
RL
43package_headers_msw=wxwin$(release)-headers-msw
44
e0a4aa8a 45# Build directories:
5c0e67b2
RL
46objdir_wxbase_shared=objs_wxbase_sh
47objdir_wxbase_static=objs_wxbase_st
f6bcfd97 48objdir_wxbase_debug=objs_wxbase_d
e4c4c1c6
RL
49objdir_gtk_shared=objs_gtk_sh
50objdir_gtk_static=objs_gtk_st
f6bcfd97 51objdir_gtk_debug=objs_gtk_d
e0a4aa8a
RL
52objdir_doc_cruft=objs_doc_con
53objdir_doc=docs/wxWindows-manual.html
5c0e67b2 54objdir_examples=docs/examples
3ca6a5f0 55objdir_i18n=locale
3a922bb4 56
7b7a7637 57objdir_gtk_univ=objs_gtk_univ
8155b640 58objdir_univ_install=objs_univ_install
7b7a7637 59
978f1259
RL
60objdir_wxbase_msw_shared=objs_wxbase_msw_sh
61objdir_wxbase_msw_static=objs_wxbase_msw_st
62objdir_wxbase_msw_dbg=objs_wxbase_msw_d
63objdir_msw_shared=objs_msw_sh
64objdir_msw_static=objs_msw_st
65objdir_msw_dbg=objs_msw_d
3a922bb4 66
f6bcfd97 67objdirs=$(objdir_wxbase_shared) $(objdir_wxbase_static) $(objdir_wxbase_debug) \
7b7a7637 68 $(objdir_gtk_shared) $(objdir_gtk_static) $(objdir_gtk_debug) $(objdir_gtk_univ) \
8155b640 69 $(objdir_univ_install) $(objdir_doc_cruft) $(objdir_doc) $(objdir_examples) \
978f1259
RL
70 $(objdir_wxbase_msw_shared) $(objdir_wxbase_msw_static) $(objdir_wxbase_msw_dbg) \
71 $(objdir_msw_shared) $(objdir_msw_static) $(objdir_msw_dbg)
e4c4c1c6 72
afa3e1ed
RL
73# note that the i18n package is actually arch indep (once built)
74# but must be built (and installed) during the arch any phase as
75# it's pulled out of the wxGtk shared lib package.
76
050207ec
RL
77# Build stamps:
78build_arch_stamps=build-wxbase-shared-stamp build-wxbase-static-stamp \
79 build-wxbase-debug-stamp build-gtk-shared-stamp \
80 build-gtk-static-stamp build-gtk-debug-stamp \
81 build-contrib-shared-stamp build-contrib-static-stamp \
afa3e1ed 82 build-gtk-py-stamp build-i18n-stamp
e4c4c1c6 83
0ecfbbea
RL
84# disable gtk-univ build, we'll replace it with x11-univ later.
85# build-gtk-univ-stamp
86
afa3e1ed 87build_indep_stamps=build-examples-stamp build-doc-stamp
f6bcfd97 88
978f1259
RL
89build_cross_stamps=build-wxbase-msw-shared-stamp build-wxbase-msw-static-stamp \
90 build-wxbase-msw-dbg-stamp build-msw-shared-stamp \
91 build-msw-static-stamp build-msw-dbg-stamp
3a922bb4
RL
92
93build_stamps_native=$(build_arch_stamps) $(build_indep_stamps)
94
95build_stamps=$(build_stamps_native) $(build_cross_stamps)
050207ec
RL
96
97# Install targets:
98install_all_arch=install-wxbase-lib install-wxbase-dev install-wxbase-dbg \
99 install-gtk-lib install-gtk-dev install-gtk-dbg \
100 install-gtk-contrib install-gtk-contrib-dev install-gtk-py \
afa3e1ed 101 install-headers install-i18n
050207ec 102
0ecfbbea
RL
103# disable gtk-univ build, we'll replace it with x11-univ later.
104# install-gtk-univ
105
afa3e1ed 106install_all_indep=install-examples install-doc
050207ec 107
4fb788e4 108install_all_cross=install-wxbase-msw-dev install-wxbase-msw-dbg install-msw-dev install-msw-dbg install-headers-msw
3a922bb4
RL
109
110install_all_native=$(install_all_arch) $(install_all_indep)
111
112install_all=$(install_all_native) $(install_all_cross)
e4c4c1c6
RL
113
114
afa3e1ed
RL
115wxconfig:=$(shell pwd)/$(objdir_gtk_shared)/wx-config \
116 --prefix=$(shell pwd) \
117 --exec-prefix=$(shell pwd)/$(objdir_gtk_shared)
118
119
e0a4aa8a
RL
120# The Rules:
121
e4c4c1c6
RL
122debian/control: debian/control.in
123 sed -e 's/=V/$(release)/g' < debian/control.in > debian/control
124
3a922bb4 125control-files-stamp: debian/control
f6bcfd97 126 dh_testdir
050207ec 127 @for f in dirs postinst; do \
f6bcfd97
BP
128 echo "generating control file $(package_wxbase_lib).$$f"; \
129 cp debian/libwxbase.$$f debian/$(package_wxbase_lib).$$f; \
130 done;
050207ec 131 @for f in dirs files links postinst prerm; do \
f6bcfd97 132 echo "generating control file $(package_wxbase_dev).$$f"; \
3a922bb4
RL
133 sed -e 's/=V/$(release)/g' < debian/libwxbase-dev.$$f \
134 > debian/$(package_wxbase_dev).$$f; \
f6bcfd97 135 done;
050207ec 136 @for f in dirs links postinst prerm; do \
f6bcfd97 137 echo "generating control file $(package_wxbase_dbg).$$f"; \
3a922bb4
RL
138 sed -e 's/=V/$(release)/g' < debian/libwxbase-dbg.$$f \
139 > debian/$(package_wxbase_dbg).$$f; \
f6bcfd97 140 done;
050207ec 141 @for f in dirs postinst; do \
f6bcfd97
BP
142 echo "generating control file $(package_gtk_lib).$$f"; \
143 cp debian/libwxgtk.$$f debian/$(package_gtk_lib).$$f; \
144 done;
050207ec 145 @for f in dirs files links postinst prerm; do \
f6bcfd97 146 echo "generating control file $(package_gtk_dev).$$f"; \
3a922bb4
RL
147 sed -e 's/=V/$(release)/g' < debian/libwxgtk-dev.$$f \
148 > debian/$(package_gtk_dev).$$f; \
f6bcfd97 149 done;
050207ec 150 @for f in dirs links postinst prerm; do \
f6bcfd97 151 echo "generating control file $(package_gtk_dbg).$$f"; \
3a922bb4
RL
152 sed -e 's/=V/$(release)/g' < debian/libwxgtk-dbg.$$f \
153 > debian/$(package_gtk_dbg).$$f; \
f6bcfd97 154 done;
094e328c 155 @for f in dirs docs files menu postinst prerm; do \
f6bcfd97 156 echo "generating control file $(package_gtk_py).$$f"; \
050207ec
RL
157 sed -e 's/=PY/$(python_dir)/g;s/=V/$(release)/g' < debian/libwxgtk-python.$$f \
158 > debian/$(package_gtk_py).$$f; \
f6bcfd97 159 done;
050207ec 160 @for f in dirs postinst; do \
f6bcfd97
BP
161 echo "generating control file $(package_gtk_contrib).$$f"; \
162 cp debian/libwxgtk-contrib.$$f debian/$(package_gtk_contrib).$$f; \
163 done;
050207ec 164 @for f in dirs files; do \
f6bcfd97
BP
165 echo "generating control file $(package_gtk_contrib_dev).$$f"; \
166 cp debian/libwxgtk-contrib-dev.$$f debian/$(package_gtk_contrib_dev).$$f; \
167 done;
050207ec 168 @for f in dirs files; do \
f6bcfd97
BP
169 echo "generating control file $(package_headers).$$f"; \
170 cp debian/wxwin-headers.$$f debian/$(package_headers).$$f; \
171 done;
050207ec 172 @for f in dirs files; do \
3ca6a5f0
BP
173 echo "generating control file $(package_i18n).$$f"; \
174 cp debian/wxwin-i18n.$$f debian/$(package_i18n).$$f; \
175 done;
f6bcfd97
BP
176 @for f in dirs docs doc-base; do \
177 echo "generating control file $(package_doc).$$f"; \
3a922bb4
RL
178 sed -e 's/=V/$(release)/g' < debian/wxwin-doc.$$f \
179 > debian/$(package_doc).$$f; \
f6bcfd97 180 done;
050207ec 181 @for f in examples; do \
f6bcfd97
BP
182 echo "generating control file $(package_examples).$$f"; \
183 cp debian/wxwin-examples.$$f debian/$(package_examples).$$f; \
184 done;
3a922bb4
RL
185 @for f in dirs links postinst prerm; do \
186 echo "generating control file $(package_wxbase_msw_dev).$$f"; \
187 sed -e 's/=V/$(release)/g;s/=H/$(cross_host)/g' < debian/libwxbase-msw-dev.$$f \
188 > debian/$(package_wxbase_msw_dev).$$f; \
189 done;
4fb788e4
RL
190 @for f in dirs links postinst prerm; do \
191 echo "generating control file $(package_wxbase_msw_dbg).$$f"; \
192 sed -e 's/=V/$(release)/g;s/=H/$(cross_host)/g' < debian/libwxbase-msw-dbg.$$f \
193 > debian/$(package_wxbase_msw_dbg).$$f; \
194 done;
3a922bb4
RL
195 @for f in dirs links postinst prerm; do \
196 echo "generating control file $(package_msw_dev).$$f"; \
197 sed -e 's/=V/$(release)/g;s/=H/$(cross_host)/g' < debian/libwxmsw-dev.$$f \
198 > debian/$(package_msw_dev).$$f; \
199 done;
4fb788e4
RL
200 @for f in dirs links postinst prerm; do \
201 echo "generating control file $(package_msw_dbg).$$f"; \
202 sed -e 's/=V/$(release)/g;s/=H/$(cross_host)/g' < debian/libwxmsw-dbg.$$f \
203 > debian/$(package_msw_dbg).$$f; \
204 done;
3a922bb4
RL
205 @for f in dirs; do \
206 echo "generating control file $(package_headers_msw).$$f"; \
207 sed -e 's/=H/$(cross_host)/g' < debian/wxwin-headers-msw.$$f \
208 > debian/$(package_headers_msw).$$f; \
209 done;
094e328c
RL
210 @for f in dirs links postinst prerm; do \
211 echo "generating control file $(package_gtk_univ).$$f"; \
212 sed -e 's/=V/$(release)/g' < debian/libwxgtk-univ.$$f \
213 > debian/$(package_gtk_univ).$$f; \
214 done;
f6bcfd97
BP
215 touch $@
216
050207ec 217build_arch: control-files-stamp $(build_arch_stamps)
3a922bb4 218build_all: control-files-stamp $(build_stamps_native)
3abb92ce 219
3a922bb4
RL
220# Really we should probably do nothing here until we know which
221# binary target is being called, but alpha builds were exploding
222# (compiler segfaults) in random places when building under fakeroot
223# from the binary-arch target. Build all -arch files here then, and
224# let the -indep stuff fend for itself later.
225
226build: build_arch
050207ec 227
e4c4c1c6 228
5c0e67b2
RL
229build-wxbase-shared-stamp:
230 dh_testdir
3a922bb4 231 mkdir -p $(objdir_wxbase_shared)
5c0e67b2 232 cd $(objdir_wxbase_shared) \
f6bcfd97 233 && ../configure --prefix=/usr \
a0b03701 234 --cache-file=$(config_cache) \
f6bcfd97 235 --disable-gui \
3a922bb4 236 --enable-soname \
f6bcfd97 237 --with-zlib=sys \
5c0e67b2
RL
238 && $(MAKE)
239 touch $@
240
241build-wxbase-static-stamp:
242 dh_testdir
3a922bb4 243 mkdir -p $(objdir_wxbase_static)
5c0e67b2 244 cd $(objdir_wxbase_static) \
f6bcfd97 245 && ../configure --prefix=/usr \
a0b03701 246 --cache-file=$(config_cache) \
f6bcfd97
BP
247 --disable-gui \
248 --disable-shared \
249 --with-zlib=sys \
250 && $(MAKE)
251 touch $@
252
253build-wxbase-debug-stamp:
254 dh_testdir
3a922bb4 255 mkdir -p $(objdir_wxbase_debug)
f6bcfd97
BP
256 cd $(objdir_wxbase_debug) \
257 && ../configure --prefix=/usr \
a0b03701 258 --cache-file=$(config_cache) \
f6bcfd97
BP
259 --disable-gui \
260 --enable-debug \
3a922bb4 261 --enable-soname \
f6bcfd97 262 --with-zlib=sys \
5c0e67b2
RL
263 && $(MAKE)
264 touch $@
265
e4c4c1c6
RL
266build-gtk-shared-stamp:
267 dh_testdir
3a922bb4 268 mkdir -p $(objdir_gtk_shared)
e4c4c1c6 269 cd $(objdir_gtk_shared) \
f6bcfd97 270 && ../configure --prefix=/usr \
a0b03701 271 --cache-file=$(config_cache) \
f6bcfd97
BP
272 --with-gtk \
273 --with-opengl \
3a922bb4 274 --enable-soname \
f6bcfd97
BP
275 --with-zlib=sys \
276 --with-libjpeg=sys \
277 --with-libpng=sys \
278 --with-libtiff=sys \
fdb59905 279 --enable-dynamic-loader \
e4c4c1c6
RL
280 && $(MAKE)
281 touch $@
282
283build-gtk-static-stamp:
284 dh_testdir
3a922bb4 285 mkdir -p $(objdir_gtk_static)
e4c4c1c6 286 cd $(objdir_gtk_static) \
f6bcfd97 287 && ../configure --prefix=/usr \
a0b03701 288 --cache-file=$(config_cache) \
f6bcfd97
BP
289 --with-gtk \
290 --with-opengl \
291 --disable-shared \
292 --with-zlib=sys \
293 --with-libjpeg=sys \
294 --with-libpng=sys \
295 --with-libtiff=sys \
fdb59905 296 --enable-dynamic-loader \
e4c4c1c6
RL
297 && $(MAKE)
298 touch $@
299
f6bcfd97
BP
300build-gtk-debug-stamp:
301 dh_testdir
3a922bb4 302 mkdir -p $(objdir_gtk_debug)
f6bcfd97
BP
303 cd $(objdir_gtk_debug) \
304 && ../configure --prefix=/usr \
a0b03701 305 --cache-file=$(config_cache) \
f6bcfd97
BP
306 --with-gtk \
307 --with-opengl \
308 --enable-debug \
3a922bb4 309 --enable-soname \
f6bcfd97
BP
310 --with-zlib=sys \
311 --with-libjpeg=sys \
312 --with-libpng=sys \
313 --with-libtiff=sys \
fdb59905 314 --enable-dynamic-loader \
f6bcfd97
BP
315 && $(MAKE)
316 touch $@
317
7b7a7637
RL
318build-gtk-univ-stamp:
319 dh_testdir
320 mkdir -p $(objdir_gtk_univ)
321 cd $(objdir_gtk_univ) \
322 && ../configure --prefix=/usr \
a0b03701 323 --cache-file=$(config_cache) \
7b7a7637
RL
324 --with-gtk \
325 --with-opengl \
326 --enable-universal \
327 --enable-soname \
328 --with-zlib=sys \
329 --with-libjpeg=sys \
330 --with-libpng=sys \
331 --with-libtiff=sys \
fdb59905 332 --enable-dynamic-loader \
7b7a7637
RL
333 && $(MAKE)
334 touch $@
335
f6bcfd97
BP
336build-contrib-shared-stamp: build-gtk-shared-stamp
337 dh_testdir
050207ec
RL
338 cd $(objdir_gtk_shared)/contrib/src \
339 && $(MAKE)
f6bcfd97
BP
340 touch $@
341
342build-contrib-static-stamp: build-gtk-static-stamp
343 dh_testdir
050207ec
RL
344 cd $(objdir_gtk_static)/contrib/src \
345 && $(MAKE)
f6bcfd97
BP
346 touch $@
347
050207ec 348build-gtk-py-stamp: build-gtk-shared-stamp
e0a4aa8a 349 dh_testdir
050207ec
RL
350 touch docs/lgpl.txt
351 cd wxPython \
afa3e1ed 352 && ./setup.py build IN_CVS_TREE=1 WX_CONFIG='$(wxconfig)'
e0a4aa8a
RL
353 touch $@
354
f538864d
RL
355build-doc-stamp: build-gtk-shared-stamp
356 dh_testdir
357 cd $(objdir_gtk_shared)/utils/tex2rtf/src \
e0a4aa8a
RL
358 && $(MAKE)
359 mkdir $(objdir_doc)
360 mkdir $(objdir_doc_cruft)
361 cd $(objdir_doc_cruft) \
3a922bb4 362 && LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib:$(LD_LIBRARY_PATH) \
e0a4aa8a 363 ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \
5c0e67b2 364 ../docs/latex/wx/manual.tex ../$(objdir_doc)/wxwin.htm -twice -html
e0a4aa8a
RL
365 cp docs/latex/wx/*.gif $(objdir_doc)
366 rm -rf $(objdir_doc_cruft)
367 rm -f $(objdir_doc)/wxwin.con $(objdir_doc)/wxwin.hh* \
368 $(objdir_doc)/wxwin.htx $(objdir_doc)/wxwin.ref
f538864d
RL
369 touch $@
370
3a922bb4 371build-examples-stamp: build-gtk-shared-stamp
5c0e67b2 372 dh_testdir
3a922bb4
RL
373 mkdir -p $(objdir_examples)
374
375 # copy all samples and the Makefile generated for libwxgtk.
5c0e67b2 376 cp -a samples $(objdir_examples)
3a922bb4
RL
377 rm -f $(objdir_examples)/samples/Makefile
378 cp -a $(objdir_gtk_shared)/samples/Makefile $(objdir_examples)/samples
379
5c0e67b2 380 cp -a demos $(objdir_examples)
f6bcfd97 381 cp -a wxPython/demo $(objdir_examples)/wxPython
5c0e67b2
RL
382 @for d in $(objdir_examples)/demos $(objdir_examples)/samples; do \
383 (cd $$d \
384 && mv Makefile.in Makefile \
385 && rm -f configure* \
386 && find -name 'Makefile.in' -exec rm -f '{}' ';' \
387 && for f in $$(find -type d); do \
388 if [ -f $$f/makefile.unx ]; then \
389 mv $$f/makefile.unx $$f/Makefile; \
390 fi; \
391 done) \
392 done;
393 touch $@
394
3ca6a5f0
BP
395build-i18n-stamp: build-gtk-shared-stamp
396 dh_testdir
54abcc91
RL
397
398 # touch .po files first, since if they are not already up
399 # to date then _now_ is not the time to fix it.
400 # That should have been been done before cvs was tagged.
3ca6a5f0 401 cd $(objdir_i18n) \
54abcc91 402 && touch *.po \
3ca6a5f0
BP
403 && $(MAKE) allmo
404 touch $@
405
978f1259 406build-wxbase-msw-shared-stamp:
3a922bb4 407 dh_testdir
978f1259
RL
408 mkdir -p $(objdir_wxbase_msw_shared)
409 cd $(objdir_wxbase_msw_shared) \
3a922bb4 410 && ../configure --prefix=/usr/$(cross_host) \
a0b03701 411 --cache-file=$(config_cache_cross) \
3a922bb4
RL
412 --host=$(cross_host) \
413 --build=$(cross_build) \
414 --disable-gui \
4fb788e4
RL
415 && $(MAKE)
416 touch $@
417
978f1259
RL
418build-wxbase-msw-static-stamp:
419 dh_testdir
420 mkdir -p $(objdir_wxbase_msw_static)
421 cd $(objdir_wxbase_msw_static) \
422 && ../configure --prefix=/usr/$(cross_host) \
423 --cache-file=$(config_cache_cross) \
424 --host=$(cross_host) \
425 --build=$(cross_build) \
426 --disable-gui \
427 --disable-shared \
428 && $(MAKE)
429 touch $@
430
431# Note this builds dll only, since wxmsw static debug is > 130MB !
4fb788e4
RL
432build-wxbase-msw-dbg-stamp:
433 dh_testdir
434 mkdir -p $(objdir_wxbase_msw_dbg)
435 cd $(objdir_wxbase_msw_dbg) \
436 && ../configure --prefix=/usr/$(cross_host) \
a0b03701 437 --cache-file=$(config_cache_cross) \
4fb788e4
RL
438 --host=$(cross_host) \
439 --build=$(cross_build) \
440 --disable-gui \
441 --enable-debug \
3a922bb4
RL
442 && $(MAKE)
443 touch $@
444
978f1259 445build-msw-shared-stamp:
3a922bb4 446 dh_testdir
978f1259
RL
447 mkdir -p $(objdir_msw_shared)
448 cd $(objdir_msw_shared) \
3a922bb4 449 && ../configure --prefix=/usr/$(cross_host) \
a0b03701 450 --cache-file=$(config_cache_cross) \
3a922bb4
RL
451 --host=$(cross_host) \
452 --build=$(cross_build) \
4fb788e4
RL
453 && $(MAKE)
454 touch $@
455
978f1259
RL
456build-msw-static-stamp:
457 dh_testdir
458 mkdir -p $(objdir_msw_static)
459 cd $(objdir_msw_static) \
460 && ../configure --prefix=/usr/$(cross_host) \
461 --cache-file=$(config_cache_cross) \
462 --host=$(cross_host) \
463 --build=$(cross_build) \
464 --disable-shared \
465 && $(MAKE)
466 touch $@
467
4fb788e4
RL
468build-msw-dbg-stamp:
469 dh_testdir
470 mkdir -p $(objdir_msw_dbg)
471 cd $(objdir_msw_dbg) \
472 && ../configure --prefix=/usr/$(cross_host) \
a0b03701 473 --cache-file=$(config_cache_cross) \
4fb788e4
RL
474 --host=$(cross_host) \
475 --build=$(cross_build) \
476 --enable-debug \
3a922bb4
RL
477 && $(MAKE)
478 touch $@
479
480
e4c4c1c6
RL
481clean: debian/control
482 dh_testdir
483 dh_testroot
54abcc91 484
978f1259 485 rm -rf config_deb.cache config_deb_cross.cache control-files-stamp $(build_stamps) $(objdirs)
050207ec 486 rm -f docs/lgpl.txt
54abcc91
RL
487 rm -f docs/latex/wx/manual.bb
488 rm -f $(objdir_i18n)/*.mo
489
490 cd wxPython \
54abcc91
RL
491 && rm -rf licence \
492 && rm -rf build \
0d7b3f0a 493 && rm -rf contrib/gizmos/contrib \
54abcc91
RL
494 && rm -rf contrib/ogl/contrib \
495 && rm -rf contrib/stc/contrib \
496 && rm -rf contrib/xrc/contrib \
497 && rm -rf *.pyc
498
0ecfbbea
RL
499# We do the equivalent of this above by removing build, unfortunately
500# its not enough by itself to get the tree properly clean again.
501# && ./setup.py clean
502
e4c4c1c6 503 dh_clean
5c0e67b2
RL
504 rm -f debian/$(package_wxbase_lib).*
505 rm -f debian/$(package_wxbase_dev).*
f6bcfd97 506 rm -f debian/$(package_wxbase_dbg).*
f538864d
RL
507 rm -f debian/$(package_gtk_lib).*
508 rm -f debian/$(package_gtk_dev).*
f6bcfd97 509 rm -f debian/$(package_gtk_dbg).*
e0a4aa8a 510 rm -f debian/$(package_gtk_py).*
f6bcfd97
BP
511 rm -f debian/$(package_gtk_contrib).*
512 rm -f debian/$(package_gtk_contrib_dev).*
513 rm -f debian/$(package_headers).*
3ca6a5f0 514 rm -f debian/$(package_i18n).*
f538864d 515 rm -f debian/$(package_doc).*
5c0e67b2 516 rm -f debian/$(package_examples).*
094e328c 517 rm -f debian/$(package_gtk_univ).*
3a922bb4 518 rm -f debian/$(package_wxbase_msw_dev).*
4fb788e4 519 rm -f debian/$(package_wxbase_msw_dbg).*
3a922bb4 520 rm -f debian/$(package_msw_dev).*
4fb788e4 521 rm -f debian/$(package_msw_dbg).*
3a922bb4 522 rm -f debian/$(package_headers_msw).*
e4c4c1c6 523
050207ec
RL
524install_arch: build_arch $(install_all_arch)
525
3a922bb4 526install: build_all $(install_all_native)
f6bcfd97
BP
527
528install-wxbase-lib: DH_OPTIONS=-p$(package_wxbase_lib)
529install-wxbase-lib: build-wxbase-shared-stamp
e0a4aa8a
RL
530 dh_testdir
531 dh_testroot
e4c4c1c6
RL
532 dh_clean -k
533 dh_installdirs
f6bcfd97 534 cp -a $(objdir_wxbase_shared)/lib/* debian/$(package_wxbase_lib)/usr/lib
3a922bb4 535 cp $(objdir_wxbase_shared)/wxbase-$(release)-config debian/$(package_wxbase_lib)/usr/bin/
f6bcfd97
BP
536
537install-wxbase-dev: DH_OPTIONS=-p$(package_wxbase_dev)
538install-wxbase-dev: build-wxbase-static-stamp install-wxbase-lib
539 dh_testdir
540 dh_testroot
541 dh_clean -k
542 dh_installdirs
543 dh_movefiles --sourcedir=debian/$(package_wxbase_lib)
544 cp $(objdir_wxbase_static)/lib/*.a debian/$(package_wxbase_dev)/usr/lib
545
546install-wxbase-dbg: DH_OPTIONS=-p$(package_wxbase_dbg)
547install-wxbase-dbg: build-wxbase-debug-stamp
548 dh_testdir
549 dh_testroot
550 dh_clean -k
551 dh_installdirs
552 cp -a $(objdir_wxbase_debug)/lib/* debian/$(package_wxbase_dbg)/usr/lib
3a922bb4 553 cp $(objdir_wxbase_debug)/wxbased-$(release)-config debian/$(package_wxbase_dbg)/usr/bin/
050207ec 554 cp debian/lintian-override debian/$(package_wxbase_dbg)/usr/share/lintian/overrides/$(package_wxbase_dbg)
f6bcfd97
BP
555
556install-gtk-lib: DH_OPTIONS=-p$(package_gtk_lib)
557install-gtk-lib: build-gtk-shared-stamp
558 dh_testdir
559 dh_testroot
560 dh_clean -k
561 dh_installdirs
e4c4c1c6 562 cd $(objdir_gtk_shared) \
f6bcfd97
BP
563 && $(MAKE) install prefix=`pwd`/../debian/$(package_gtk_lib)/usr
564 rm -f debian/$(package_gtk_lib)/usr/bin/wx-config
e4c4c1c6 565
f6bcfd97
BP
566install-gtk-dev: DH_OPTIONS=-p$(package_gtk_dev)
567install-gtk-dev: build-gtk-static-stamp install-gtk-lib
568 dh_testdir
569 dh_testroot
570 dh_clean -k
571 dh_installdirs
572 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
2b5f62a0
VZ
573 cp $(objdir_gtk_static)/lib/libwx_gtk-*.a debian/$(package_gtk_dev)/usr/lib
574 cp $(objdir_gtk_static)/lib/libwx_gtk_gl-*.a debian/$(package_gtk_dev)/usr/lib
e4c4c1c6 575
f6bcfd97
BP
576install-gtk-dbg: DH_OPTIONS=-p$(package_gtk_dbg)
577install-gtk-dbg: build-gtk-debug-stamp
578 dh_testdir
579 dh_testroot
580 dh_clean -k
581 dh_installdirs
582 cp -a $(objdir_gtk_debug)/lib/* debian/$(package_gtk_dbg)/usr/lib
3a922bb4 583 cp $(objdir_gtk_debug)/wxgtkd-$(release)-config debian/$(package_gtk_dbg)/usr/bin/
050207ec 584 cp debian/lintian-override debian/$(package_gtk_dbg)/usr/share/lintian/overrides/$(package_gtk_dbg)
e4c4c1c6 585
7b7a7637
RL
586install-gtk-univ: DH_OPTIONS=-p$(package_gtk_univ)
587install-gtk-univ: build-gtk-univ-stamp
588 dh_testdir
589 dh_testroot
590 dh_clean -k
591 dh_installdirs
592 cp -a $(objdir_gtk_univ)/lib/* debian/$(package_gtk_univ)/usr/lib
593 cp $(objdir_gtk_univ)/wxgtkuniv-$(release)-config debian/$(package_gtk_univ)/usr/bin/
f1687ed8 594 cp debian/lintian-override debian/$(package_gtk_univ)/usr/share/lintian/overrides/$(package_gtk_univ)
7b7a7637 595
f6bcfd97
BP
596install-gtk-contrib: DH_OPTIONS=-p$(package_gtk_contrib)
597install-gtk-contrib: build-contrib-shared-stamp
e4c4c1c6
RL
598 dh_testdir
599 dh_testroot
f6bcfd97
BP
600 dh_clean -k
601 dh_installdirs
602 cd $(objdir_gtk_shared)/contrib/src \
603 && $(MAKE) install prefix=`pwd`/../../../debian/$(package_gtk_contrib)/usr
604
605install-gtk-contrib-dev: DH_OPTIONS=-p$(package_gtk_contrib_dev)
606install-gtk-contrib-dev: build-contrib-static-stamp install-gtk-dev
607 dh_testdir
608 dh_testroot
609 dh_clean -k
610 dh_installdirs
611 dh_movefiles --sourcedir=debian/$(package_gtk_contrib)
612 cp $(objdir_gtk_static)/lib/*.a debian/$(package_gtk_contrib_dev)/usr/lib
2b5f62a0
VZ
613 rm -f debian/$(package_gtk_contrib_dev)/usr/lib/libwx_gtk-*.a
614 rm -f debian/$(package_gtk_contrib_dev)/usr/lib/libwx_gtk_gl-*.a
f6bcfd97
BP
615
616install-gtk-py: DH_OPTIONS=-p$(package_gtk_py)
050207ec 617install-gtk-py: build-gtk-py-stamp
f6bcfd97
BP
618 dh_testdir
619 dh_testroot
620 dh_clean -k
621 dh_installdirs
050207ec 622 cd wxPython \
0ecfbbea
RL
623 && ./setup.py install \
624 --prefix=`pwd`/../debian/$(package_gtk_py)/usr \
625 WX_CONFIG='$(wxconfig)'
050207ec 626 find debian/$(package_gtk_py)/usr/lib/$(python_dir)/site-packages/wxPython \
f6bcfd97
BP
627 -name '*.py?' -exec rm '{}' ';'
628
0ecfbbea
RL
629 dh_installman debian/wxPython-tools.1
630 dh_link usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2py.1 \
631 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2xpm.1 \
632 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2png.1 \
633 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pycrust.1 \
634 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyshell.1 \
635 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/xrced.1 \
636 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/helpviewer.1
637
f6bcfd97
BP
638install-headers: DH_OPTIONS=-p$(package_headers)
639install-headers: install-gtk-lib
640 dh_testdir
641 dh_testroot
642 dh_clean -k
643 dh_installdirs
8155b640
RL
644
645# The only way to be really sure we get the univ headers correct is to install
646# them. Do that in a scratch dirs, and move the gtk ones last, so at least
647# they win in the result of any uncaught conflict.
648
0ecfbbea
RL
649# cd $(objdir_gtk_univ) \
650# && $(MAKE) install prefix=`pwd`/../$(objdir_univ_install)/usr
8155b640 651
0ecfbbea 652# dh_movefiles --sourcedir=$(objdir_univ_install)
f6bcfd97 653 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
8155b640 654
0ecfbbea 655 dh_installman debian/wx-config.1
f6bcfd97 656
3ca6a5f0
BP
657install-i18n: DH_OPTIONS=-p$(package_i18n)
658install-i18n: build-i18n-stamp install-gtk-lib
659 dh_testdir
660 dh_testroot
661 dh_clean -k
662 dh_installdirs
663 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
664
f6bcfd97
BP
665install-doc: DH_OPTIONS=-p$(package_doc)
666install-doc: build-doc-stamp
667 dh_testdir
668 dh_testroot
669 dh_clean -k
670 dh_installdirs
671
672install-examples: DH_OPTIONS=-p$(package_examples)
673install-examples: build-examples-stamp
674 dh_testdir
675 dh_testroot
676 dh_clean -k
677 dh_installdirs
678
3a922bb4 679install-wxbase-msw-dev: DH_OPTIONS=-p$(package_wxbase_msw_dev)
978f1259 680install-wxbase-msw-dev: build-wxbase-msw-shared-stamp build-wxbase-msw-static-stamp
3a922bb4
RL
681 dh_testdir
682 dh_testroot
683 dh_clean -k
684 dh_installdirs
978f1259
RL
685 cp -a $(objdir_wxbase_msw_shared)/lib/* debian/$(package_wxbase_msw_dev)/usr/$(cross_host)/lib
686 cp -a $(objdir_wxbase_msw_static)/lib/*.a debian/$(package_wxbase_msw_dev)/usr/$(cross_host)/lib
687 cp $(objdir_wxbase_msw_shared)/wxbase-$(release)-$(cross_host)-config debian/$(package_wxbase_msw_dev)/usr/bin/
3a922bb4
RL
688 $(cross_host)-strip --strip-debug debian/$(package_wxbase_msw_dev)/usr/$(cross_host)/lib/*.a
689
4fb788e4
RL
690install-wxbase-msw-dbg: DH_OPTIONS=-p$(package_wxbase_msw_dbg)
691install-wxbase-msw-dbg: build-wxbase-msw-dbg-stamp
692 dh_testdir
693 dh_testroot
694 dh_clean -k
695 dh_installdirs
696 cp -a $(objdir_wxbase_msw_dbg)/lib/* debian/$(package_wxbase_msw_dbg)/usr/$(cross_host)/lib
a0b03701 697 cp $(objdir_wxbase_msw_dbg)/wxbased-$(release)-$(cross_host)-config debian/$(package_wxbase_msw_dbg)/usr/bin/
978f1259
RL
698 # No static lib, they're freakin' huge!
699 #$(cross_host)-strip --strip-debug debian/$(package_wxbase_msw_dbg)/usr/$(cross_host)/lib/*.a
4fb788e4 700
3a922bb4 701install-msw-dev: DH_OPTIONS=-p$(package_msw_dev)
978f1259 702install-msw-dev: build-msw-shared-stamp build-msw-static-stamp
3a922bb4
RL
703 dh_testdir
704 dh_testroot
705 dh_clean -k
706 dh_installdirs
978f1259
RL
707 cp -a $(objdir_msw_shared)/lib/* debian/$(package_msw_dev)/usr/$(cross_host)/lib
708 cp -a $(objdir_msw_static)/lib/*.a debian/$(package_msw_dev)/usr/$(cross_host)/lib
709 cp $(objdir_msw_shared)/wxmsw-$(release)-$(cross_host)-config debian/$(package_msw_dev)/usr/bin/
3a922bb4
RL
710 $(cross_host)-strip --strip-debug debian/$(package_msw_dev)/usr/$(cross_host)/lib/*.a
711
4fb788e4
RL
712install-msw-dbg: DH_OPTIONS=-p$(package_msw_dbg)
713install-msw-dbg: build-msw-dbg-stamp
714 dh_testdir
715 dh_testroot
716 dh_clean -k
717 dh_installdirs
718 cp -a $(objdir_msw_dbg)/lib/* debian/$(package_msw_dbg)/usr/$(cross_host)/lib
a0b03701 719 cp $(objdir_msw_dbg)/wxmswd-$(release)-$(cross_host)-config debian/$(package_msw_dbg)/usr/bin/
978f1259
RL
720 # No static lib, they're freakin' huge!
721 #$(cross_host)-strip --strip-debug debian/$(package_msw_dbg)/usr/$(cross_host)/lib/*.a
4fb788e4 722
3a922bb4
RL
723install-headers-msw: DH_OPTIONS=-p$(package_headers_msw)
724install-headers-msw:
725 dh_testdir
726 dh_testroot
727 dh_clean -k
728 dh_installdirs
729 @# Symlink all the headers that will be installed by the main -headers
730 @# package to where the cross compiler will expect them.
731 @for f in `ls -1 include/wx`; do \
732 ln -s /usr/include/wx/$$f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx; \
733 echo "linking header /usr/include/wx/$$f"; \
734 done;
735 @# But install this lot for real.
736 rm -f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx/msw
737 cp -a include/wx/msw debian/$(package_headers_msw)/usr/$(cross_host)/include/wx
738 @# and remove this cruft(?)
739 rm -f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx/treelay.h
740
741
f6bcfd97 742binary-common:
f6bcfd97
BP
743 dh_testdir
744 dh_testroot
745 dh_installdocs
5c0e67b2
RL
746 dh_installchangelogs
747 dh_installexamples
8155b640 748 dh_installmenu
5c0e67b2 749 dh_link
3a922bb4
RL
750
751 @# Don't strip debug libs at all, and strip cross libs elsewhere
752 @# with the cross host tools until dh_strip gets smarter.
174d5c21
RL
753 dh_strip -N$(package_gtk_dbg) -N$(package_wxbase_dbg) \
754 -N$(package_wxbase_msw_dev) -N$(package_wxbase_msw_dbg) \
755 -N$(package_msw_dev) -N$(package_msw_dbg)
3a922bb4 756
e4c4c1c6
RL
757 dh_compress
758 dh_fixperms
afa3e1ed 759 dh_makeshlibs -N$(package_gtk_py) -V
e4c4c1c6 760 dh_installdeb
050207ec 761 dh_shlibdeps -ldebian/$(package_gtk_lib)/usr/lib
e4c4c1c6
RL
762 dh_gencontrol
763 dh_md5sums
764 dh_builddeb
765
f6bcfd97 766# Build architecture-independent files here.
050207ec
RL
767# Note that you currently can't build the indep packages without first
768# building the arch specific package files needed to create them.
3abb92ce 769binary-indep: build_all install
3a922bb4 770 $(MAKE) -f debian/rules \
0ecfbbea 771 DH_OPTIONS="-i -N$(package_wxbase_msw_dev) -N$(package_wxbase_msw_dbg) -N$(package_msw_dev) -N$(package_msw_dbg) -N$(package_headers_msw) -N$(package_gtk_univ)" \
a0b03701 772 binary-common
f6bcfd97 773
050207ec
RL
774# Build just the architecture-dependent files here.
775binary-arch: build_arch install_arch
3a922bb4 776 $(MAKE) -f debian/rules \
0ecfbbea 777 DH_OPTIONS="-a -N$(package_wxbase_msw_dev) -N$(package_wxbase_msw_dbg) -N$(package_msw_dev) -N$(package_msw_dbg) -N$(package_headers_msw) -N$(package_gtk_univ)" \
a0b03701 778 binary-common
f6bcfd97
BP
779
780# Build all packages target.
781binary: binary-arch binary-indep
782
3a922bb4
RL
783# This is a special target for building the wxMSW-cross packages.
784# It's not currently called during the official package build run
785# but may be run separately to build the extra packages.
786# There is an implied build dep on the mingw32 cross compiler
787# that is not in the control file.
788binary-cross: control-files-stamp $(install_all_cross)
789 $(MAKE) -f debian/rules \
a0b03701
RL
790 DH_OPTIONS="-p$(package_wxbase_msw_dev) -p$(package_wxbase_msw_dbg) -p$(package_msw_dev) -p$(package_msw_dbg) -p$(package_headers_msw)" \
791 binary-common
3a922bb4 792
f6bcfd97
BP
793
794############################################################################
795#
796# Some rules to build a subset of the complete list of packages that can be
797# built from CVS. Beware that packages produced with these rules may *NOT*
798# be compatible with packages built using the 'binary' target or even with
799# Debian policy. Do not distribute packages built with these rules, they
800# are currently useful for rapid in-house testing by developers only.
801
802# libwxgtk shared lib package
803binary-gtk: control-files-stamp install-gtk-lib install-headers
804 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_lib) -p$(package_headers)" binary-common
805
806binary-gtk-dev: control-files-stamp install-gtk-dev install-headers
807 $(MAKE) -f debian/rules \
808 DH_OPTIONS="-p$(package_gtk_lib) -p$(package_gtk_dev) -p$(package_headers)" \
809 binary-common
810
811binary-gtk-dbg: control-files-stamp install-gtk-dbg install-headers
812 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg) -p$(package_headers)" binary-common
813
814# libwxbase shared lib package
815binary-wxbase: control-files-stamp install-wxbase-lib install-headers
816 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_wxbase_lib) -p$(package_headers)" binary-common
817
818binary-wxbase-dev: control-files-stamp install-wxbase-dev install-headers
819 $(MAKE) -f debian/rules \
820 DH_OPTIONS="-p$(package_wxbase_lib) -p$(package_wxbase_dev) -p$(package_headers)" \
821 binary-common
822
823binary-wxbase-dbg: control-files-stamp install-wxbase-dbg install-headers
824 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_wxbase_dbg) -p$(package_headers)" binary-common
825
7b7a7637
RL
826binary-univ: control-files-stamp install-gtk-univ
827 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_univ)" binary-common
828
f6bcfd97
BP
829# docs package
830binary-doc: control-files-stamp install-doc
831 $(MAKE) -f debian/rules DH_OPTIONS=-p$(package_doc) binary-common
832
76314141
RL
833binary-fast:control-files-stamp install-gtk-dbg install-msw-dev install-headers install-headers-msw
834 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg) -p$(package_msw_dev) -p$(package_headers) -p$(package_headers_msw)" binary-common
835
f6bcfd97 836
3abb92ce 837.PHONY: build build_all build_arch clean binary-indep binary-arch binary binary-common \
050207ec 838 binary-gtk binary-gtk-dev binary-gtk-dbg binary-wxbase binary-wxbase-dev \
3a922bb4
RL
839 binary-wxbase-dbg binary-doc binary-cross \
840 install install_arch install-wxbase-lib \
050207ec
RL
841 install-wxbase-dev install-wxbase-dbg install-gtk-lib install-gtk-dev \
842 install-gtk-dbg install-gtk-contrib install-gtk-contrib-dev \
3a922bb4 843 install-gtk-py install-headers install-i18n install-doc install-examples \
4fb788e4
RL
844 install-wxbase-msw-dev install-msw-dev install-headers-msw \
845 install-wxbase-msw-dbg install-msw-dbg
f6bcfd97 846