]> git.saurik.com Git - wxWidgets.git/blame - distrib/msw/makedist.sh
Updated projects/makefiles
[wxWidgets.git] / distrib / msw / makedist.sh
CommitLineData
1192d9ec 1#! /bin/bash
1620f478
JS
2# makedist.sh
3#
4# Build wxWindows 2 for Windows distribution.
5# This builds all required binaries and documents before calling
6# zipdist.sh to make the archives.
7#
8# To use this script, you need:
9#
10# - CygWin installation, for bash etc.
11# - VC++ 6 or higher, to compile the binaries
12# - WinHelp compiler, HTML Help compiler, Tex2RTF on your path
13# - WISE Install 5
f1d93f0b
JS
14# - Word 97 (not tested with higher versions)
15# - Adobe Acrobat & Distiller
16#
17# Before running this script, you will need to:
18#
19# - update the readmes, change log, manual version etc.
20# - update version.h
21# - update distrib/msw/wisetop.txt, wisebott.txt with the correct version
22# number, plus any hard-wired wxWindows paths
23# - test on a variety of compilers
24#
25# TODO:
26#
27# - generation of PDF (only PDF RTF generated so far)
28# - perhaps prompt the user to read the important release docs,
29# version.h, setup.h
1620f478
JS
30#
31# Julian Smart, October 2000
32
33SRC=`cygpath -u $WXWIN`
34DEST=$SRC/deliver
35TMPDIR=`cygpath -u $TEMP`
36OK=1
37DOWISE=0
f1d93f0b
JS
38DOPDF=0
39DOALL=1
40DOCSONLY=0
41WXWINONLY=0
42WISEONLY=0
43BINONLY=0
44PDFONLY=0
45
1620f478
JS
46# For some reason, if we pipe output to egrep, we see output, but not otherwise.
47WARNINGS=": decorated name|: see reference|: see declaration|C4786|VC98\\\\INCLUDE|template<>"
48
49setup_vars() {
50 VCPATH="/c/Program Files/Microsoft Visual Studio/common/msdev98/bin:/c/Program Files/Microsoft Visual Studio/VC98/bin:DevStudio/VC/bin:/c/Program Files/Microsoft Visual Studio/common/tools:/c/Program Files/HTML Help Workshop"
51 INCLUDE="C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE;C:\Program Files\Tcl\include;C:\Program Files\HTML Help Workshop\include"
52 LIB="C:\Program Files\Microsoft Visual Studio\VC98\lib;C:\Program Files\Microsoft Visual Studio\VC98\MFC\lib;C:\Program Files\Tcl\lib;C:\Program Files\HTML Help Workshop\lib"
53 TCLHOME=C:/PROGRA~1/Tcl export TCLHOME
54 PATH="$PATH:$VCPATH" export PATH
55 export INCLUDE LIB
f1d93f0b
JS
56
57 WORDEXE="/c/Program Files/Microsoft Office/Office/WINWORD.EXE"
1620f478
JS
58}
59
60check_compile() {
61 egrep ": error C|fatal error" $TMPDIR/buildlog.txt > $TMPDIR/errorlog.txt
62 if [ -s $TMPDIR/errorlog.txt ]; then
63 echo Did not build $0 successfully.
64 OK=0
65 fi
66}
67
68check_files() {
69 if [ ! -d "$SRC" ]; then
70 echo "$SRC" does not exist.
71 OK=0
72 fi
73
74 if [ ! -d "$SRC/deliver" ]; then
75 mkdir "$SRC/deliver"
76 fi
77
78 if [ ! -e $SRC/include/wx/msw/setup.h ]; then
79 cp "$SRC/include/wx/msw/setup0.h" "$SRC/include/wx/msw/setup.h"
80 echo setup0.h has been copied to setup.h.
81 echo You must now edit this file to restore release settings,
82 echo then run this script again.
83 OK=0
84 notepad.exe "$SRC/include/wx/msw/setup.h"
85 fi
86 if [ ! -d "$SRC/bin" ]; then
87 mkdir "$SRC/bin"
88 fi
f1d93f0b 89 if [ ! -e "$SRC/bin/DBGVIEW.EXE" ]; then
1620f478
JS
90 echo Please put DBGVIEW.EXE, DBGVIEW.CNT, DBGVIEW.HLP into $SRC/bin
91 echo and run the script again.
92 OK=0
93 fi
94}
95
96build_docs() {
97 cd "$SRC/src/msw"
98 echo "---------------------------------"
99 echo "Building wxWindows documents"
100 nmake -f makefile.vc cleandocs docs
101
102 cd "$SRC/utils/dialoged/src"
103 nmake -f makefile.vc html htmlhelp htb hlp pdfrtf
104
105 cd "$SRC/utils/tex2rtf/src"
106 nmake -f makefile.vc html htmlhelp htb hlp pdfrtf
107
108 cd "$SRC/contrib/src/ogl"
109 nmake -f makefile.vc html htmlhelp htb hlp pdfrtf
110
111 cd "$SRC/contrib/src/mmedia"
f1d93f0b
JS
112 nmake -f makefile.vc html htmlhelp htb hlp pdfrtf
113}
114
115# TODO: Make PDF via Word, if Word and Adobe Acrobat are present.
116# This has to be interactive at present.
117build_pdf() {
118 echo "---------------------------------"
119 echo "Building wxWindows PDF documents"
120 if [ -e "$WORDEXE" ]; then
121 "$WORDEXE" "$WXWIN\\docs\\pdf\\wx.rtf"
122 "$WORDEXE" "$WXWIN\\docs\\pdf\\dialoged.rtf"
123 "$WORDEXE" "$WXWIN\\docs\\pdf\\tex2rtf.rtf"
124 "$WORDEXE" "$WXWIN\\contrib\\docs\\pdf\\ogl.rtf"
125 "$WORDEXE" "$WXWIN\\contrib\\docs\\mmedia\\ogl.rtf"
126 else
127 echo MS Word not present. Not doing PDF build.
128 fi
1620f478
JS
129}
130
131# Build wxWindows
132build_wxwin_vc() {
133 echo "---------------------------------"
134 echo "Building wxWindows using VC++"
135 cd "$SRC/src"
136 echo Building wxWindows Release library in `pwd`
137 echo Command: msdev wxvc.dsw /useenv /make "wxvc - Win32 Release" /rebuild
138 msdev wxvc.dsw /useenv /make "wxvc - Win32 Release" /rebuild | egrep -v "$WARNINGS"
139}
140
141build_dialog_editor() {
142 echo "---------------------------------"
143 echo "Building Dialog Editor using VC++"
144 cd "$SRC/utils/dialoged/src"
145 msdev DialogEdVC.dsw /useenv /make "DialogEdVC - Win32 Release" /rebuild | egrep -v "$WARNINGS" | tee $TMPDIR/buildlog.txt
146
147 check_compile "Dialog Editor"
148}
149
150build_tex2rtf() {
151 echo "---------------------------------"
152 echo "Building Tex2RTF using VC++"
153 cd "$SRC/utils/tex2rtf/src"
154 msdev Tex2RTFVC.dsw /useenv /make "Tex2RTFVC - Win32 Release" /rebuild | egrep -v "$WARNINGS" | tee $TMPDIR/buildlog.txt
155
156 check_compile "Tex2RTF"
157}
158
159build_life() {
160 echo "---------------------------------"
161 echo "Building Life! using VC++"
162 cd "$SRC/demos/life"
163 msdev LifeVC.dsw /useenv /make "LifeVC - Win32 Release" /rebuild | egrep -v "$WARNINGS" | tee $TMPDIR/buildlog.txt
164
165 check_compile "Life! Demo"
166}
167
168build_executables() {
169 build_dialog_editor
170 build_tex2rtf
171 build_life
172}
173
174copy_files() {
175 cp "$SRC/utils/dialoged/src/Release/dialoged.exe" "$SRC/bin"
f1d93f0b 176 cp "$SRC/docs/winhelp/dialoged.hlp" "$SRC/docs/winhelp/dialoged.cnt" "$SRC/bin"
1620f478
JS
177
178 cp "$SRC/utils/tex2rtf/src/Release/tex2rtf.exe" "$SRC/bin"
f1d93f0b 179 cp "$SRC/docs/winhelp/tex2rtf.hlp" "$SRC/docs/winhelp/tex2rtf.cnt" "$SRC/bin"
1620f478 180
f1d93f0b 181 cp "$SRC/demos/life/Release/life.exe" "$SRC/demos/life/breeder.lif" "$SRC/bin"
1620f478
JS
182}
183
184# Process command line options.
185for i in "$@"; do
186 case "$i" in
187 --wise) DOWISE=1 ;;
f1d93f0b
JS
188 --pdf) DOPDF=1 ;;
189 --wise-only)
190 WISEONLY=1
191 DOWISE=1
192 DOALL=0
193 ;;
194 --docs-only)
195 DOCSONLY=1
196 DOALL=0
197 ;;
198 --bin-only)
199 BINONLY=1
200 DOALL=0
201 ;;
202 --wxwin-only)
203 WXWINONLY=1
204 DOALL=0
205 ;;
206 --pdf-only)
207 PDFONLY=1
208 DOPDF=1
209 DOALL=0
210 ;;
1620f478
JS
211 *)
212 echo Usage: $0 "[ options ]"
213 echo Generates documentation and binaries for creating a distribution,
214 echo and optionally generates the zip/setup.exe distribution by
215 echo calling zipdist.sh.
216 echo
217 echo Options:
218 echo " --help Display this help message"
f1d93f0b
JS
219 echo " --wise Additonally, build zips and setup.exe"
220 echo " --pdf Additionally, try to generate PDF"
221 echo " --wise-only Only do zip/setup phase"
222 echo " --wxwin-only Only do wxWin lib building phase"
223 echo " --docs-only Only do docs building phase"
224 echo " --pdf-only Only do PDF building phase"
225 echo " --bin-only Only do .exe building phase"
1620f478
JS
226 exit 1
227 ;;
228 esac
229done
230
231mkdir -p $SRC/docs/pdf
232mkdir -p $SRC/docs/html
233mkdir -p $SRC/docs/htmlhelp
234mkdir -p $SRC/docs/htb
f1d93f0b
JS
235mkdir -p $SRC/docs/winhelp
236mkdir -p $SRC/contrib/docs/pdf
237mkdir -p $SRC/contrib/docs/html
238mkdir -p $SRC/contrib/docs/htmlhelp
239mkdir -p $SRC/contrib/docs/htb
240mkdir -p $SRC/contrib/docs/winhelp
1620f478
JS
241
242setup_vars
243check_files
244
f1d93f0b
JS
245if [ "$OK" = "1" ]; then
246 if [ "$DOCSONLY" = "1" ] || [ "$DOALL" = "1" ]; then
247 build_docs
248 fi
249fi
250
251if [ "$OK" = "1" ] && [ "$DOPDF" = "1" ]; then
252 if [ "$PDFONLY" = "1" ] || [ "$DOALL" = "1" ]; then
253 build_pdf
254 fi
1620f478
JS
255fi
256
257if [ "$OK" = "1" ]; then
f1d93f0b
JS
258 if [ "$WXWINONLY" = "1" ] || [ "$DOALL" = "1" ]; then
259 build_wxwin_vc
260 fi
1620f478
JS
261fi
262
263if [ "$OK" = "1" ]; then
f1d93f0b
JS
264 if [ "$BINONLY" = "1" ] || [ "$DOALL" = "1" ]; then
265 build_executables
266 fi
1620f478
JS
267fi
268
269if [ "$OK" = "1" ]; then
270 copy_files
271fi
272
f1d93f0b
JS
273if [ "$OK" = "1" ] && [ "$DOWISE" = "1" ]; then
274 if [ "$WISEONLY" = "1" ] || [ "$DOALL" = "1" ]; then
275 $SRC/distrib/msw/zipdist.sh --wise
276 fi
1620f478
JS
277fi
278
279if [ "$OK" = "1" ]; then
280 echo Finished successfully.
281else
282 echo Finished unsuccessfully. There were errors.
283fi
284
285echo Press return to continue.
286read dummy
287