]> granicus.if.org Git - apache/blob - Makefile.win
Include ApacheMonitor/wintty in the build.
[apache] / Makefile.win
1 # Makefile for Windows NT and Windows 95/98/2000
2
3 # Targets are:
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
11 #
12 # The default installation directory is \Apache2.0. This can be changed
13 # with the INSTDIR macro, for example:
14 #
15 #   nmake /f Makefile.win INSTDIR="d:\Program Files\Apache" installr
16 #
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!
21
22 default:        _apacher
23
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!
28 !MESSAGE 
29 !ERROR Need $(INSTDIR)\srclib\apr
30 !ENDIF
31
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!
36 !MESSAGE 
37 !ERROR Need $(INSTDIR)\srclib\apr-util
38 !ENDIF
39
40 # Note; tryssl: is only used by the msvc developer studio environment to 'fix up'
41 #       the build, since conditional dependencies aren't supported
42 #
43 !IF EXIST("srclib\openssl")
44 !IF "$(LONG)" == "Debug"
45 SSLBIN=out32dll.dbg
46 !ELSE
47 SSLBIN=out32dll
48 !ENDIF
49 tryssl:
50         cd modules\ssl
51         $(MAKE) $(MAKEOPT) -f mod_ssl.mak CFG="mod_ssl - Win32 $(LONG)" RECURSE=0 $(CTARGET)
52         cd ..\..
53         cd modules\tls
54         $(MAKE) $(MAKEOPT) -f mod_tls.mak CFG="mod_tls - Win32 $(LONG)" RECURSE=0 $(CTARGET)
55         cd ..\..
56 !ELSE
57 tryssl:
58         echo mod_ssl and mod_tls will not build without openssl installed
59         echo in $(INSTDIR)\srclib\openssl.  They must be precompiled using
60         echo the ms/ntdll.mak file.  See INSTALL.W32 for details.
61 !ENDIF
62
63 !IF "$(INSTDIR)" == ""
64 INSTDIR=\Apache2
65 !MESSAGE Using default install directory $(INSTDIR)
66 !ENDIF 
67
68 !IFNDEF MAKEOPT
69 # Only default the behavior if MAKEOPT= is omitted
70 !IF "$(MAKE)" == "NMAKE"
71 # Microsoft NMake options
72 MAKEOPT=-nologo
73 !ELSEIF "($MAKE)" == "make"
74 # Borland make options?  Not really supported (yet)
75 MAKEOPT=-s -N
76 !ENDIF
77 !ENDIF
78
79 _apacher: 
80         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build
81
82 _apached: 
83         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug   _build
84
85 installr: 
86         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build _install
87
88 installd: 
89         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug   _build _install
90
91 _cleanr:  
92         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET=CLEAN _build
93
94 _cleand:  
95         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug   CTARGET=CLEAN _build
96
97 clean:
98         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET=CLEAN _build
99         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug   CTARGET=CLEAN _build
100
101 _build:
102         echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
103         cd srclib\apr
104          $(MAKE) $(MAKEOPT) -f apr.mak CFG="apr - Win32 $(LONG)" RECURSE=0 $(CTARGET)
105          $(MAKE) $(MAKEOPT) -f libapr.mak CFG="libapr - Win32 $(LONG)" RECURSE=0 $(CTARGET)
106         cd ..\..
107         cd srclib\apr-util\uri
108          $(MAKE) $(MAKEOPT) -f gen_uri_delims.mak CFG="gen_uri_delims - Win32 $(LONG)" RECURSE=0 $(CTARGET)
109         cd ..\..\..
110         cd srclib\apr-util\xml\expat\lib
111          $(MAKE) $(MAKEOPT) -f xml.mak CFG="xml - Win32 $(LONG)" RECURSE=0 $(CTARGET)
112         cd ..\..\..
113          $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
114          $(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
115         cd ..\..
116         cd srclib\pcre
117          $(MAKE) $(MAKEOPT) -f dftables.mak CFG="dftables - Win32 $(LONG)" RECURSE=0 $(CTARGET)
118          $(MAKE) $(MAKEOPT) -f pcre.mak CFG="pcre - Win32 $(LONG)" RECURSE=0 $(CTARGET)
119          $(MAKE) $(MAKEOPT) -f pcreposix.mak CFG="pcreposix - Win32 $(LONG)" RECURSE=0 $(CTARGET)
120         cd ..\..
121         cd server
122          $(MAKE) $(MAKEOPT) -f gen_test_char.mak CFG="gen_test_char - Win32 $(LONG)" RECURSE=0 $(CTARGET)
123         cd ..
124          -del $(LONG)\buildmark.obj
125          $(MAKE) $(MAKEOPT) -f libhttpd.mak CFG="libhttpd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
126          $(MAKE) $(MAKEOPT) -f Apache.mak CFG="Apache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
127         cd modules\aaa
128          $(MAKE) $(MAKEOPT) -f mod_auth_anon.mak CFG="mod_auth_anon - Win32 $(LONG)" RECURSE=0 $(CTARGET)
129          $(MAKE) $(MAKEOPT) -f mod_auth_dbm.mak CFG="mod_auth_dbm - Win32 $(LONG)" RECURSE=0 $(CTARGET)
130          $(MAKE) $(MAKEOPT) -f mod_auth_digest.mak CFG="mod_auth_digest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
131         cd ..\..
132         cd modules\cache
133          $(MAKE) $(MAKEOPT) -f mod_file_cache.mak CFG="mod_file_cache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
134         cd ..\..
135         cd modules\dav\main
136          $(MAKE) $(MAKEOPT) -f mod_dav.mak CFG="mod_dav - Win32 $(LONG)" RECURSE=0 $(CTARGET)
137         cd ..\..\..
138         cd modules\dav\fs
139          $(MAKE) $(MAKEOPT) -f mod_dav_fs.mak CFG="mod_dav_fs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
140         cd ..\..\..
141         cd modules\generators
142          $(MAKE) $(MAKEOPT) -f mod_info.mak CFG"=mod_info - Win32 $(LONG)" RECURSE=0 $(CTARGET)
143          $(MAKE) $(MAKEOPT) -f mod_status.mak CFG="mod_status - Win32 $(LONG)" RECURSE=0 $(CTARGET)
144         cd ..\..
145         cd modules\mappers
146          $(MAKE) $(MAKEOPT) -f mod_rewrite.mak CFG="mod_rewrite - Win32 $(LONG)" RECURSE=0 $(CTARGET)
147          $(MAKE) $(MAKEOPT) -f mod_speling.mak CFG="mod_speling - Win32 $(LONG)" RECURSE=0 $(CTARGET)
148         cd ..\..
149         cd modules\metadata
150          $(MAKE) $(MAKEOPT) -f mod_cern_meta.mak CFG="mod_cern_meta - Win32 $(LONG)" RECURSE=0 $(CTARGET)
151          $(MAKE) $(MAKEOPT) -f mod_expires.mak CFG="mod_expires - Win32 $(LONG)" RECURSE=0 $(CTARGET)
152          $(MAKE) $(MAKEOPT) -f mod_headers.mak CFG="mod_headers - Win32 $(LONG)" RECURSE=0 $(CTARGET)
153          $(MAKE) $(MAKEOPT) -f mod_usertrack.mak CFG="mod_usertrack - Win32 $(LONG)" RECURSE=0 $(CTARGET)
154         cd ..\..
155 #       cd modules\proxy
156 #        $(MAKE) $(MAKEOPT) -f mod_proxy.mak CFG="mod_proxy - Win32 $(LONG)" RECURSE=0 $(CTARGET)
157 #       cd ..\..
158 !IF EXIST("srclib\openssl")
159         cd modules\ssl
160         $(MAKE) $(MAKEOPT) -f mod_ssl.mak CFG="mod_ssl - Win32 $(LONG)" RECURSE=0 $(CTARGET)
161         cd ..\..
162         cd modules\tls
163         $(MAKE) $(MAKEOPT) -f mod_tls.mak CFG="mod_tls - Win32 $(LONG)" RECURSE=0 $(CTARGET)
164         cd ..\..
165 !ENDIF
166         cd support
167          $(MAKE) $(MAKEOPT) -f ab.mak CFG="ab - Win32 $(LONG)" RECURSE=0 $(CTARGET)
168          $(MAKE) $(MAKEOPT) -f htpasswd.mak CFG="htpasswd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
169          $(MAKE) $(MAKEOPT) -f htdigest.mak CFG="htdigest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
170          $(MAKE) $(MAKEOPT) -f logresolve.mak CFG="logresolve - Win32 $(LONG)" RECURSE=0 $(CTARGET)
171          $(MAKE) $(MAKEOPT) -f rotatelogs.mak CFG="rotatelogs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
172         cd ..
173         cd support\win32
174          $(MAKE) $(MAKEOPT) -f ApacheMonitor.mak CFG="ApacheMonitor - Win32 $(LONG)" RECURSE=0 $(CTARGET)
175          $(MAKE) $(MAKEOPT) -f wintty.mak CFG="wintty - Win32 $(LONG)" RECURSE=0 $(CTARGET)
176         cd ..\..
177
178 _install:
179         -mkdir "$(INSTDIR)"
180         -mkdir "$(INSTDIR)\bin"
181         -mkdir "$(INSTDIR)\cgi-bin"
182         -mkdir "$(INSTDIR)\conf"
183         -mkdir "$(INSTDIR)\htdocs"
184         -mkdir "$(INSTDIR)\htdocs\manual"
185         -mkdir "$(INSTDIR)\icons"
186         -mkdir "$(INSTDIR)\include"
187         -mkdir "$(INSTDIR)\include\xml"
188         -mkdir "$(INSTDIR)\include\pcre"
189         -mkdir "$(INSTDIR)\lib"
190         -mkdir "$(INSTDIR)\libexec"
191         -mkdir "$(INSTDIR)\logs"
192         -mkdir "$(INSTDIR)\modules"
193 #       -mkdir "$(INSTDIR)\proxy"
194         copy $(LONG)\Apache.exe "$(INSTDIR)\bin"
195         copy $(LONG)\libhttpd.dll "$(INSTDIR)\bin"
196         copy srclib\apr\$(LONG)\libapr.dll "$(INSTDIR)\bin"
197         copy srclib\apr-util\$(LONG)\libaprutil.dll "$(INSTDIR)\bin"
198         copy modules\aaa\$(LONG)\mod_auth_anon.so "$(INSTDIR)\modules"
199         copy modules\aaa\$(LONG)\mod_auth_dbm.so "$(INSTDIR)\modules"
200         copy modules\aaa\$(LONG)\mod_auth_digest.so "$(INSTDIR)\modules"
201         copy modules\cache\$(LONG)\mod_file_cache.so "$(INSTDIR)\modules"
202         copy modules\dav\fs\$(LONG)\mod_dav_fs.so "$(INSTDIR)\modules"
203         copy modules\dav\main\$(LONG)\mod_dav.so "$(INSTDIR)\modules"
204         copy modules\generators\$(LONG)\mod_info.so "$(INSTDIR)\modules"
205         copy modules\generators\$(LONG)\mod_status.so "$(INSTDIR)\modules"
206         copy modules\mappers\$(LONG)\mod_rewrite.so "$(INSTDIR)\modules"
207         copy modules\mappers\$(LONG)\mod_speling.so "$(INSTDIR)\modules"
208         copy modules\metadata\$(LONG)\mod_cern_meta.so "$(INSTDIR)\modules"
209         copy modules\metadata\$(LONG)\mod_expires.so "$(INSTDIR)\modules"
210         copy modules\metadata\$(LONG)\mod_headers.so "$(INSTDIR)\modules"
211         copy modules\metadata\$(LONG)\mod_usertrack.so "$(INSTDIR)\modules"
212 #       copy modules\proxy\$(LONG)\mod_proxy.so "$(INSTDIR)\modules"
213 !IF EXIST("srclib\openssl")
214         -copy modules\ssl\$(LONG)\mod_ssl.so "$(INSTDIR)\modules"
215         -copy modules\tls\$(LONG)\mod_tls.so "$(INSTDIR)\modules"
216         -copy srclib\openssl\$(SSLBIN)\openssl.exe "$(INSTDIR)\bin"
217         -copy srclib\openssl\$(SSLBIN)\libeay32.dll "$(INSTDIR)\bin"
218         -copy srclib\openssl\$(SSLBIN)\ssleay32.dll "$(INSTDIR)\bin"
219 !ENDIF
220         copy support\$(LONG)\ "$(INSTDIR)\bin"
221         copy support\$(LONG)\ab.exe "$(INSTDIR)\bin"
222         copy support\$(LONG)\htpasswd.exe "$(INSTDIR)\bin"
223         copy support\$(LONG)\htdigest.exe "$(INSTDIR)\bin"
224         copy support\$(LONG)\logresolve.exe "$(INSTDIR)\bin"
225         copy support\$(LONG)\rotatelogs.exe "$(INSTDIR)\bin"
226         copy support\win32\$(LONG)\ApacheMonitor.exe "$(INSTDIR)\bin"
227         copy support\win32\$(LONG)\wintty.exe "$(INSTDIR)\bin"
228         copy docs\cgi-examples\printenv "$(INSTDIR)\cgi-bin\printenv.pl"
229         -awk -f <<script.awk "docs\cgi-examples\printenv" "$(INSTDIR)\cgi-bin\printenv.pl"
230     BEGIN { 
231         srcfl = ARGV[1];
232         dstfl = ARGV[2];
233         if ( "perl -e \"print $$^X;\"" | getline perlroot ) {
234             gsub( /\\/, "/", perlroot );
235             print "#!" perlroot > dstfl;
236             getline < srcfl;
237         }
238         while ( ( getline < srcfl ) > 0 ) {
239             print $$0 > dstfl;
240         }
241     }
242 <<
243         copy docs\cgi-examples\test-cgi.bat "$(INSTDIR)\cgi-bin"
244         xcopy docs\docroot "$(INSTDIR)\htdocs" /d < <<
245 A
246 <<
247         xcopy docs\manual "$(INSTDIR)\htdocs\manual" /s /d < <<
248 A
249 <<
250         xcopy include\*.h "$(INSTDIR)\include" /d < <<
251 A
252 <<
253         xcopy srclib\apr\include\*.h "$(INSTDIR)\include" /d < <<
254 A
255 <<
256         xcopy srclib\apr-util\include\*.h "$(INSTDIR)\include" /d < <<
257 A
258 <<
259         xcopy srclib\pcre\*.h "$(INSTDIR)\include\pcre" /d < <<
260 A
261 <<
262         xcopy docs\icons "$(INSTDIR)\icons" /s /d < <<
263 A
264 <<
265         copy srclib\apr\Lib$(SHORT)\apr.lib "$(INSTDIR)\lib"
266         copy srclib\apr-util\Lib$(SHORT)\aprutil.lib "$(INSTDIR)\lib"
267         copy srclib\pcre\Lib$(SHORT)\pcre.lib "$(INSTDIR)\lib"
268         copy srclib\pcre\Lib$(SHORT)\pcreposix.lib "$(INSTDIR)\lib"
269         copy srclib\apr\$(LONG)\libapr.lib "$(INSTDIR)\libexec"
270         copy srclib\apr\$(LONG)\libapr.exp "$(INSTDIR)\libexec"
271         copy srclib\apr-util\$(LONG)\libaprutil.lib "$(INSTDIR)\libexec"
272         copy srclib\apr-util\$(LONG)\libaprutil.exp "$(INSTDIR)\libexec"
273         copy $(LONG)\libhttpd.exp "$(INSTDIR)\libexec"
274         copy $(LONG)\libhttpd.lib "$(INSTDIR)\libexec"
275         copy modules\dav\main\$(LONG)\mod_dav.exp "$(INSTDIR)\libexec"
276         copy modules\dav\main\$(LONG)\mod_dav.lib "$(INSTDIR)\libexec"
277         copy docs\conf\magic "$(INSTDIR)\conf\magic.default"
278         if not exist "$(INSTDIR)\conf\magic" \
279             copy "$(INSTDIR)\conf\magic.default" "$(INSTDIR)\conf\magic"
280         copy docs\conf\mime.types "$(INSTDIR)\conf\mime.types.default"
281         if not exist "$(INSTDIR)\conf\mime.types" \
282             copy "$(INSTDIR)\conf\mime.types.default" "$(INSTDIR)\conf\mime.types"
283         copy docs\conf\httpd-win.conf "$(INSTDIR)\conf\httpd.default.conf"
284         -awk -f <<script.awk "docs\conf\httpd-win.conf" "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)"
285     BEGIN { 
286         srcfl = ARGV[1];
287         dstfl = ARGV[2];
288         serverroot = ARGV[3];
289         gsub( /\\/, "/", serverroot );
290         while ( ( getline < srcfl ) > 0 ) {
291             gsub( /@@ServerRoot@@/, serverroot );
292             print $$0 > dstfl;
293         }
294     }
295 <<
296         if not exist "$(INSTDIR)\conf\httpd.conf" \
297             copy "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)\conf\httpd.conf"
298         awk -f <<script.awk "support\dbmmanage.in" >"$(INSTDIR)\bin\dbmmanage.pl"
299     { if ( $$0 ~ /^BEGIN { @AnyDBM_File::/ ) {
300           sub( /ISA = qw\(.*\)/, "ISA = qw(SDBM_File)" ); 
301       }
302       if ( $$0 !~ /^#!@perlbin@/ )
303           print $$0;
304     }
305 <<