]> granicus.if.org Git - apache/blob - Makefile.win
Thanks for reminding me the comments had to go too, Bill.
[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 !IF "$(INSTDIR)" == ""
23 INSTDIR=\Apache2.0
24 !MESSAGE Using default install directory \Apache2.0
25 !ENDIF 
26
27 !IFNDEF MAKEOPT
28 # Only default the behavior if MAKEOPT= is omitted
29 !IF "$(MAKE)" == "NMAKE"
30 # Microsoft NMake options
31 MAKEOPT=-nologo
32 !ELSEIF "($MAKE)" == "make"
33 # Borland make options?  Not really supported (yet)
34 MAKEOPT=-s -N
35 !ENDIF
36 !ENDIF
37
38 default:        _apacher
39
40 _apacher: 
41         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build
42
43 _apached: 
44         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug   _build
45
46 installr: 
47         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build _install
48
49 installd: 
50         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug   _build _install
51
52 _cleanr:  
53         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET=CLEAN _build
54
55 _cleand:  
56         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug   CTARGET=CLEAN _build
57
58 clean:
59         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET=CLEAN _build
60         $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug   CTARGET=CLEAN _build
61
62 _build:
63         echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
64         cd srclib\apr
65          $(MAKE) $(MAKEOPT) -f apr.mak CFG="apr - Win32 $(LONG)" RECURSE=0 $(CTARGET)
66          $(MAKE) $(MAKEOPT) -f libapr.mak CFG="libapr - Win32 $(LONG)" RECURSE=0 $(CTARGET)
67         cd ..\..
68         cd srclib\apr-util
69          $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
70          $(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
71         cd ..\..
72         cd srclib\expat-lite
73          $(MAKE) $(MAKEOPT) -f libexpat.mak CFG="libexpat - Win32 $(LONG)" RECURSE=0 $(CTARGET)
74         cd ..\..
75         cd srclib\pcre
76          $(MAKE) $(MAKEOPT) -f dftables.mak CFG="dftables - Win32 $(LONG)" RECURSE=0 $(CTARGET)
77          $(MAKE) $(MAKEOPT) -f pcre.mak CFG="pcre - Win32 $(LONG)" RECURSE=0 $(CTARGET)
78          $(MAKE) $(MAKEOPT) -f pcreposix.mak CFG="pcreposix - Win32 $(LONG)" RECURSE=0 $(CTARGET)
79         cd ..\..
80         cd server
81          $(MAKE) $(MAKEOPT) -f gen_uri_delims.mak CFG="gen_uri_delims - Win32 $(LONG)" RECURSE=0 $(CTARGET)
82          $(MAKE) $(MAKEOPT) -f gen_test_char.mak CFG="gen_test_char - Win32 $(LONG)" RECURSE=0 $(CTARGET)
83         cd ..
84          -del $(LONG)\buildmark.obj
85          $(MAKE) $(MAKEOPT) -f libhttpd.mak CFG="libhttpd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
86          $(MAKE) $(MAKEOPT) -f Apache.mak CFG="Apache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
87         cd modules\aaa
88          $(MAKE) $(MAKEOPT) -f mod_auth_anon.mak CFG="mod_auth_anon - Win32 $(LONG)" RECURSE=0 $(CTARGET)
89          $(MAKE) $(MAKEOPT) -f mod_auth_dbm.mak CFG="mod_auth_dbm - Win32 $(LONG)" RECURSE=0 $(CTARGET)
90          $(MAKE) $(MAKEOPT) -f mod_auth_digest.mak CFG="mod_auth_digest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
91         cd ..\..
92         cd modules\cache
93          $(MAKE) $(MAKEOPT) -f mod_file_cache.mak CFG="mod_file_cache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
94         cd ..\..
95         cd modules\dav\main
96          $(MAKE) $(MAKEOPT) -f mod_dav.mak CFG="mod_dav - Win32 $(LONG)" RECURSE=0 $(CTARGET)
97         cd ..\..\..
98         cd modules\dav\fs
99          $(MAKE) $(MAKEOPT) -f mod_dav_fs.mak CFG="mod_dav_fs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
100         cd ..\..\..
101         cd modules\generators
102 #        $(MAKE) $(MAKEOPT) -f mod_info.mak CFG"=mod_info - Win32 $(LONG)" RECURSE=0 $(CTARGET)
103          $(MAKE) $(MAKEOPT) -f mod_status.mak CFG="mod_status - Win32 $(LONG)" RECURSE=0 $(CTARGET)
104         cd ..\..
105         cd modules\mappers
106          $(MAKE) $(MAKEOPT) -f mod_rewrite.mak CFG="mod_rewrite - Win32 $(LONG)" RECURSE=0 $(CTARGET)
107          $(MAKE) $(MAKEOPT) -f mod_speling.mak CFG="mod_speling - Win32 $(LONG)" RECURSE=0 $(CTARGET)
108         cd ..\..
109         cd modules\metadata
110          $(MAKE) $(MAKEOPT) -f mod_cern_meta.mak CFG="mod_cern_meta - Win32 $(LONG)" RECURSE=0 $(CTARGET)
111          $(MAKE) $(MAKEOPT) -f mod_expires.mak CFG="mod_expires - Win32 $(LONG)" RECURSE=0 $(CTARGET)
112          $(MAKE) $(MAKEOPT) -f mod_headers.mak CFG="mod_headers - Win32 $(LONG)" RECURSE=0 $(CTARGET)
113          $(MAKE) $(MAKEOPT) -f mod_usertrack.mak CFG="mod_usertrack - Win32 $(LONG)" RECURSE=0 $(CTARGET)
114         cd ..\..
115         cd modules\proxy
116 #        $(MAKE) $(MAKEOPT) -f mod_proxy.mak CFG="mod_proxy - Win32 $(LONG)" RECURSE=0 $(CTARGET)
117         cd ..\..
118         cd support
119          $(MAKE) $(MAKEOPT) -f ab.mak CFG="ab - Win32 $(LONG)" RECURSE=0 $(CTARGET)
120          $(MAKE) $(MAKEOPT) -f htpasswd.mak CFG="htpasswd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
121          $(MAKE) $(MAKEOPT) -f htdigest.mak CFG="htdigest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
122          $(MAKE) $(MAKEOPT) -f logresolve.mak CFG="logresolve - Win32 $(LONG)" RECURSE=0 $(CTARGET)
123          $(MAKE) $(MAKEOPT) -f rotatelogs.mak CFG="rotatelogs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
124         cd ..
125
126 _install:
127         -mkdir "$(INSTDIR)"
128         -mkdir "$(INSTDIR)\bin"
129         -mkdir "$(INSTDIR)\cgi-bin"
130         -mkdir "$(INSTDIR)\conf"
131         -mkdir "$(INSTDIR)\htdocs"
132         -mkdir "$(INSTDIR)\htdocs\manual"
133         -mkdir "$(INSTDIR)\icons"
134         -mkdir "$(INSTDIR)\include"
135         -mkdir "$(INSTDIR)\include\xml"
136         -mkdir "$(INSTDIR)\include\pcre"
137         -mkdir "$(INSTDIR)\lib"
138         -mkdir "$(INSTDIR)\libexec"
139         -mkdir "$(INSTDIR)\logs"
140         -mkdir "$(INSTDIR)\modules"
141 #       -mkdir "$(INSTDIR)\proxy"
142         copy $(LONG)\Apache.exe "$(INSTDIR)\bin"
143         copy $(LONG)\libhttpd.dll "$(INSTDIR)\bin"
144         copy srclib\apr\$(LONG)\libapr.dll "$(INSTDIR)\bin"
145         copy srclib\apr-util\$(LONG)\libaprutil.dll "$(INSTDIR)\bin"
146         copy srclib\expat-lite\$(LONG)\libexpat.dll "$(INSTDIR)\bin"
147         copy modules\aaa\$(LONG)\mod_auth_anon.so "$(INSTDIR)\modules"
148         copy modules\aaa\$(LONG)\mod_auth_dbm.so "$(INSTDIR)\modules"
149         copy modules\aaa\$(LONG)\mod_auth_digest.so "$(INSTDIR)\modules"
150         copy modules\cache\$(LONG)\mod_file_cache.so "$(INSTDIR)\modules"
151         copy modules\dav\fs\$(LONG)\mod_dav_fs.so "$(INSTDIR)\modules"
152         copy modules\dav\main\$(LONG)\mod_dav.so "$(INSTDIR)\modules"
153 #       copy modules\generators\$(LONG)\mod_info.so "$(INSTDIR)\modules"
154         copy modules\generators\$(LONG)\mod_status.so "$(INSTDIR)\modules"
155         copy modules\mappers\$(LONG)\mod_rewrite.so "$(INSTDIR)\modules"
156         copy modules\mappers\$(LONG)\mod_speling.so "$(INSTDIR)\modules"
157         copy modules\metadata\$(LONG)\mod_cern_meta.so "$(INSTDIR)\modules"
158         copy modules\metadata\$(LONG)\mod_expires.so "$(INSTDIR)\modules"
159         copy modules\metadata\$(LONG)\mod_headers.so "$(INSTDIR)\modules"
160         copy modules\metadata\$(LONG)\mod_usertrack.so "$(INSTDIR)\modules"
161 #       copy modules\proxy\$(LONG)\mod_proxy.so "$(INSTDIR)\modules"
162         copy support\$(LONG)\ab.exe "$(INSTDIR)\bin"
163         copy support\$(LONG)\htpasswd.exe "$(INSTDIR)\bin"
164         copy support\$(LONG)\htdigest.exe "$(INSTDIR)\bin"
165         copy support\$(LONG)\logresolve.exe "$(INSTDIR)\bin"
166         copy support\$(LONG)\rotatelogs.exe "$(INSTDIR)\bin"
167         copy docs\cgi-examples\printenv "$(INSTDIR)\cgi-bin\printenv.pl"
168         xcopy docs\docroot "$(INSTDIR)\htdocs" /d < <<
169 A
170 <<
171         xcopy docs\manual "$(INSTDIR)\htdocs\manual" /s /d < <<
172 A
173 <<
174         xcopy include\*.h "$(INSTDIR)\include" /d < <<
175 A
176 <<
177         xcopy srclib\apr\include\*.h "$(INSTDIR)\include" /d < <<
178 A
179 <<
180         xcopy srclib\apr-util\include\*.h "$(INSTDIR)\include" /d < <<
181 A
182 <<
183         xcopy srclib\expat-lite\*.h "$(INSTDIR)\include\xml" /d < <<
184 A
185 <<
186         xcopy srclib\pcre\*.h "$(INSTDIR)\include\pcre" /d < <<
187 A
188 <<
189         xcopy docs\icons "$(INSTDIR)\icons" /s /d < <<
190 A
191 <<
192         copy srclib\apr\Lib$(SHORT)\apr.lib "$(INSTDIR)\lib"
193         copy srclib\apr-util\Lib$(SHORT)\aprutil.lib "$(INSTDIR)\lib"
194         copy srclib\pcre\Lib$(SHORT)\pcre.lib "$(INSTDIR)\lib"
195         copy srclib\pcre\Lib$(SHORT)\pcreposix.lib "$(INSTDIR)\lib"
196         copy srclib\apr\$(LONG)\libapr.lib "$(INSTDIR)\libexec"
197         copy srclib\apr\$(LONG)\libapr.exp "$(INSTDIR)\libexec"
198         copy srclib\apr-util\$(LONG)\libaprutil.lib "$(INSTDIR)\libexec"
199         copy srclib\apr-util\$(LONG)\libaprutil.exp "$(INSTDIR)\libexec"
200         copy srclib\expat-lite\$(LONG)\libexpat.lib "$(INSTDIR)\libexec"
201         copy srclib\expat-lite\$(LONG)\libexpat.exp "$(INSTDIR)\libexec"
202         copy $(LONG)\libhttpd.exp "$(INSTDIR)\libexec"
203         copy $(LONG)\libhttpd.lib "$(INSTDIR)\libexec"
204         copy modules\dav\main\$(LONG)\mod_dav.exp "$(INSTDIR)\libexec"
205         copy modules\dav\main\$(LONG)\mod_dav.lib "$(INSTDIR)\libexec"
206         copy docs\conf\magic "$(INSTDIR)\conf\magic.default"
207         if not exist "$(INSTDIR)\conf\magic" \
208             copy "$(INSTDIR)\conf\magic.default" "$(INSTDIR)\conf\magic"
209         copy docs\conf\mime.types "$(INSTDIR)\conf\mime.types.default"
210         if not exist "$(INSTDIR)\conf\mime.types" \
211             copy "$(INSTDIR)\conf\mime.types.default" "$(INSTDIR)\conf\mime.types"
212         awk -f <<script.awk "docs\conf\httpd-win.conf" "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)"
213     BEGIN { 
214         srcfl = ARGV[1];
215         dstfl = ARGV[2];
216         serverroot = ARGV[3];
217         gsub( /\\/, "/", serverroot );
218         while ( ( getline < srcfl ) > 0 ) {
219             gsub( /@@ServerRoot@@/, serverroot );
220             print $$0 > dstfl;
221         }
222     }
223 <<
224         if not exist "$(INSTDIR)\conf\httpd.conf" \
225             copy "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)\conf\httpd.conf"
226         awk -f <<script.awk "support\dbmmanage" >"$(INSTDIR)\bin\dbmmanage.pl"
227     { if ( $$0 !~ /^#.*-lsdbm/) {
228           gsub( /AnyDBM_File::ISA = qw\(.*\)/, "AnyDBM_File::ISA = qw(SDBM_File)" ); 
229       }
230       print $$0;
231     }
232 <<