]> git.saurik.com Git - wxWidgets.git/blame - debian/rules
patch from Paul Gammans <paul.gammans@brunel.ac.uk> for cross compiling for MSW
[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 :-)
6# (including a debhelper template, GNU copyright 1997 to 1999 by
7# Joey Hess, and some ideas found in the ncurses rules file that
e0a4aa8a 8# I quite liked. Thanks!)
e4c4c1c6
RL
9
10#export DH_VERBOSE=1
11export DH_COMPAT=2
12
e0a4aa8a 13release:=$(shell dpkg-parsechangelog | sed -n 's/^Source: wxwindows//p')
e4c4c1c6 14
e0a4aa8a 15# Packages to build:
5c0e67b2
RL
16package_wxbase_lib=libwxbase$(release)
17package_wxbase_dev=libwxbase$(release)-dev
e4c4c1c6
RL
18package_gtk_lib=libwxgtk$(release)
19package_gtk_dev=libwxgtk$(release)-dev
e0a4aa8a
RL
20package_gtk_py=libwxgtk$(release)-python
21package_doc=wxwin$(release)-doc
5c0e67b2 22package_examples=wxwin$(release)-examples
e4c4c1c6 23
e0a4aa8a 24# Build directories:
5c0e67b2
RL
25objdir_wxbase_shared=objs_wxbase_sh
26objdir_wxbase_static=objs_wxbase_st
e4c4c1c6
RL
27objdir_gtk_shared=objs_gtk_sh
28objdir_gtk_static=objs_gtk_st
e0a4aa8a
RL
29objdir_doc_cruft=objs_doc_con
30objdir_doc=docs/wxWindows-manual.html
5c0e67b2
RL
31objdir_examples=docs/examples
32objdirs=$(objdir_wxbase_shared) $(objdir_wxbase_static) $(objdir_gtk_shared) \
33 $(objdir_gtk_static) $(objdir_doc) $(objdir_examples)
e4c4c1c6 34
5c0e67b2
RL
35build_stamps=build-wxbase-shared-stamp build-wxbase-static-stamp \
36 build-gtk-shared-stamp build-gtk-static-stamp \
37 build-gtk-python-stamp build-examples-stamp build-doc-stamp
e4c4c1c6 38
e0a4aa8a
RL
39wxconfig:=$(shell pwd)/$(objdir_gtk_shared)/wx-config \
40 --prefix=$(shell pwd) \
41 --exec-prefix=$(shell pwd)/$(objdir_gtk_shared)
e4c4c1c6
RL
42
43
e0a4aa8a
RL
44# The Rules:
45
e4c4c1c6
RL
46debian/control: debian/control.in
47 sed -e 's/=V/$(release)/g' < debian/control.in > debian/control
48
e0a4aa8a
RL
49debian/wxwin-doc.doc-base: debian/wxwin-doc.doc-base.in
50 sed -e 's/=V/$(release)/g' < debian/wxwin-doc.doc-base.in > debian/wxwin-doc.doc-base
51
52build: debian/control debian/wxwin-doc.doc-base $(build_stamps)
e4c4c1c6 53
5c0e67b2
RL
54build-wxbase-shared-stamp:
55 dh_testdir
56 mkdir $(objdir_wxbase_shared)
57 cd $(objdir_wxbase_shared) \
58 && ../configure --prefix=/usr --disable-gui --enable-burnt_name \
59 && $(MAKE)
60 touch $@
61
62build-wxbase-static-stamp:
63 dh_testdir
64 mkdir $(objdir_wxbase_static)
65 cd $(objdir_wxbase_static) \
66 && ../configure --prefix=/usr --disable-gui --disable-shared \
67 && $(MAKE)
68 touch $@
69
e4c4c1c6
RL
70build-gtk-shared-stamp:
71 dh_testdir
72 mkdir $(objdir_gtk_shared)
73 cd $(objdir_gtk_shared) \
e0a4aa8a 74 && ../configure --prefix=/usr --with-gtk --enable-burnt_name --disable-newgrid \
e4c4c1c6
RL
75 && $(MAKE)
76 touch $@
77
78build-gtk-static-stamp:
79 dh_testdir
80 mkdir $(objdir_gtk_static)
81 cd $(objdir_gtk_static) \
82 && ../configure --prefix=/usr --with-gtk --disable-shared \
83 && $(MAKE)
84 touch $@
85
e0a4aa8a
RL
86build-gtk-python-stamp: build-gtk-shared-stamp
87 dh_testdir
88 cd utils/wxPython/src \
89 && touch gtk/*.cpp gtk/*.py \
90 && ../distrib/build.py -b WXDIR=../../.. WXCONFIG='$(wxconfig)'
91 cd utils/wxPython/modules/html \
92 && ../../distrib/build.py -b WXDIR=../../../.. WXCONFIG='$(wxconfig)'
93 cd utils/wxPython/modules/utils \
94 && ../../distrib/build.py -b WXDIR=../../../.. WXCONFIG='$(wxconfig)'
95 touch $@
96
f538864d
RL
97build-doc-stamp: build-gtk-shared-stamp
98 dh_testdir
99 cd $(objdir_gtk_shared)/utils/tex2rtf/src \
e0a4aa8a
RL
100 && $(MAKE)
101 mkdir $(objdir_doc)
102 mkdir $(objdir_doc_cruft)
103 cd $(objdir_doc_cruft) \
104 && LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib \
105 ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \
5c0e67b2 106 ../docs/latex/wx/manual.tex ../$(objdir_doc)/wxwin.htm -twice -html
e0a4aa8a
RL
107 cp docs/latex/wx/*.gif $(objdir_doc)
108 rm -rf $(objdir_doc_cruft)
109 rm -f $(objdir_doc)/wxwin.con $(objdir_doc)/wxwin.hh* \
110 $(objdir_doc)/wxwin.htx $(objdir_doc)/wxwin.ref
f538864d
RL
111 touch $@
112
5c0e67b2
RL
113build-examples-stamp:
114 dh_testdir
115 mkdir $(objdir_examples)
116 cp -a samples $(objdir_examples)
117 cp -a demos $(objdir_examples)
118 cp -a utils/wxPython/demo $(objdir_examples)/wxPython
119 @for d in $(objdir_examples)/demos $(objdir_examples)/samples; do \
120 (cd $$d \
121 && mv Makefile.in Makefile \
122 && rm -f configure* \
123 && find -name 'Makefile.in' -exec rm -f '{}' ';' \
124 && for f in $$(find -type d); do \
125 if [ -f $$f/makefile.unx ]; then \
126 mv $$f/makefile.unx $$f/Makefile; \
127 fi; \
128 done) \
129 done;
130 touch $@
131
e4c4c1c6
RL
132clean: debian/control
133 dh_testdir
134 dh_testroot
f538864d 135 rm -rf $(build_stamps) $(objdirs)
e0a4aa8a
RL
136 -cd utils/wxPython/src && $(MAKE) clean
137 -cd utils/wxPython/modules/html && $(MAKE) clean
138 -cd utils/wxPython/modules/utils && $(MAKE) clean
e4c4c1c6 139 dh_clean
5c0e67b2
RL
140 rm -f debian/$(package_wxbase_lib).*
141 rm -f debian/$(package_wxbase_dev).*
f538864d
RL
142 rm -f debian/$(package_gtk_lib).*
143 rm -f debian/$(package_gtk_dev).*
e0a4aa8a 144 rm -f debian/$(package_gtk_py).*
f538864d 145 rm -f debian/$(package_doc).*
5c0e67b2 146 rm -f debian/$(package_examples).*
e4c4c1c6
RL
147
148install: build
e0a4aa8a
RL
149 dh_testdir
150 dh_testroot
5c0e67b2
RL
151 @for f in dirs docs files postinst; do \
152 echo "generating control file $(package_wxbase_lib).$$f"; \
153 cp debian/libwxbase.$$f debian/$(package_wxbase_lib).$$f; \
154 done;
07eb77a6 155 @for f in dirs docs files links postinst prerm; do \
5c0e67b2
RL
156 echo "generating control file $(package_wxbase_dev).$$f"; \
157 cp debian/libwxbase-dev.$$f debian/$(package_wxbase_dev).$$f; \
158 done;
e4c4c1c6
RL
159 @for f in dirs docs files postinst; do \
160 echo "generating control file $(package_gtk_lib).$$f"; \
161 cp debian/libwxgtk.$$f debian/$(package_gtk_lib).$$f; \
162 done;
07eb77a6 163 @for f in dirs docs files links postinst prerm; do \
e4c4c1c6
RL
164 echo "generating control file $(package_gtk_dev).$$f"; \
165 cp debian/libwxgtk-dev.$$f debian/$(package_gtk_dev).$$f; \
166 done;
e0a4aa8a
RL
167 @for f in dirs docs files postinst prerm; do \
168 echo "generating control file $(package_gtk_py).$$f"; \
169 cp debian/libwxgtk-python.$$f debian/$(package_gtk_py).$$f; \
170 done;
f538864d
RL
171 @for f in dirs docs doc-base; do \
172 echo "generating control file $(package_doc).$$f"; \
e0a4aa8a 173 cp debian/wxwin-doc.$$f debian/$(package_doc).$$f; \
f538864d 174 done;
5c0e67b2
RL
175 @for f in docs examples; do \
176 echo "generating control file $(package_examples).$$f"; \
177 cp debian/wxwin-examples.$$f debian/$(package_examples).$$f; \
178 done;
e4c4c1c6
RL
179 dh_clean -k
180 dh_installdirs
181 cd $(objdir_gtk_shared) \
182 && $(MAKE) install prefix=`pwd`/../debian/tmp/usr
07eb77a6 183 rm -f debian/tmp/usr/bin/wx-config
e4c4c1c6 184 cp $(objdir_gtk_static)/lib/*.a debian/tmp/usr/lib
5c0e67b2 185 cp -a $(objdir_wxbase_shared)/lib/* debian/tmp/usr/lib
07eb77a6 186 cp $(objdir_wxbase_shared)/wxbase-config debian/tmp/usr/bin/
5c0e67b2 187 cp $(objdir_wxbase_static)/lib/*.a debian/tmp/usr/lib
e0a4aa8a
RL
188 cd utils/wxPython/src \
189 && ../distrib/build.py -i \
190 TARGETDIR=../../../debian/tmp/usr/lib/python1.5/site-packages/wxPython \
191 HELPERLIBDIR=../../../debian/tmp/usr/lib \
192 WXDIR=../../..
193 cd utils/wxPython/modules/html \
194 && ../../distrib/build.py -i \
195 TARGETDIR=../../../../debian/tmp/usr/lib/python1.5/site-packages/wxPython \
196 WXDIR=../../../..
197 cd utils/wxPython/modules/utils \
198 && ../../distrib/build.py -i \
199 TARGETDIR=../../../../debian/tmp/usr/lib/python1.5/site-packages/wxPython \
200 WXDIR=../../../..
5c0e67b2 201 rm -rf debian/tmp/usr/lib/python1.5/site-packages/wxPython/demo
e0a4aa8a
RL
202 find debian/tmp/usr/lib/python1.5/site-packages/wxPython \
203 -name '*.py?' -exec rm '{}' ';'
e4c4c1c6
RL
204 dh_movefiles
205
206
207# Build architecture-independent files here.
208binary-indep: build install
209# nothing to do.
210
211# Build architecture-dependent files here.
212binary-arch: build install
213 dh_testdir
214 dh_testroot
215 dh_installdocs
216 dh_installmanpages -p$(package_gtk_dev) \
217 ansi2knr.1 \
218 jpegtran.1 \
219 libpng.3 \
220 libpngpf.3 \
221 zlib.3 \
222 png.5
5c0e67b2
RL
223 dh_installchangelogs
224 dh_installexamples
225 dh_link
e4c4c1c6
RL
226 dh_strip
227 dh_compress
228 dh_fixperms
229 dh_makeshlibs
230 dh_installdeb
e0a4aa8a 231 dh_shlibdeps -ldebian/$(package_gtk_lib)/usr/lib:debian/$(package_gtk_py)/usr/lib
e4c4c1c6
RL
232 dh_gencontrol
233 dh_md5sums
234 dh_builddeb
235
236binary: binary-indep binary-arch
237.PHONY: build clean binary-indep binary-arch binary install