2 rem $Id: build.bat 14098 2005-10-03 18:54:13Z jpf@u.washington.edu $
3 rem ========================================================================
4 rem Copyright 2006-2007 University of Washington
6 rem Licensed under the Apache License, Version 2.0 (the "License");
7 rem you may not use this file except in compliance with the License.
8 rem You may obtain a copy of the License at
10 rem http://www.apache.org/licenses/LICENSE-2.0
12 rem ========================================================================
14 if "%1"=="" goto blank
15 if "%1"=="wnt" goto wnt
16 if "%1"=="w2k" goto w2k
17 if "%1"=="clean" goto clean
18 echo Unknown build command: %1 %2 %3 %4
21 echo Must specify build command!
24 echo where "cmd" is one of either:
26 echo w2k -- Windows with Win2k Kerb
27 echo clean -- to remove obj, lib, and exe files from source
31 echo PC-Alpine for Windows/Winsock (Win32) build sequence
32 set cclntmake=makefile.nt
33 set alpinemake=makefile.wnt
34 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
35 if exist "%ALPINE_LDAP%" goto yesldapwnt
36 echo NOT including LDAP functionality
41 echo including LDAP functionality
42 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
43 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
45 set extracflagsnq=/DWINVER=0x0501 /Zi -Od %ldapflags% -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSPCL_REMARKS=\"\\\"\\\"\"
47 set extralibesalpine=%ldaplibes%
48 set extrarcflags="/D_PCP_WNT"
53 echo Krb5ized PC-Pine for Windows/Winsock (Win32) build sequence
54 set cclntmake=makefile.w2k
55 set alpinemake=makefile.wnt
56 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
57 if exist "%ALPINE_LDAP%" goto yesldapw2k
58 echo NOT including LDAP functionality
63 echo including LDAP functionality
64 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
65 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
67 set extracflagsnq=/DWINVER=0x0501 /Zi -Od %ldapflags% -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSPCFC_WINVER=\"\\\" 2000\\\"\" -DSPCL_REMARKS=\"\\\" with krb5\\\"\"
68 set extralibes="secur32.lib"
69 set extralibesalpine="secur32.lib %ldaplibes%"
70 set extrarcflags="/D_PCP_W2K"
75 echo Sure you want to delete object, library and executable files?!?!
76 echo If NOT, type Ctrl-C to terminate build script NOW. Type ENTER if you do.
78 echo Cleaning alpine, pico, mailutil, mapi, and c-client directories
82 del /Q c-client-dll\*.pdb
83 rem del /Q mailutil\*.pdb
88 del /Q alpine\osdep\*.pdb
89 del /Q pico\osdep\*.pdb
90 del /Q pith\charconv\*.pdb
91 del /Q pith\osdep\*.pdb
97 set alpinemake=makefile.wnt
98 set extramakecommand=clean
99 if NOT exist c-client goto nocclient
103 if NOT exist c-client-dll goto nocclientdll
104 del /Q c-client-dll\*
107 set cclntmake=makefile.w2k
111 if not exist c-client mkdir c-client
112 if not defined ALPINE_IMAP set ALPINE_IMAP=imap
113 echo Copying imap files to c-client directory
114 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client\ > garbageout.txt
115 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client\ > garbageout.txt
116 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client\ > garbageout.txt
118 if not exist c-client-dll mkdir c-client-dll
119 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client-dll\ > garbageout.txt
120 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client-dll\ > garbageout.txt
121 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client-dll\ > garbageout.txt
123 if not exist mailutil mkdir mailutil
124 copy /Y "%ALPINE_IMAP%"\src\mailutil\* mailutil\ > garbageout.txt
129 set extraldflags="/DEBUG /DEBUGTYPE:CV"
130 set extracflags="%extracflagsnq%"
131 set extradllcflags="%extracflagsnq% /D_DLL"
135 echo Building c-client...
137 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% %extramakecommand%
138 if errorlevel 1 goto bogus
143 if exist mailutil goto yesbuildmailutil
146 echo Building mailutil
148 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% %extramakecommand%
149 if errorlevel 1 goto bogus
155 echo Building pith-osdep...
157 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
158 if errorlevel 1 goto bogus
163 echo Building pith-charconv...
165 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
166 if errorlevel 1 goto bogus
171 echo Building pith...
173 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
174 if errorlevel 1 goto bogus
179 echo Building regex...
181 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
182 if errorlevel 1 goto bogus
187 echo Building pico-osdep...
189 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
190 if errorlevel 1 goto bogus
195 echo Building pico...
197 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
198 if errorlevel 1 goto bogus
203 echo Building alpine-osdep...
205 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
206 if errorlevel 1 goto bogus
211 echo Building alpine...
213 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibesalpine% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
214 if errorlevel 1 goto bogus
219 if NOT exist c-client-dll goto buildmapi
220 echo Building c-client-dll
222 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extradllcflags% %extramakecommand%
223 if errorlevel 1 goto bogus
230 nmake -nologo -f makefile EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
231 if errorlevel 1 goto bogus
235 echo Alpine build complete.
239 echo Problems building Alpine!