* make.bat: Cleaned up end-of-line characters.
[gnus] / make.bat
1 @echo off
2
3 rem Written by Frank Schmitt <ich@frank-schmitt.net>
4 rem based on the work by David Charlap (shamino@writeme.com)
5 rem .
6 rem Clear PWD so emacs doesn't get confused
7 set GNUS_PWD_SAVE=%PWD%
8 set PWD=
9 set ERROR=:
10
11 if "%1" == "" goto usage
12
13 rem Emacs 20.7 no longer includes emacs.bat. Use emacs.exe if the batch file is
14 rem not present -- this also fixes the problem about too many parameters on Win9x.
15 if exist %1\emacs.bat goto ebat
16 if exist %1\emacs.exe goto eexe
17 if exist %1\xemacs.exe goto xemacs
18 goto noemacs
19
20 :ebat
21 set EMACS=emacs.bat
22 echo.
23 echo ***************************************************************************
24 echo * Using emacs.bat (If you've got en Emacs >= 20.3 please remove Emacs.bat, 
25 echo * it isn't needed anymore.
26 echo ***************************************************************************
27 echo.
28 goto emacs
29
30 :eexe
31 set EMACS=emacs.exe
32 echo.
33 echo ***************************************************************************
34 echo * Using emacs.exe
35 echo ***************************************************************************
36 echo.
37 goto emacs
38
39 :emacs
40 if not "%2" == "/copy" goto emacsnocopy
41 if not exist %1\..\site-lisp mkdir %1\..\site-lisp
42 if not exist %1\..\site-lisp\gnus mkdir %1\..\site-lisp\gnus
43 if not exist %1\..\site-lisp\subdirs.el set subdirwarning=yes
44 :emacsnocopy
45 set EMACS_ARGS=-batch -q -no-site-file
46 set GNUS_INFO_DIR=%1\..\info
47 set GNUS_LISP_DIR=%1\..\site-lisp\gnus\lisp
48 set GNUS_ETC_DIR=%1\..\site-lisp\gnus\etc
49 goto lisp
50       
51 :xemacs      
52 set EMACS=xemacs.exe
53 if not "%2" == "/copy" goto xemacsnocopy
54 if not exist %1\..\..\site-packages\ mkdir %1\..\..\site-packages\
55 if not exist %1\..\..\site-packages\info mkdir %1\..\..\site-packages\info
56 if not exist %1\..\..\site-packages\lisp mkdir %1\..\..\site-packages\lisp
57 if not exist %1\..\..\site-packages\etc mkdir %1\..\..\site-packages\etc
58 :xemacsnocopy
59 set EMACS_ARGS=-batch -no-autoloads
60 set GNUS_INFO_DIR=%1\..\..\site-packages\info
61 set GNUS_LISP_DIR=%1\..\..\site-packages\lisp\gnus
62 set GNUS_ETC_DIR=%1\..\..\site-packages\etc
63 echo.
64 echo ***************************************************************************
65 echo * Using xemacs.exe
66 echo ***************************************************************************
67 echo.
68 goto lisp
69
70 :lisp
71 set EMACSBATCH=call %1\%EMACS% %EMACS_ARGS%
72 cd lisp
73 if exist gnus-load.el del gnus-load.el
74 echo.
75 echo Stand by while generating autoloads.
76 echo.
77 %EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-cus-load .
78 if ErrorLevel 1 set ERROR=make-cus-load
79 %EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-auto-load .
80 if ErrorLevel 1 set ERROR=%ERROR%,make-auto-load
81 %EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-load
82 if ErrorLevel 1 set ERROR=%ERROR%,make-load
83 echo.
84 echo Stand by while compiling lisp files.
85 echo.
86 %EMACSBATCH% -l ./dgnushack.el -f dgnushack-compile
87 if ErrorLevel 1 set ERROR=%ERROR%,compile
88
89 if not "%2" == "/copy" goto infotest
90 echo.
91 echo Stand by while copying lisp files.
92 echo.
93 if not exist %GNUS_LISP_DIR% mkdir %GNUS_LISP_DIR%
94 xcopy /R /Q /Y *.el* %GNUS_LISP_DIR%
95 if ErrorLevel 1 set ERROR=%ERROR%,copy-lisp
96 goto infotest
97
98 :infotest
99 cd ..\texi
100 if exist sieve del sieve
101 makeinfo sieve.texi
102 if exist sieve goto minfo 
103 REM It seems that makeinfo isn't available
104 set EMACSINFO=%EMACSBATCH% -l infohack.el -f batch-makeinfo
105 echo.
106 echo ***************************************************************************
107 echo * Using infohack.el, if you've got makeinfo.exe put it in PATH.
108 echo ***************************************************************************
109 echo.
110 goto info
111
112 :minfo
113 set EMACSINFO=makeinfo  
114 echo.
115 echo ***************************************************************************
116 echo * Using makeinfo
117 echo ***************************************************************************
118 echo.
119 goto info
120
121 :info
122 echo.
123 echo Stand by while generating info files.
124 echo.
125 %EMACSINFO% emacs-mime.texi
126 if ErrorLevel 1 set ERROR=%ERROR%,emacs-mime.texi
127 %EMACSINFO% gnus.texi
128 if ErrorLevel 1 set ERROR=%ERROR%,gnus.texi
129 %EMACSINFO% sieve.texi
130 if ErrorLevel 1 set ERROR=%ERROR%,sieve.texi
131 %EMACSINFO% pgg.texi
132 if ErrorLevel 1 set ERROR=%ERROR%,pgg.texi
133 %EMACSINFO% message.texi
134 if ErrorLevel 1 set ERROR=%ERROR%,message.texi
135
136 if not "%2" == "/copy" goto nocopy
137 if not exist %GNUS_INFO_DIR% mkdir %GNUS_INFO_DIR%
138
139 echo.
140 echo Stand by while copying info files.
141 echo.
142 xcopy /R /Q /Y gnus       %GNUS_INFO_DIR%
143 if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-info
144 xcopy /R /Q /Y gnus-?     %GNUS_INFO_DIR%
145 if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-x-info
146 xcopy /R /Q /Y gnus-??    %GNUS_INFO_DIR%
147 if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-xx-info
148 xcopy /R /Q /Y message    %GNUS_INFO_DIR%
149 if ErrorLevel 1 set ERROR=%ERROR%,copy-message-info
150 if exist message-1 xcopy /R /Q /Y message-?  %GNUS_INFO_DIR%
151 if ErrorLevel 1 set ERROR=%ERROR%,copy-message-x-info
152 xcopy /R /Q /Y emacs-mime %GNUS_INFO_DIR%
153 if ErrorLevel 1 set ERROR=%ERROR%,copy-emacs-mime-info
154 xcopy /R /Q /Y sieve      %GNUS_INFO_DIR%
155 if ErrorLevel 1 set ERROR=%ERROR%,copy-sieve-info
156 xcopy /R /Q /Y pgg        %GNUS_INFO_DIR%
157 if ErrorLevel 1 set ERROR=%ERROR%,copy-pgg-info
158
159 echo.
160 echo ***************************************************************************
161 echo * You should add the following lines to 
162 echo * %GNUS_INFO_DIR%\dir 
163 echo * if they aren't already there:
164 echo *
165 echo * * PGG: (pgg).    Emacs interface to various PGP implementations.
166 echo * * Sieve: (sieve).        Managing Sieve scripts in Emacs.
167 echo ***************************************************************************
168 echo.
169
170 :etc
171 cd ..\etc
172 echo.
173 echo Stand by while copying etc files.
174 echo.
175 if not exist %GNUS_ETC_DIR% mkdir %GNUS_ETC_DIR%
176 xcopy /R /Q /Y gnus-tut.txt %GNUS_ETC_DIR%
177 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-gnus-tut-txt
178 if not exist %GNUS_ETC_DIR%\gnus mkdir %GNUS_ETC_DIR%\gnus
179 xcopy /R /Q /Y .\gnus\* %GNUS_ETC_DIR%\gnus\
180 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-gnus-*
181 if not exist %GNUS_ETC_DIR%\smilies mkdir %GNUS_ETC_DIR%\smilies
182 xcopy /R /Q /Y .\smilies\* %GNUS_ETC_DIR%\smilies\
183 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-smilies-*
184 goto warnings
185
186 :nocopy
187 echo.
188 echo ***************************************************************************
189 echo * You chose not to copy the files, therefore you should add the 
190 echo * following lines to the TOP of your [X]emacs customization file:
191 echo *
192 echo * (add-to-list 'load-path "/Path/to/gnus/lisp")
193 echo * (if (featurep 'xemacs)
194 echo *     (add-to-list 'Info-directory-list "c:/Path/to/gnus/texi/")
195 echo *   (add-to-list 'Info-default-directory-list "c:/Path/to/gnus/texi/")
196 echo * (require 'gnus-load)
197 echo *
198 echo * Replace c:/Path/to/gnus with the Path where your new Gnus is (that's here
199 echo * and yes, you've got to use forward slashes).
200 echo ***************************************************************************
201 echo.
202
203 :warnings
204 if not "%subdirwarning%" == "yes" goto warngnusload
205 echo.
206 echo ***************************************************************************
207 echo * There's no subdirs.el file in your site-lisp directory, you should
208 echo * therefor add the following line to the TOP of your Emacs
209 echo * customization file:
210 echo *
211 echo * (add-to-list 'load-path "/Path/to/emacs-site-lisp-directory/gnus/lisp")
212 echo * (require 'gnus-load)
213 echo * Yes, it must be forward slashes.
214 echo ***************************************************************************
215 echo.
216 goto warnerrors
217
218 :warngnusload
219 echo.
220 echo ***************************************************************************
221 echo * You should add the following line to the TOP of your Emacs
222 echo * customization file:
223 echo *
224 echo * (require 'gnus-load)
225 echo ***************************************************************************
226 echo.
227
228 :warnerrors
229 if "%ERROR%"==":" goto noerrors
230 set errorlevel=1
231 echo.
232 echo ***************************************************************************
233 echo * WARNING ERRORS OCCURRED!
234 echo * You should look for error messages in the output of the called programs
235 echo * and try to find out what exactly went wrong.
236 echo * Errors occured in the following modules:
237 echo * %ERROR%
238 echo ***************************************************************************
239 echo.
240 goto done
241
242 :noerrors
243 set errorlevel=0
244
245 :done
246 cd ..
247 goto end
248
249 :noemacs
250 echo.
251 echo ***************************************************************************
252 echo * Unable to find emacs.exe or xemacs.exe on the path you specified!
253 echo * STOP!
254 echo ***************************************************************************
255 echo.
256 goto usage
257
258 :usage
259 echo.
260 echo ***************************************************************************
261 echo * Usage: make.bat :[X]Emacs-exe-dir: [/copy]
262 echo *
263 echo * where: :[X]Emacs-exe-dir: is the directory your 
264 echo *           emacs.exe respectively xemacs.exe resides in, 
265 echo *           e.g. G:\Programme\XEmacs\XEmacs-21.4.11\i586-pc-win32\
266 echo *           or G:\Emacs\bin
267 echo *        /copy indicates that the compiled files should be copied to your
268 echo *           emacs lisp, info, and etc site directories.
269 echo *
270 echo * Note: If you have Emacs/w3 you should set the environment variable 
271 echo *       W3DIR to the directory where w3 is installed eg.
272 echo *                set W3DIR=d:\lisp\w3-4.0pre46\lisp
273 echo ***************************************************************************
274 echo.
275
276 :end
277 rem Restore environment variables
278 set PWD=%GNUS_PWD_SAVE%
279 set GNUS_PWD_SAVE=
280 set EMACSBATCH=
281 set GNUS_LISP_DIR=
282 set GNUS_INFO_DIR=
283 set GNUS_ETC_DIR=
284 set subdirwarning=
285 set ERROR=