]> git.saurik.com Git - wxWidgets.git/blob - build/script/rebuild-makefiles.sh
add ms78 projects
[wxWidgets.git] / build / script / rebuild-makefiles.sh
1 #!/bin/sh
2
3 CURDATE=`date -I`
4 WORKDIR=/home/bake/bkl-cronjob
5 WINSRCDIR=/mnt/daily
6 FTPDIR=/home/ftp/pub
7 LD_LIBRARY_PATH=/usr/local/lib
8
9 update_from_svn()
10 {
11 (
12 cd ${WORKDIR}/wxWidgets
13 svn up
14 find . -name \.#\* | xargs rm -rf
15 )
16
17 }
18
19
20 regenerate_makefiles()
21 {
22 (cd ${WORKDIR}/wxWidgets/build/bakefiles && nice python -O /usr/local/bin/bakefile_gen)
23 }
24
25
26 do_package()
27 {
28 archtype=$1
29 format=$2
30 shift ; shift
31
32 rm -f ${WORKDIR}/archives/wx-mk-${format}-*
33
34 cd ${WORKDIR}/wxWidgets
35
36 files=""
37 for i in $* ; do
38 files="$files `find -name "$i"`"
39 done
40
41 if test $archtype = tar ; then
42 tar czf ../archives/wx-mk-${format}-${CURDATE}.tar.gz $files
43 elif test $archtype = zip ; then
44 zip -l -q -9 ../archives/wx-mk-${format}-${CURDATE}.zip $files
45 fi
46
47 cd ..
48 }
49
50
51
52
53 package_makefiles()
54 {
55 do_package tar autoconf Makefile.in autoconf_inc.m4
56 do_package zip gnu makefile.unx
57 do_package tar gnu makefile.unx
58 do_package zip mingw makefile.gcc config.gcc
59 do_package zip dmars makefile.dmc config.dmc makefile.dms config.dms
60 do_package zip watcom_msw makefile.wat config.wat
61 do_package zip msvc makefile.vc config.vc
62 do_package zip msvc6prj '*.dsp' '*.dsw'
63 do_package zip msvc7-8prj '*.vcproj' '*.sln'
64 do_package zip evcprj '*.vcp' '*.vcw'
65 (cd ${WORKDIR}/wxWidgets/build/bakefiles && nice python -O /usr/local/bin/bakefile_gen -f watcom -d ../os2/Bakefiles.os2.bkgen)
66 do_package zip watcom_os2 makefile.wat config.wat
67 }
68
69 copy_files ()
70 {
71 ##delete old files and then copy new ones, add a symlink
72
73 ## Makefiles
74 find ${FTPDIR}/Daily_Makefiles/files -type f -name wx-mk\* -mtime +3 | xargs rm -rf
75 cp ${WORKDIR}/archives/wx-mk-* ${FTPDIR}/Daily_Makefiles/files
76
77 rm -f ${FTPDIR}/Daily_Makefiles/wx* ${FTPDIR}/Daily_Makefiles/MD5SUM
78 ##there must be an easier way of doing these links...
79 for f in `find ${FTPDIR}/Daily_Makefiles/files -type f -name wx-mk\* -mmin -601` ; do
80 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
81 done
82 md5sum ${FTPDIR}/Daily_Makefiles/wx* > ${FTPDIR}/Daily_Makefiles/MD5SUM
83 sleep 10
84 echo CVS Makefiles generated from bakefiles last updated at `date -u` > ${FTPDIR}/Daily_Makefiles/updated_at.txt
85
86 ## Setup.exe
87 find ${FTPDIR}/Daily_HEAD/files -type f -name wx\* -mtime +3 | xargs rm -rf
88 cp ${WORKDIR}/archives/win/*.exe ${FTPDIR}/Daily_HEAD/files
89
90 rm -f ${FTPDIR}/Daily_HEAD/*.exe ${FTPDIR}/Daily_HEAD/MD5SUM
91 ##there must be an easier way of doing these links...
92 for f in `find ${FTPDIR}/Daily_HEAD/files -type f -name wx\*.exe -mmin -601` ; do
93 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
94 done
95 md5sum ${FTPDIR}/Daily_HEAD/wx* > ${FTPDIR}/Daily_HEAD/MD5SUM
96 sleep 10
97 echo CVS HEAD last updated at `date -u` > ${FTPDIR}/Daily_HEAD/updated_at.txt
98
99
100 ## Docs...
101 find ${FTPDIR}/Daily_Docs/files -type f -name wx\* -mtime +3 | xargs rm -rf
102 cp ${WORKDIR}/archives/wx-doc* ${FTPDIR}/Daily_Docs/files
103 cp ${WORKDIR}/archives/win/wxW* ${FTPDIR}/Daily_Docs/files
104
105 rm -f ${FTPDIR}/Daily_Docs/wx* ${FTPDIR}/Daily_Docs/MD5SUM
106 ##there must be an easier way of doing these links...
107 for f in `find ${FTPDIR}/Daily_Docs/files -type f -name wx\* -mmin -601` ; do
108 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
109 done
110 md5sum ${FTPDIR}/Daily_Docs/wx* > ${FTPDIR}/Daily_Docs/MD5SUM
111 sleep 10
112 echo CVS Documentation generated from bakefiles last updated at `date -u` > ${FTPDIR}/Daily_Docs/updated_at.txt
113 }
114
115 do_texrtf ()
116 {
117
118 ##parameters : subdir_of_tex index.tex dir_under_wxWidgets
119 # need this first time only
120 if [ ! -e ${WORKDIR}/archives/html/$1 ] ; then
121 mkdir ${WORKDIR}/archives/html/$1
122 fi
123
124 rm -f ${WORKDIR}/archives/html/$1/*
125 /usr/local/bin/tex2rtf ${WORKDIR}/wxWidgets/$3/docs/latex/$1/$2 ${WORKDIR}/archives/html/$1/$1 -twice -html -macros ${WORKDIR}/wxWidgets/docs/latex/wx/tex2rtf_css.ini
126 cp ${WORKDIR}/wxWidgets/$3/docs/latex/$1/*.gif ${WORKDIR}/archives/html/$1
127 cp ${WORKDIR}/wxWidgets/$3/docs/latex/$1/*.css ${WORKDIR}/archives/html/$1
128 cd ${WORKDIR}/archives/html/$1
129 zip -l -q -9 ${WORKDIR}/archives/htb/$1.htb *.html *.css wx.hhc wx.hhp wx.hhk
130 zip -q -9 ${WORKDIR}/archives/htb/$1.htb *.gif
131 }
132
133 ##this one for tex2rtf as its latex docs aren't in latex...
134 do_util_texrtf ()
135 {
136 ##parameters : subdir_of_tex index.tex
137 # need this first time only
138 if [ ! -e ${WORKDIR}/archives/html/$1 ] ; then
139 mkdir ${WORKDIR}/archives/html/$1
140 fi
141
142 rm -f ${WORKDIR}/archives/html/$1/*
143 /usr/local/bin/tex2rtf ${WORKDIR}/wxWidgets/utils/$1/docs/$2 ${WORKDIR}/archives/html/$1/$1 -twice -html -macros ${WORKDIR}/wxWidgets/docs/latex/wx/tex2rtf_css.ini
144 cp ${WORKDIR}/wxWidgets/utils/$1/docs/*.gif ${WORKDIR}/archives/html/$1
145 cp ${WORKDIR}/wxWidgets/utils/$1/docs/*.css ${WORKDIR}/archives/html/$1
146 cd ${WORKDIR}/archives/html/$1
147 zip -l -q -9 ${WORKDIR}/archives/htb/$1.htb *.html *.css wx.hhc wx.hhp wx.hhk
148 zip -q -9 ${WORKDIR}/archives/htb/$1.htb *.gif
149 }
150
151 do_docs ()
152 {
153 ##remove files, then regenerate
154 rm ${WORKDIR}/archives/wx-do*
155 rm ${WORKDIR}/archives/win/wx*
156 rm ${WORKDIR}/archives/htb/*.*
157
158 ######### dir index.tex rootdir
159 do_texrtf wx manual.tex
160 #do_texrtf book book.tex
161 #do_texrtf svg dcsvg.tex contrib
162 #do_texrtf ogl ogl.tex contrib
163 #do_texrtf mmedia mmedia.tex contrib
164 #do_texrtf gizmos manual.tex contrib
165 #do_texrtf fl fl.tex contrib
166 do_util_texrtf tex2rtf tex2rtf.tex
167
168 cd ${WORKDIR}/archives/
169 tar zcvf ${WORKDIR}/archives/wx-docs-html-${CURDATE}.tar.gz `find . -name '*.gif' -print -o -name '*.html' -print` html/wx/*.css
170
171 tar zcvf ${WORKDIR}/archives/wx-docs-htb-${CURDATE}.tar.gz htb/*
172 zip -q -9 ${WORKDIR}/archives/wx-docs-htb-${CURDATE}.zip htb/*
173
174 ##remove .con files
175 rm ${WORKDIR}/*.con
176
177 }
178
179
180 add_win_files ()
181 {
182 ### starts with wx***.zip
183
184 for f in `find ${WINSRCDIR}/ -maxdepth 1 -name wx\*.zip ` ; do
185 cp $f ${WORKDIR}/archives/win/`basename $f | sed -e "s/.zip//"`-${CURDATE}.zip
186 done
187
188 for f in `find ${WINSRCDIR}/ -maxdepth 1 -name wx\*.exe ` ; do
189 cp $f ${WORKDIR}/archives/win/`basename $f | sed -e "s/.exe//"`-${CURDATE}.exe
190 done
191
192 }
193
194 update_from_svn
195 regenerate_makefiles
196 package_makefiles
197
198 do_docs
199 add_win_files
200
201 copy_files
202
203 exit 0