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 $(MAKE) $(MAKEOPT) -f abs.mak CFG="abs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
61 msdev Apache.dsw /MAKE\
62 "mod_ssl - Win32 $(LONG)"\
63 "mod_tls - Win32 $(LONG)"\
64 "abs - Win32 $(LONG)" /NORECURSE $(CTARGET)
69 echo mod_ssl, mod_tls and ab/ssl will not build without openssl
70 echo installed in $(INSTDIR)\srclib\openssl. They must be precompiled
71 echo using the ms/ntdll.mak file. See INSTALL.W32 for details.
74 !IF "$(INSTDIR)" == ""
76 !MESSAGE Using default install directory $(INSTDIR)
80 # Only default the behavior if MAKEOPT= is omitted
81 !IF "$(MAKE)" == "NMAKE"
82 # Microsoft NMake options
84 !ELSEIF "($MAKE)" == "make"
85 # Borland make options? Not really supported (yet)
91 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build
94 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug _build
97 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build _install
100 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug _build _install
102 clean: _cleanr _cleand
104 !IF EXIST("Apache.mak")
107 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET=CLEAN _build
110 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug CTARGET=CLEAN _build
113 echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
115 $(MAKE) $(MAKEOPT) -f apr.mak CFG="apr - Win32 $(LONG)" RECURSE=0 $(CTARGET)
116 $(MAKE) $(MAKEOPT) -f libapr.mak CFG="libapr - Win32 $(LONG)" RECURSE=0 $(CTARGET)
118 cd srclib\apr-util\uri
119 $(MAKE) $(MAKEOPT) -f gen_uri_delims.mak CFG="gen_uri_delims - Win32 $(LONG)" RECURSE=0 $(CTARGET)
121 cd srclib\apr-util\xml\expat\lib
122 $(MAKE) $(MAKEOPT) -f xml.mak CFG="xml - Win32 $(LONG)" RECURSE=0 $(CTARGET)
124 $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
125 $(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
128 $(MAKE) $(MAKEOPT) -f dftables.mak CFG="dftables - Win32 $(LONG)" RECURSE=0 $(CTARGET)
129 $(MAKE) $(MAKEOPT) -f pcre.mak CFG="pcre - Win32 $(LONG)" RECURSE=0 $(CTARGET)
130 $(MAKE) $(MAKEOPT) -f pcreposix.mak CFG="pcreposix - Win32 $(LONG)" RECURSE=0 $(CTARGET)
133 $(MAKE) $(MAKEOPT) -f gen_test_char.mak CFG="gen_test_char - Win32 $(LONG)" RECURSE=0 $(CTARGET)
135 -del $(LONG)\buildmark.obj
136 $(MAKE) $(MAKEOPT) -f libhttpd.mak CFG="libhttpd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
137 $(MAKE) $(MAKEOPT) -f Apache.mak CFG="Apache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
139 $(MAKE) $(MAKEOPT) -f mod_auth_anon.mak CFG="mod_auth_anon - Win32 $(LONG)" RECURSE=0 $(CTARGET)
140 $(MAKE) $(MAKEOPT) -f mod_auth_dbm.mak CFG="mod_auth_dbm - Win32 $(LONG)" RECURSE=0 $(CTARGET)
141 $(MAKE) $(MAKEOPT) -f mod_auth_digest.mak CFG="mod_auth_digest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
144 $(MAKE) $(MAKEOPT) -f mod_file_cache.mak CFG="mod_file_cache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
147 $(MAKE) $(MAKEOPT) -f mod_dav.mak CFG="mod_dav - Win32 $(LONG)" RECURSE=0 $(CTARGET)
150 $(MAKE) $(MAKEOPT) -f mod_dav_fs.mak CFG="mod_dav_fs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
152 cd modules\generators
153 $(MAKE) $(MAKEOPT) -f mod_info.mak CFG"=mod_info - Win32 $(LONG)" RECURSE=0 $(CTARGET)
154 $(MAKE) $(MAKEOPT) -f mod_status.mak CFG="mod_status - Win32 $(LONG)" RECURSE=0 $(CTARGET)
157 $(MAKE) $(MAKEOPT) -f mod_rewrite.mak CFG="mod_rewrite - Win32 $(LONG)" RECURSE=0 $(CTARGET)
158 $(MAKE) $(MAKEOPT) -f mod_speling.mak CFG="mod_speling - Win32 $(LONG)" RECURSE=0 $(CTARGET)
161 $(MAKE) $(MAKEOPT) -f mod_cern_meta.mak CFG="mod_cern_meta - Win32 $(LONG)" RECURSE=0 $(CTARGET)
162 $(MAKE) $(MAKEOPT) -f mod_expires.mak CFG="mod_expires - Win32 $(LONG)" RECURSE=0 $(CTARGET)
163 $(MAKE) $(MAKEOPT) -f mod_headers.mak CFG="mod_headers - Win32 $(LONG)" RECURSE=0 $(CTARGET)
164 $(MAKE) $(MAKEOPT) -f mod_usertrack.mak CFG="mod_usertrack - Win32 $(LONG)" RECURSE=0 $(CTARGET)
167 # $(MAKE) $(MAKEOPT) -f mod_proxy.mak CFG="mod_proxy - Win32 $(LONG)" RECURSE=0 $(CTARGET)
169 !IF EXIST("srclib\openssl")
171 $(MAKE) $(MAKEOPT) -f mod_ssl.mak CFG="mod_ssl - Win32 $(LONG)" RECURSE=0 $(CTARGET)
174 $(MAKE) $(MAKEOPT) -f mod_tls.mak CFG="mod_tls - Win32 $(LONG)" RECURSE=0 $(CTARGET)
177 $(MAKE) $(MAKEOPT) -f abs.mak CFG="abs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
181 $(MAKE) $(MAKEOPT) -f ab.mak CFG="ab - Win32 $(LONG)" RECURSE=0 $(CTARGET)
182 $(MAKE) $(MAKEOPT) -f htpasswd.mak CFG="htpasswd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
183 $(MAKE) $(MAKEOPT) -f htdigest.mak CFG="htdigest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
184 $(MAKE) $(MAKEOPT) -f logresolve.mak CFG="logresolve - Win32 $(LONG)" RECURSE=0 $(CTARGET)
185 $(MAKE) $(MAKEOPT) -f rotatelogs.mak CFG="rotatelogs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
188 $(MAKE) $(MAKEOPT) -f ApacheMonitor.mak CFG="ApacheMonitor - Win32 $(LONG)" RECURSE=0 $(CTARGET)
189 $(MAKE) $(MAKEOPT) -f wintty.mak CFG="wintty - Win32 $(LONG)" RECURSE=0 $(CTARGET)
195 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET="/CLEAN" _build
198 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug CTARGET="/CLEAN" _build
201 echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
202 -del $(LONG)\buildmark.obj
203 msdev Apache.dsw /MAKE\
204 "apr - Win32 $(LONG)"\
205 "libapr - Win32 $(LONG)"\
206 "gen_uri_delims - Win32 $(LONG)"\
207 "xml - Win32 $(LONG)"\
208 "aprutil - Win32 $(LONG)"\
209 "libaprutil - Win32 $(LONG)"\
210 "dftables - Win32 $(LONG)"\
211 "pcre - Win32 $(LONG)"\
212 "pcreposix - Win32 $(LONG)"\
213 "gen_test_char - Win32 $(LONG)"\
214 "libhttpd - Win32 $(LONG)"\
215 "Apache - Win32 $(LONG)"\
216 "mod_auth_anon - Win32 $(LONG)"\
217 "mod_auth_dbm - Win32 $(LONG)"\
218 "mod_auth_digest - Win32 $(LONG)"\
219 "mod_file_cache - Win32 $(LONG)"\
220 "mod_dav - Win32 $(LONG)"\
221 "mod_dav_fs - Win32 $(LONG)"\
222 "mod_info - Win32 $(LONG)"\
223 "mod_status - Win32 $(LONG)"\
224 "mod_rewrite - Win32 $(LONG)"\
225 "mod_speling - Win32 $(LONG)"\
226 "mod_cern_meta - Win32 $(LONG)"\
227 "mod_expires - Win32 $(LONG)"\
228 "mod_headers - Win32 $(LONG)"\
229 "mod_usertrack - Win32 $(LONG)"\
230 "ab - Win32 $(LONG)"\
231 "htpasswd - Win32 $(LONG)"\
232 "htdigest - Win32 $(LONG)"\
233 "logresolve - Win32 $(LONG)"\
234 "rotatelogs - Win32 $(LONG)"\
235 "ApacheMonitor - Win32 $(LONG)"\
236 "wintty - Win32 $(LONG)" /NORECURSE $(CTARGET)
237 !IF EXIST("srclib\openssl")
238 msdev Apache.dsw /MAKE\
239 "mod_ssl - Win32 $(LONG)"\
240 "mod_tls - Win32 $(LONG)"\
241 "abs - Win32 $(LONG)" /NORECURSE $(CTARGET)
248 -mkdir "$(INSTDIR)\bin"
249 -mkdir "$(INSTDIR)\cgi-bin"
250 -mkdir "$(INSTDIR)\conf"
251 -mkdir "$(INSTDIR)\error"
252 -mkdir "$(INSTDIR)\htdocs"
253 -mkdir "$(INSTDIR)\htdocs\manual"
254 -mkdir "$(INSTDIR)\icons"
255 -mkdir "$(INSTDIR)\include"
256 -mkdir "$(INSTDIR)\lib"
257 -mkdir "$(INSTDIR)\logs"
258 -mkdir "$(INSTDIR)\modules"
259 # -mkdir "$(INSTDIR)\proxy"
260 copy ABOUT_APACHE "$(INSTDIR)\ABOUT_APACHE.txt"
261 copy CHANGES "$(INSTDIR)\CHANGES.txt"
262 copy INSTALL "$(INSTDIR)\INSTALL.txt"
263 copy LICENSE "$(INSTDIR)\LICENSE.txt"
264 !IF EXIST("srclib\openssl")
265 copy << + README "$(INSTDIR)\README.txt"
267 This product includes cryptographic software written by
268 Eric Young (eay@cryptsoft.com). This product includes software written
269 by Tim Hudson (tjh@cryptsoft.com). This product includes software
270 developed by the OpenSSL Project for use in the OpenSSL Toolkit.
271 (http://www.openssl.org/)
274 # --- just a vanilla copy, in this case.
275 copy README "$(INSTDIR)\README.txt"
277 copy $(LONG)\Apache.exe "$(INSTDIR)\bin"
278 copy $(LONG)\libhttpd.dll "$(INSTDIR)\bin"
279 copy srclib\apr\$(LONG)\libapr.dll "$(INSTDIR)\bin"
280 copy srclib\apr-util\$(LONG)\libaprutil.dll "$(INSTDIR)\bin"
281 copy modules\aaa\$(LONG)\mod_auth_anon.so "$(INSTDIR)\modules"
282 copy modules\aaa\$(LONG)\mod_auth_dbm.so "$(INSTDIR)\modules"
283 copy modules\aaa\$(LONG)\mod_auth_digest.so "$(INSTDIR)\modules"
284 copy modules\cache\$(LONG)\mod_file_cache.so "$(INSTDIR)\modules"
285 copy modules\dav\fs\$(LONG)\mod_dav_fs.so "$(INSTDIR)\modules"
286 copy modules\dav\main\$(LONG)\mod_dav.so "$(INSTDIR)\modules"
287 copy modules\generators\$(LONG)\mod_info.so "$(INSTDIR)\modules"
288 copy modules\generators\$(LONG)\mod_status.so "$(INSTDIR)\modules"
289 copy modules\mappers\$(LONG)\mod_rewrite.so "$(INSTDIR)\modules"
290 copy modules\mappers\$(LONG)\mod_speling.so "$(INSTDIR)\modules"
291 copy modules\metadata\$(LONG)\mod_cern_meta.so "$(INSTDIR)\modules"
292 copy modules\metadata\$(LONG)\mod_expires.so "$(INSTDIR)\modules"
293 copy modules\metadata\$(LONG)\mod_headers.so "$(INSTDIR)\modules"
294 copy modules\metadata\$(LONG)\mod_usertrack.so "$(INSTDIR)\modules"
295 # copy modules\proxy\$(LONG)\mod_proxy.so "$(INSTDIR)\modules"
296 !IF EXIST("srclib\openssl")
297 -copy modules\ssl\$(LONG)\mod_ssl.so "$(INSTDIR)\modules"
298 -copy modules\tls\$(LONG)\mod_tls.so "$(INSTDIR)\modules"
299 -copy srclib\openssl\$(SSLBIN)\openssl.exe "$(INSTDIR)\bin"
300 -copy srclib\openssl\$(SSLBIN)\libeay32.dll "$(INSTDIR)\bin"
301 -copy srclib\openssl\$(SSLBIN)\ssleay32.dll "$(INSTDIR)\bin"
302 -copy srclib\openssl\LICENSE "$(INSTDIR)\OPENSSL-LICENSE.txt"
303 -copy << + srclib\openssl\NEWS "$(INSTDIR)\OPENSSL-NEWS.txt"
305 Apache HTTP Server 2.0 Limited OpenSSL Distribution 17 Aug 2001
307 This binary distribution includes the minimal components of OpenSSL required
308 to support mod_ssl and mod_tls for Apache HTTP Server version 2.0 (details
309 are listed in OPENSSL-README.txt.) For the complete list of CHANGES to this
310 and later versions of OpenSSL, please refer to the definative source,
311 <http://www.openssl.org/news/changelog.html>, or see the CHANGES file in the
312 full binary or source distribution package from <http://www.openssl.org/>.
314 These OpenSSL binaries were built for distribution from the U.S. without
315 support for the patented encryption methods IDEA, MDC-2 or RC5.
317 --------------------------------------------------------------------------------
319 -copy << + srclib\openssl\README "$(INSTDIR)\OPENSSL-README.txt"
321 Apache HTTP Server 2.0 Limited OpenSSL Distribution 19 Aug 2001
323 This binary installation of OpenSSL is a limited distribution of the documents
324 OPENSSL-LICENSE.txt, OPENSSL-NEWS.txt and OPENSSL-README.txt, and the binaries
330 These are the minimal libraries and tools required to use mod_ssl or mod_tls
331 as distributed with Apache HTTP Server version 2.0. No library files, headers
332 or sources are distributed with this binary distribution. Please refer to the
333 <http://www.openssl.org/> site for complete source or binary distributions.
335 These OpenSSL binaries were built for distribution from the U.S. without
336 support for the patented encryption methods IDEA, MDC-2 or RC5.
338 The Apache HTTP Project only supports the binary distribution of these files
339 and development of the mod_ssl and mod_tls modules. We cannot provide support
340 assistance for using or configuring the OpenSSL package or these modules.
341 Please refer all installation and configuration questions to the appropriate
342 forum, such as the user supported newsgroups comp.infosystems.www.servers.unix
343 or comp.infosystems.www.servers.ms-windows, or see the support options listed
344 at <http://www.openssl.org/support/>.
346 --------------------------------------------------------------------------------
348 copy support\$(LONG)\abs.exe "$(INSTDIR)\bin\ab.exe"
350 copy support\$(LONG)\ab.exe "$(INSTDIR)\bin"
352 copy support\$(LONG)\htpasswd.exe "$(INSTDIR)\bin"
353 copy support\$(LONG)\htdigest.exe "$(INSTDIR)\bin"
354 copy support\$(LONG)\logresolve.exe "$(INSTDIR)\bin"
355 copy support\$(LONG)\rotatelogs.exe "$(INSTDIR)\bin"
356 copy support\win32\$(LONG)\ApacheMonitor.exe "$(INSTDIR)\bin"
357 copy support\win32\$(LONG)\wintty.exe "$(INSTDIR)\bin"
358 copy docs\cgi-examples\printenv "$(INSTDIR)\cgi-bin\printenv.pl"
359 -awk -f <<script.awk "docs\cgi-examples\printenv" "$(INSTDIR)\cgi-bin\printenv.pl"
363 if ( "perl -e \"print $$^X;\"" | getline perlroot ) {
364 gsub( /\\/, "/", perlroot );
365 print "#!" perlroot > dstfl;
368 while ( ( getline < srcfl ) > 0 ) {
373 copy docs\cgi-examples\test-cgi.bat "$(INSTDIR)\cgi-bin"
374 xcopy docs\error "$(INSTDIR)\error" /s /d < <<
377 xcopy docs\docroot "$(INSTDIR)\htdocs" /d < <<
380 xcopy docs\manual "$(INSTDIR)\htdocs\manual" /s /d < <<
383 xcopy srclib\pcre\pcre*.h "$(INSTDIR)\include" /d < <<
386 copy srclib\apr-util\xml\expat\lib\expat.h "$(INSTDIR)\include"
387 xcopy srclib\apr\include\*.h "$(INSTDIR)\include" /d < <<
390 xcopy srclib\apr-util\include\*.h "$(INSTDIR)\include" /d < <<
393 xcopy include\*.h "$(INSTDIR)\include" /d < <<
396 xcopy docs\icons "$(INSTDIR)\icons" /s /d < <<
399 copy srclib\apr\Lib$(SHORT)\apr.lib "$(INSTDIR)\lib"
400 copy srclib\apr-util\Lib$(SHORT)\aprutil.lib "$(INSTDIR)\lib"
401 copy srclib\pcre\Lib$(SHORT)\pcre.lib "$(INSTDIR)\lib"
402 copy srclib\pcre\Lib$(SHORT)\pcreposix.lib "$(INSTDIR)\lib"
403 # ### until we determine if it's safe to change expat>libexpat and xml>expat
404 # within our cvs tree... at least remain consistent to our naming conventions;
405 copy srclib\apr-util\xml\expat\lib\Lib$(SHORT)\xml.lib "$(INSTDIR)\lib\expat.lib"
406 copy srclib\apr\$(LONG)\libapr.lib "$(INSTDIR)\lib"
407 copy srclib\apr\$(LONG)\libapr.exp "$(INSTDIR)\lib"
408 copy srclib\apr-util\$(LONG)\libaprutil.lib "$(INSTDIR)\lib"
409 copy srclib\apr-util\$(LONG)\libaprutil.exp "$(INSTDIR)\lib"
410 copy $(LONG)\libhttpd.exp "$(INSTDIR)\lib"
411 copy $(LONG)\libhttpd.lib "$(INSTDIR)\lib"
412 copy modules\dav\main\$(LONG)\mod_dav.exp "$(INSTDIR)\lib"
413 copy modules\dav\main\$(LONG)\mod_dav.lib "$(INSTDIR)\lib"
414 copy docs\conf\magic "$(INSTDIR)\conf\magic.default"
415 if not exist "$(INSTDIR)\conf\magic" \
416 copy "$(INSTDIR)\conf\magic.default" "$(INSTDIR)\conf\magic"
417 copy docs\conf\mime.types "$(INSTDIR)\conf\mime.types.default"
418 if not exist "$(INSTDIR)\conf\mime.types" \
419 copy "$(INSTDIR)\conf\mime.types.default" "$(INSTDIR)\conf\mime.types"
420 copy docs\conf\httpd-win.conf "$(INSTDIR)\conf\httpd.default.conf"
421 -awk -f <<script.awk "docs\conf\httpd-win.conf" "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)"
425 serverroot = ARGV[3];
426 gsub( /\\/, "/", serverroot );
427 while ( ( getline < srcfl ) > 0 ) {
428 gsub( /@@ServerRoot@@/, serverroot );
433 if not exist "$(INSTDIR)\conf\httpd.conf" \
434 copy "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)\conf\httpd.conf"
435 awk -f <<script.awk "support\dbmmanage.in" >"$(INSTDIR)\bin\dbmmanage.pl"
436 { if ( $$0 ~ /^BEGIN { @AnyDBM_File::/ ) {
437 sub( /ISA = qw\(.*\)/, "ISA = qw(SDBM_File)" );
439 if ( $$0 !~ /^#!@perlbin@/ )