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