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 \Apache. 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"
19 !IF "$(INSTDIR)" == ""
21 !MESSAGE Using default install directory \Apache
25 # Only default the behavior if MAKEOPT= is omitted
26 !IF "$(MAKE)" == "NMAKE"
27 # Microsoft NMake options
29 !ELSEIF "($MAKE)" == "make"
30 # Borland make options? Not really supported (yet)
38 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build
41 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug _build
44 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release _build _install
47 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug _build _install
50 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET=CLEAN _build
53 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug CTARGET=CLEAN _build
56 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=R LONG=Release CTARGET=CLEAN _build
57 $(MAKE) $(MAKEOPT) -f Makefile.win SHORT=D LONG=Debug CTARGET=CLEAN _build
60 echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
62 # aprlibdll creates the dynamic aprlib.dll from the static library project aprlib.dsp
63 $(MAKE) $(MAKEOPT) -f aprlib.mak CFG="aprlib - Win32 $(LONG)" RECURSE=0 $(CTARGET)
64 $(MAKE) $(MAKEOPT) -f aprlibdll.mak CFG="aprlibdll - Win32 $(LONG)" RECURSE=0 $(CTARGET)
67 # aprutildll creates the dynamic apr-util.dll from the static library project aprutil.dsp
68 $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - Win32 $(LONG)" RECURSE=0 $(CTARGET)
69 $(MAKE) $(MAKEOPT) -f aprutildll.mak CFG="aprutildll - Win32 $(LONG)" RECURSE=0 $(CTARGET)
72 $(MAKE) $(MAKEOPT) -f expatlib.mak CFG="expatlib - Win32 $(LONG)" RECURSE=0 $(CTARGET)
75 $(MAKE) $(MAKEOPT) -f dftables.mak CFG="dftables - Win32 $(LONG)" RECURSE=0 $(CTARGET)
76 $(MAKE) $(MAKEOPT) -f pcre.mak CFG="pcre - Win32 $(LONG)" RECURSE=0 $(CTARGET)
77 $(MAKE) $(MAKEOPT) -f pcreposix.mak CFG="pcreposix - Win32 $(LONG)" RECURSE=0 $(CTARGET)
80 $(MAKE) $(MAKEOPT) -f gen_uri_delims.mak CFG="gen_uri_delims - Win32 $(LONG)" RECURSE=0 $(CTARGET)
81 $(MAKE) $(MAKEOPT) -f gen_test_char.mak CFG="gen_test_char - Win32 $(LONG)" RECURSE=0 $(CTARGET)
83 -del Core$(SHORT)\buildmark.obj
84 # ApacheCoreDll creates the dynamic ApacheCore.dll from the static library project ApacheCore
85 $(MAKE) $(MAKEOPT) -f ApacheCore.mak CFG="ApacheCore - Win32 $(LONG)" RECURSE=0 $(CTARGET)
86 $(MAKE) $(MAKEOPT) -f ApacheCoreDll.mak CFG="ApacheCoreDll - Win32 $(LONG)" RECURSE=0 $(CTARGET)
87 $(MAKE) $(MAKEOPT) -f Apache.mak CFG="Apache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
89 $(MAKE) $(MAKEOPT) -f mod_auth_anon.mak CFG="mod_auth_anon - Win32 $(LONG)" RECURSE=0 $(CTARGET)
90 $(MAKE) $(MAKEOPT) -f mod_auth_dbm.mak CFG="mod_auth_dbm - Win32 $(LONG)" RECURSE=0 $(CTARGET)
91 $(MAKE) $(MAKEOPT) -f mod_auth_digest.mak CFG="mod_auth_digest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
94 $(MAKE) $(MAKEOPT) -f mod_file_cache.mak CFG="mod_file_cache - Win32 $(LONG)" RECURSE=0 $(CTARGET)
97 $(MAKE) $(MAKEOPT) -f mod_dav.mak CFG="mod_dav - Win32 $(LONG)" RECURSE=0 $(CTARGET)
100 $(MAKE) $(MAKEOPT) -f mod_dav_fs.mak CFG="mod_dav_fs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
102 cd modules\generators
103 # $(MAKE) $(MAKEOPT) -f mod_info.mak CFG"=mod_info - Win32 $(LONG)" RECURSE=0 $(CTARGET)
104 $(MAKE) $(MAKEOPT) -f mod_status.mak CFG="mod_status - Win32 $(LONG)" RECURSE=0 $(CTARGET)
107 $(MAKE) $(MAKEOPT) -f mod_rewrite.mak CFG="mod_rewrite - Win32 $(LONG)" RECURSE=0 $(CTARGET)
108 $(MAKE) $(MAKEOPT) -f mod_speling.mak CFG="mod_speling - Win32 $(LONG)" RECURSE=0 $(CTARGET)
111 $(MAKE) $(MAKEOPT) -f mod_cern_meta.mak CFG="mod_cern_meta - Win32 $(LONG)" RECURSE=0 $(CTARGET)
112 $(MAKE) $(MAKEOPT) -f mod_expires.mak CFG="mod_expires - Win32 $(LONG)" RECURSE=0 $(CTARGET)
113 $(MAKE) $(MAKEOPT) -f mod_headers.mak CFG="mod_headers - Win32 $(LONG)" RECURSE=0 $(CTARGET)
114 $(MAKE) $(MAKEOPT) -f mod_usertrack.mak CFG="mod_usertrack - Win32 $(LONG)" RECURSE=0 $(CTARGET)
117 # $(MAKE) $(MAKEOPT) -f mod_proxy.mak CFG="mod_proxy - Win32 $(LONG)" RECURSE=0 $(CTARGET)
120 $(MAKE) $(MAKEOPT) -f ab.mak CFG="ab - Win32 $(LONG)" RECURSE=0 $(CTARGET)
121 $(MAKE) $(MAKEOPT) -f htpasswd.mak CFG="htpasswd - Win32 $(LONG)" RECURSE=0 $(CTARGET)
122 $(MAKE) $(MAKEOPT) -f htdigest.mak CFG="htdigest - Win32 $(LONG)" RECURSE=0 $(CTARGET)
123 $(MAKE) $(MAKEOPT) -f logresolve.mak CFG="logresolve - Win32 $(LONG)" RECURSE=0 $(CTARGET)
124 $(MAKE) $(MAKEOPT) -f rotatelogs.mak CFG="rotatelogs - Win32 $(LONG)" RECURSE=0 $(CTARGET)
129 -mkdir "$(INSTDIR)\bin"
130 -mkdir "$(INSTDIR)\cgi-bin"
131 -mkdir "$(INSTDIR)\conf"
132 -mkdir "$(INSTDIR)\htdocs"
133 -mkdir "$(INSTDIR)\htdocs\manual"
134 -mkdir "$(INSTDIR)\icons"
135 -mkdir "$(INSTDIR)\include"
136 -mkdir "$(INSTDIR)\lib"
137 -mkdir "$(INSTDIR)\libexec"
138 -mkdir "$(INSTDIR)\logs"
139 -mkdir "$(INSTDIR)\modules"
140 # -mkdir "$(INSTDIR)\proxy"
141 copy Apache$(SHORT)\Apache.exe "$(INSTDIR)"
142 copy Core$(SHORT)\ApacheCore.dll "$(INSTDIR)"
143 copy srclib\apr\$(LONG)\aprlib.dll "$(INSTDIR)"
144 copy srclib\apr-util\$(LONG)\apr-util.dll "$(INSTDIR)"
145 copy srclib\expat-lite\$(LONG)\expatlib.dll "$(INSTDIR)"
146 copy modules\aaa\mod_auth_anon$(SHORT)\mod_auth_anon.dll "$(INSTDIR)\modules"
147 copy modules\aaa\mod_auth_dbm$(SHORT)\mod_auth_dbm.dll "$(INSTDIR)\modules"
148 copy modules\aaa\mod_auth_digest$(SHORT)\mod_auth_digest.dll "$(INSTDIR)\modules"
149 copy modules\cache\mod_file_cache$(SHORT)\mod_file_cache.dll "$(INSTDIR)\modules"
150 copy modules\dav\fs\mod_dav_fs$(SHORT)\mod_dav_fs.dll "$(INSTDIR)\modules"
151 copy modules\dav\main\mod_dav$(SHORT)\mod_dav.dll "$(INSTDIR)\modules"
152 # copy modules\generators\mod_info$(SHORT)\mod_info.dll "$(INSTDIR)\modules"
153 copy modules\generators\mod_status$(SHORT)\mod_status.dll "$(INSTDIR)\modules"
154 copy modules\mappers\mod_rewrite$(SHORT)\mod_rewrite.dll "$(INSTDIR)\modules"
155 copy modules\mappers\mod_speling$(SHORT)\mod_speling.dll "$(INSTDIR)\modules"
156 copy modules\metadata\mod_cern_meta$(SHORT)\mod_cern_meta.dll "$(INSTDIR)\modules"
157 copy modules\metadata\mod_expires$(SHORT)\mod_expires.dll "$(INSTDIR)\modules"
158 copy modules\metadata\mod_headers$(SHORT)\mod_headers.dll "$(INSTDIR)\modules"
159 copy modules\metadata\mod_usertrack$(SHORT)\mod_usertrack.dll "$(INSTDIR)\modules"
160 # copy modules\proxy\mod_proxy$(SHORT)\mod_proxy.dll "$(INSTDIR)\modules"
161 copy support\$(LONG)\ab.exe "$(INSTDIR)\bin"
162 copy support\$(LONG)\htpasswd.exe "$(INSTDIR)\bin"
163 copy support\$(LONG)\htdigest.exe "$(INSTDIR)\bin"
164 copy support\$(LONG)\logresolve.exe "$(INSTDIR)\bin"
165 copy support\$(LONG)\rotatelogs.exe "$(INSTDIR)\bin"
166 copy docs\cgi-examples\printenv "$(INSTDIR)\cgi-bin\printenv.pl"
167 xcopy docs\docroot "$(INSTDIR)\htdocs" /d /q
168 xcopy docs\manual "$(INSTDIR)\htdocs\manual" /s /d /q
169 xcopy docs\icons "$(INSTDIR)\icons" /s /d /q
170 copy docs\conf\magic "$(INSTDIR)\conf\magic.default"
171 if not exist "$(INSTDIR)\conf\magic" \
172 copy "$(INSTDIR)\conf\magic.default" "$(INSTDIR)\conf\magic"
173 copy docs\conf\mime.types "$(INSTDIR)\conf\mime.types.default"
174 if not exist "$(INSTDIR)\conf\mime.types" \
175 copy "$(INSTDIR)\conf\mime.types.default" "$(INSTDIR)\conf\mime.types"
176 awk -f << docs\conf\httpd-win.conf "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)"
180 serverroot = ARGV[3];
181 gsub( /\\/, "/", serverroot );
182 while ( ( getline < srcfl ) > 0 ) {
183 gsub( /@@ServerRoot@@/, serverroot );
188 if not exist "$(INSTDIR)\conf\httpd.conf" \
189 copy "$(INSTDIR)\conf\httpd.default.conf" "$(INSTDIR)\conf\httpd.conf"
190 awk -f << support\dbmmanage >"$(INSTDIR)\bin\dbmmanage.pl"
191 { if ( $$0 !~ /^#.*-lsdbm/) {
192 gsub( /AnyDBM_File::ISA = qw\(.*\)/, "AnyDBM_File::ISA = qw(SDBM_File)" );