1 # Makefile for Windows NT and Windows 95/98/2000
4 # _apacher - build Apache in Release mode
5 # _apached - build Apache in Debug mode
6 # installr - build and install a Release build
7 # installd - build and install a Debug build
8 # clean - remove (most) generated files
9 # _cleanr - remove (most) files generated by a Release build
10 # _cleand - remove (most) files generated by a Debug build
12 # The default installation directory is \Apache2.0. This can be changed
13 # with the INSTDIR macro, for example:
15 # nmake /f Makefile.win INSTDIR="d:\Program Files\Apache" installr
17 # Note: this does *NOT* change the compiled in default "server root"
18 # Also be aware that certain awk's will not accept backslahed names,
19 # so the server root should be given in forward slashes (quoted),
20 # preferably with the drive designation!
24 !IF !EXIST("srclib\apr")
25 !MESSAGE Please check out or download and unpack the Apache Portability Runtime
26 !MESSAGE sources (apr and apr-util) into your $(INSTDIR)\srclib directory.
27 !MESSAGE Apache cannot build without these libraries!
29 !ERROR Need $(INSTDIR)\srclib\apr
32 !IF !EXIST("srclib\apr-util")
33 !MESSAGE Please check out or download and unpack the Apache Portability Runtime
34 !MESSAGE sources (apr and apr-util) into your $(INSTDIR)\srclib directory.
35 !MESSAGE Apache cannot build without these libraries!
37 !ERROR Need $(INSTDIR)\srclib\apr-util
40 # Note; tryssl: is only used by the msvc developer studio environment to 'fix up'
41 # the build, since conditional dependencies aren't supported.
43 !IF EXIST("srclib\openssl")
44 !IF "$(LONG)" == "Debug"
50 !IF EXIST("modules\ssl\mod_ssl.mak")
52 $(MAKE) $(MAKEOPT) -f mod_ssl.mak CFG="mod_ssl - Win32 $(LONG)" RECURSE=0 $(CTARGET)
55 $(MAKE) $(MAKEOPT) -f mod_tls.mak CFG="mod_tls - Win32 $(LONG)" RECURSE=0 $(CTARGET)
58 msdev Apache.dsw /MAKE\
59 "mod_ssl - Win32 $(LONG)"\
60 "mod_tls - Win32 $(LONG)" /NORECURSE $(CTARGET)
65 echo mod_ssl and mod_tls will not build without openssl installed
66 echo in $(INSTDIR)\srclib\openssl. They must be precompiled using
67 echo the ms/ntdll.mak file. See INSTALL.W32 for details.
70 !IF "$(INSTDIR)" == ""
72 !MESSAGE Using default install directory $(INSTDIR)
76 # Only default the behavior if MAKEOPT= is omitted
77 !IF "$(MAKE)" == "NMAKE"
78 # Microsoft NMake options
80 !ELSEIF "($MAKE)" == "make"
81 # Borland make options? Not really supported (yet)
87 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build
90 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug _build
93 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build _install
96 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug _build _install
98 clean: _cleanr _cleand
100 !IF EXIST("Apache.mak")
103 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET=CLEAN _build
106 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug CTARGET=CLEAN _build
109 echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
111 $(MAKE) $(MAKEOPT) -f apr.mak CFG="apr - Win32 $(LONG)" RECURSE=0 $(CTARGET)
112 $(MAKE) $(MAKEOPT) -f libapr.mak CFG="libapr - Win32 $(LONG)" RECURSE=0 $(CTARGET)
114 cd srclib\apr-util\uri
115 $(MAKE) $(MAKEOPT) -f gen_uri_delims.mak CFG="gen_uri_delims - Win32 $(LONG)" RECURSE=0 $(CTARGET)
117 cd srclib\apr-util\xml\expat\lib
118 $(MAKE) $(MAKEOPT) -f xml.mak CFG="xml - Win32 $(LONG)" RECURSE=0 $(CTARGET)
120 $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
121 $(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
124 $(MAKE) $(MAKEOPT) -f dftables.mak CFG="dftables - Win32 $(LONG)" RECURSE=0 $(CTARGET)
125 $(MAKE) $(MAKEOPT) -f pcre.mak CFG="pcre - Win32 $(LONG)" RECURSE=0 $(CTARGET)
126 $(MAKE) $(MAKEOPT) -f pcreposix.mak CFG="pcreposix - Win32 $(LONG)" RECURSE=0 $(CTARGET)
129 $(MAKE) $(MAKEOPT) -f gen_test_char.mak CFG="gen_test_char - Win32 $(LONG)" RECURSE=0 $(CTARGET)
131 -del $(LONG)\buildmark.obj
132 $(MAKE) $(MAKEOPT) -f libhttpd.mak CFG="libhttpd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
133 $(MAKE) $(MAKEOPT) -f Apache.mak CFG="Apache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
135 $(MAKE) $(MAKEOPT) -f mod_auth_anon.mak CFG="mod_auth_anon - Win32 $(LONG)" RECURSE=0 $(CTARGET)
136 $(MAKE) $(MAKEOPT) -f mod_auth_dbm.mak CFG="mod_auth_dbm - Win32 $(LONG)" RECURSE=0 $(CTARGET)
137 $(MAKE) $(MAKEOPT) -f mod_auth_digest.mak CFG="mod_auth_digest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
140 $(MAKE) $(MAKEOPT) -f mod_file_cache.mak CFG="mod_file_cache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
143 $(MAKE) $(MAKEOPT) -f mod_dav.mak CFG="mod_dav - Win32 $(LONG)" RECURSE=0 $(CTARGET)
146 $(MAKE) $(MAKEOPT) -f mod_dav_fs.mak CFG="mod_dav_fs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
148 cd modules\generators
149 $(MAKE) $(MAKEOPT) -f mod_info.mak CFG"=mod_info - Win32 $(LONG)" RECURSE=0 $(CTARGET)
150 $(MAKE) $(MAKEOPT) -f mod_status.mak CFG="mod_status - Win32 $(LONG)" RECURSE=0 $(CTARGET)
153 $(MAKE) $(MAKEOPT) -f mod_rewrite.mak CFG="mod_rewrite - Win32 $(LONG)" RECURSE=0 $(CTARGET)
154 $(MAKE) $(MAKEOPT) -f mod_speling.mak CFG="mod_speling - Win32 $(LONG)" RECURSE=0 $(CTARGET)
157 $(MAKE) $(MAKEOPT) -f mod_cern_meta.mak CFG="mod_cern_meta - Win32 $(LONG)" RECURSE=0 $(CTARGET)
158 $(MAKE) $(MAKEOPT) -f mod_expires.mak CFG="mod_expires - Win32 $(LONG)" RECURSE=0 $(CTARGET)
159 $(MAKE) $(MAKEOPT) -f mod_headers.mak CFG="mod_headers - Win32 $(LONG)" RECURSE=0 $(CTARGET)
160 $(MAKE) $(MAKEOPT) -f mod_usertrack.mak CFG="mod_usertrack - Win32 $(LONG)" RECURSE=0 $(CTARGET)
163 # $(MAKE) $(MAKEOPT) -f mod_proxy.mak CFG="mod_proxy - Win32 $(LONG)" RECURSE=0 $(CTARGET)
165 !IF EXIST("srclib\openssl")
167 $(MAKE) $(MAKEOPT) -f mod_ssl.mak CFG="mod_ssl - Win32 $(LONG)" RECURSE=0 $(CTARGET)
170 $(MAKE) $(MAKEOPT) -f mod_tls.mak CFG="mod_tls - Win32 $(LONG)" RECURSE=0 $(CTARGET)
174 $(MAKE) $(MAKEOPT) -f ab.mak CFG="ab - Win32 $(LONG)" RECURSE=0 $(CTARGET)
175 $(MAKE) $(MAKEOPT) -f htpasswd.mak CFG="htpasswd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
176 $(MAKE) $(MAKEOPT) -f htdigest.mak CFG="htdigest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
177 $(MAKE) $(MAKEOPT) -f logresolve.mak CFG="logresolve - Win32 $(LONG)" RECURSE=0 $(CTARGET)
178 $(MAKE) $(MAKEOPT) -f rotatelogs.mak CFG="rotatelogs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
181 $(MAKE) $(MAKEOPT) -f ApacheMonitor.mak CFG="ApacheMonitor - Win32 $(LONG)" RECURSE=0 $(CTARGET)
182 $(MAKE) $(MAKEOPT) -f wintty.mak CFG="wintty - Win32 $(LONG)" RECURSE=0 $(CTARGET)
188 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET="/CLEAN" _build
191 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug CTARGET="/CLEAN" _build
194 echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
195 -del $(LONG)\buildmark.obj
196 msdev Apache.dsw /MAKE\
197 "apr - Win32 $(LONG)"\
198 "libapr - Win32 $(LONG)"\
199 "gen_uri_delims - Win32 $(LONG)"\
200 "xml - Win32 $(LONG)"\
201 "aprutil - Win32 $(LONG)"\
202 "libaprutil - Win32 $(LONG)"\
203 "dftables - Win32 $(LONG)"\
204 "pcre - Win32 $(LONG)"\
205 "pcreposix - Win32 $(LONG)"\
206 "gen_test_char - Win32 $(LONG)"\
207 "libhttpd - Win32 $(LONG)"\
208 "Apache - Win32 $(LONG)"\
209 "mod_auth_anon - Win32 $(LONG)"\
210 "mod_auth_dbm - Win32 $(LONG)"\
211 "mod_auth_digest - Win32 $(LONG)"\
212 "mod_file_cache - Win32 $(LONG)"\
213 "mod_dav - Win32 $(LONG)"\
214 "mod_dav_fs - Win32 $(LONG)"\
215 "mod_info - Win32 $(LONG)"\
216 "mod_status - Win32 $(LONG)"\
217 "mod_rewrite - Win32 $(LONG)"\
218 "mod_speling - Win32 $(LONG)"\
219 "mod_cern_meta - Win32 $(LONG)"\
220 "mod_expires - Win32 $(LONG)"\
221 "mod_headers - Win32 $(LONG)"\
222 "mod_usertrack - Win32 $(LONG)"\
223 "ab - Win32 $(LONG)"\
224 "htpasswd - Win32 $(LONG)"\
225 "htdigest - Win32 $(LONG)"\
226 "logresolve - Win32 $(LONG)"\
227 "rotatelogs - Win32 $(LONG)"\
228 "ApacheMonitor - Win32 $(LONG)"\
229 "wintty - Win32 $(LONG)" /NORECURSE $(CTARGET)
230 !IF EXIST("srclib\openssl")
231 msdev Apache.dsw /MAKE\
232 "mod_ssl - Win32 $(LONG)"\
233 "mod_tls - Win32 $(LONG)" /NORECURSE $(CTARGET)
240 -mkdir "$(INSTDIR)\bin"
241 -mkdir "$(INSTDIR)\cgi-bin"
242 -mkdir "$(INSTDIR)\conf"
243 -mkdir "$(INSTDIR)\htdocs"
244 -mkdir "$(INSTDIR)\htdocs\manual"
245 -mkdir "$(INSTDIR)\icons"
246 -mkdir "$(INSTDIR)\include"
247 -mkdir "$(INSTDIR)\include\xml"
248 -mkdir "$(INSTDIR)\include\pcre"
249 -mkdir "$(INSTDIR)\lib"
250 -mkdir "$(INSTDIR)\libexec"
251 -mkdir "$(INSTDIR)\logs"
252 -mkdir "$(INSTDIR)\modules"
253 # -mkdir "$(INSTDIR)\proxy"
254 copy ABOUT_APACHE "$(INSTDIR)"
255 copy CHANGES "$(INSTDIR)"
256 copy INSTALL "$(INSTDIR)"
257 copy LICENSE "$(INSTDIR)"
258 copy README "$(INSTDIR)"
259 copy $(LONG)\Apache.exe "$(INSTDIR)\bin"
260 copy $(LONG)\libhttpd.dll "$(INSTDIR)\bin"
261 copy srclib\apr\$(LONG)\libapr.dll "$(INSTDIR)\bin"
262 copy srclib\apr-util\$(LONG)\libaprutil.dll "$(INSTDIR)\bin"
263 copy modules\aaa\$(LONG)\mod_auth_anon.so "$(INSTDIR)\modules"
264 copy modules\aaa\$(LONG)\mod_auth_dbm.so "$(INSTDIR)\modules"
265 copy modules\aaa\$(LONG)\mod_auth_digest.so "$(INSTDIR)\modules"
266 copy modules\cache\$(LONG)\mod_file_cache.so "$(INSTDIR)\modules"
267 copy modules\dav\fs\$(LONG)\mod_dav_fs.so "$(INSTDIR)\modules"
268 copy modules\dav\main\$(LONG)\mod_dav.so "$(INSTDIR)\modules"
269 copy modules\generators\$(LONG)\mod_info.so "$(INSTDIR)\modules"
270 copy modules\generators\$(LONG)\mod_status.so "$(INSTDIR)\modules"
271 copy modules\mappers\$(LONG)\mod_rewrite.so "$(INSTDIR)\modules"
272 copy modules\mappers\$(LONG)\mod_speling.so "$(INSTDIR)\modules"
273 copy modules\metadata\$(LONG)\mod_cern_meta.so "$(INSTDIR)\modules"
274 copy modules\metadata\$(LONG)\mod_expires.so "$(INSTDIR)\modules"
275 copy modules\metadata\$(LONG)\mod_headers.so "$(INSTDIR)\modules"
276 copy modules\metadata\$(LONG)\mod_usertrack.so "$(INSTDIR)\modules"
277 # copy modules\proxy\$(LONG)\mod_proxy.so "$(INSTDIR)\modules"
278 !IF EXIST("srclib\openssl")
279 -copy modules\ssl\$(LONG)\mod_ssl.so "$(INSTDIR)\modules"
280 -copy modules\tls\$(LONG)\mod_tls.so "$(INSTDIR)\modules"
281 -copy srclib\openssl\$(SSLBIN)\openssl.exe "$(INSTDIR)\bin"
282 -copy srclib\openssl\$(SSLBIN)\libeay32.dll "$(INSTDIR)\bin"
283 -copy srclib\openssl\$(SSLBIN)\ssleay32.dll "$(INSTDIR)\bin"
284 -copy srclib\openssl\LICENSE "$(INSTDIR)\OPENSSL-LICENSE"
285 -copy << + srclib\openssl\NEWS "$(INSTDIR)\OPENSSL-NEWS"
287 Apache HTTP Server 2.0 Limited OpenSSL Distribution 17 Aug 2001
289 This binary distribution includes the minimal components of OpenSSL required
290 to support mod_ssl and mod_tls for Apache HTTP Server version 2.0 (further
291 details are available in OPENSSL-README.) For the complete list of CHANGES
292 to this and later versions of OpenSSL, please refer to the definative source,
293 <http://www.openssl.org/news/changelog.html>, or see the CHANGES file in the
294 full binary or source distribution package from <http://www.openssl.org/>.
296 --------------------------------------------------------------------------------
298 -copy << + srclib\openssl\README "$(INSTDIR)\OPENSSL-README"
300 Apache HTTP Server 2.0 Limited OpenSSL Distribution 17 Aug 2001
302 This binary installation of OpenSSL is a limited distribution of the documents
303 LICENSE, NEWS and README (prefixed by OPENSSL-), and the runtime files
309 These are the minimal libraries and tools required to use mod_ssl or mod_tls
310 as distributed with Apache HTTP Server version 2.0. No library files, headers
311 or sources are distributed with this binary distribution. Please refer to the
312 <http://www.openssl.org/> site for complete source or binary distributions.
314 The Apache HTTP Project only supports the binary distribution of these files
315 and development of the mod_ssl and mod_tls modules. We cannot provide support
316 assistance for using or configuring the OpenSSL package or these modules.
317 Please refer all installation and configuration questions to the appropriate
318 forum, such as the user supported newsgroups comp.infosystems.www.servers.unix
319 or comp.infosystems.www.servers.ms-windows, or see the support options listed
320 at <http://www.openssl.org/support/>.
322 --------------------------------------------------------------------------------
325 copy support\$(LONG)\ab.exe "$(INSTDIR)\bin"
326 copy support\$(LONG)\htpasswd.exe "$(INSTDIR)\bin"
327 copy support\$(LONG)\htdigest.exe "$(INSTDIR)\bin"
328 copy support\$(LONG)\logresolve.exe "$(INSTDIR)\bin"
329 copy support\$(LONG)\rotatelogs.exe "$(INSTDIR)\bin"
330 copy support\win32\$(LONG)\ApacheMonitor.exe "$(INSTDIR)\bin"
331 copy support\win32\$(LONG)\wintty.exe "$(INSTDIR)\bin"
332 copy docs\cgi-examples\printenv "$(INSTDIR)\cgi-bin\printenv.pl"
333 -awk -f <<script.awk "docs\cgi-examples\printenv" "$(INSTDIR)\cgi-bin\printenv.pl"
337 if ( "perl -e \"print $$^X;\"" | getline perlroot ) {
338 gsub( /\\/, "/", perlroot );
339 print "#!" perlroot > dstfl;
342 while ( ( getline < srcfl ) > 0 ) {
347 copy docs\cgi-examples\test-cgi.bat "$(INSTDIR)\cgi-bin"
348 xcopy docs\docroot "$(INSTDIR)\htdocs" /d < <<
351 xcopy docs\manual "$(INSTDIR)\htdocs\manual" /s /d < <<
354 xcopy include\*.h "$(INSTDIR)\include" /d < <<
357 xcopy srclib\apr\include\*.h "$(INSTDIR)\include" /d < <<
360 xcopy srclib\apr-util\include\*.h "$(INSTDIR)\include" /d < <<
363 xcopy srclib\pcre\*.h "$(INSTDIR)\include\pcre" /d < <<
366 xcopy docs\icons "$(INSTDIR)\icons" /s /d < <<
369 copy srclib\apr\Lib$(SHORT)\apr.lib "$(INSTDIR)\lib"
370 copy srclib\apr-util\Lib$(SHORT)\aprutil.lib "$(INSTDIR)\lib"
371 copy srclib\pcre\Lib$(SHORT)\pcre.lib "$(INSTDIR)\lib"
372 copy srclib\pcre\Lib$(SHORT)\pcreposix.lib "$(INSTDIR)\lib"
373 copy srclib\apr\$(LONG)\libapr.lib "$(INSTDIR)\libexec"
374 copy srclib\apr\$(LONG)\libapr.exp "$(INSTDIR)\libexec"
375 copy srclib\apr-util\$(LONG)\libaprutil.lib "$(INSTDIR)\libexec"
376 copy srclib\apr-util\$(LONG)\libaprutil.exp "$(INSTDIR)\libexec"
377 copy $(LONG)\libhttpd.exp "$(INSTDIR)\libexec"
378 copy $(LONG)\libhttpd.lib "$(INSTDIR)\libexec"
379 copy modules\dav\main\$(LONG)\mod_dav.exp "$(INSTDIR)\libexec"
380 copy modules\dav\main\$(LONG)\mod_dav.lib "$(INSTDIR)\libexec"
381 copy docs\conf\magic "$(INSTDIR)\conf\magic.default"
382 if not exist "$(INSTDIR)\conf\magic" \
383 copy "$(INSTDIR)\conf\magic.default" "$(INSTDIR)\conf\magic"
384 copy docs\conf\mime.types "$(INSTDIR)\conf\mime.types.default"
385 if not exist "$(INSTDIR)\conf\mime.types" \
386 copy "$(INSTDIR)\conf\mime.types.default" "$(INSTDIR)\conf\mime.types"
387 copy docs\conf\httpd-win.conf "$(INSTDIR)\conf\httpd.default.conf"
388 -awk -f <<script.awk "docs\conf\httpd-win.conf" "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)"
392 serverroot = ARGV[3];
393 gsub( /\\/, "/", serverroot );
394 while ( ( getline < srcfl ) > 0 ) {
395 gsub( /@@ServerRoot@@/, serverroot );
400 if not exist "$(INSTDIR)\conf\httpd.conf" \
401 copy "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)\conf\httpd.conf"
402 awk -f <<script.awk "support\dbmmanage.in" >"$(INSTDIR)\bin\dbmmanage.pl"
403 { if ( $$0 ~ /^BEGIN { @AnyDBM_File::/ ) {
404 sub( /ISA = qw\(.*\)/, "ISA = qw(SDBM_File)" );
406 if ( $$0 !~ /^#!@perlbin@/ )