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-Pine 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=/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=/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
79 set alpinemake=makefile.wnt
80 set extramakecommand=clean
81 if NOT exist c-client goto nocclient
85 if NOT exist c-client-dll goto nocclientdll
89 set cclntmake=makefile.w2k
93 if not exist c-client mkdir c-client
94 if not defined ALPINE_IMAP set ALPINE_IMAP=imap
95 echo Copying imap files to c-client directory
96 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client\ > garbageout.txt
97 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client\ > garbageout.txt
98 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client\ > garbageout.txt
100 if not exist c-client-dll mkdir c-client-dll
101 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client-dll\ > garbageout.txt
102 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client-dll\ > garbageout.txt
103 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client-dll\ > garbageout.txt
105 if not exist mailutil mkdir mailutil
106 copy /Y "%ALPINE_IMAP%"\src\mailutil\* mailutil\ > garbageout.txt
111 set extraldflags="/DEBUG /DEBUGTYPE:CV"
112 set extracflags="%extracflagsnq%"
113 set extradllcflags="%extracflagsnq% /D_DLL"
117 echo Building c-client...
119 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% %extramakecommand%
120 if errorlevel 1 goto bogus
125 if exist mailutil goto yesbuildmailutil
128 echo Building mailutil
130 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% %extramakecommand%
131 if errorlevel 1 goto bogus
137 echo Building pith-osdep...
139 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
140 if errorlevel 1 goto bogus
145 echo Building pith-charconv...
147 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
148 if errorlevel 1 goto bogus
153 echo Building pith...
155 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
156 if errorlevel 1 goto bogus
161 echo Building regex...
163 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
164 if errorlevel 1 goto bogus
169 echo Building pico-osdep...
171 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
172 if errorlevel 1 goto bogus
177 echo Building pico...
179 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
180 if errorlevel 1 goto bogus
185 echo Building alpine-osdep...
187 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
188 if errorlevel 1 goto bogus
193 echo Building alpine...
195 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibesalpine% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
196 if errorlevel 1 goto bogus
201 if NOT exist c-client-dll goto buildmapi
202 echo Building c-client-dll
204 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extradllcflags% %extramakecommand%
205 if errorlevel 1 goto bogus
212 nmake -nologo -f makefile EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
213 if errorlevel 1 goto bogus
217 echo Alpine build complete.
221 echo Problems building Alpine!