1 # Makefile.win for Win32 APR + APR-iconv + APR-util
5 # buildall - compile everything
6 # checkall - run APR + APR-util regression tests
7 # install - compile everything
8 # clean - mop up everything
10 # You can override the build mechansim, choose only one;
12 # USEMAK=1 - compile from exported make files
13 # USEDSW=1 - compile from .dsw / .dsp VC6 projects
14 # USESLN=1 - compile from converted .sln / .vcproj VC7+ files
16 # Define ARCH to your desired preference (your PATH must point
17 # to the correct compiler tools!) Choose only one;
19 # ARCH="Win32 Release"
21 # ARCH="Win32 Release9x"
22 # ARCH="Win32 Debug9x"
26 # Provide the APR_PATH, API_PATH and APU_PATH all as absolute paths,
27 # or all as paths RELATIVE TO ONE ANOTHER!
29 # APR_PATH=..\apr-1.3.0
30 # API_PATH=..\apr-iconv-1.3.0
31 # APU_PATH=..\apr-util-1.3.0
35 # nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean
38 !IF EXIST("aprutil.sln") && ([devenv /help > NUL 2>&1] == 0) \
39 && !defined(USEMAK) && !defined(USEDSW)
43 !ELSEIF EXIST("aprutil.mak") && !defined(USEDSW)
55 !IF [$(COMSPEC) /c cl /nologo /? | find "x64" >NUL ] == 0
65 # Never build ssl by default, plus this needs work
67 #OPENSSL_DIR=..\openssl
69 !MESSAGE ARCH = $(ARCH)
70 !MESSAGE APR_PATH = $(APR_PATH)
71 !MESSAGE API_PATH = $(API_PATH) (apr-iconv)
72 !MESSAGE APU_PATH = $(APU_PATH) (apr-util)
74 !MESSAGE OPENSSL_DIR = $(OPENSSL_DIR) (openssl)
76 !MESSAGE PREFIX = $(PREFIX) (install path)
79 # Utility and Translation things, nothing here for the user
81 !IF "$(ARCH)" == "Win32 Release"
87 !ELSEIF "$(ARCH)" == "Win32 Debug"
93 !ELSEIF "$(ARCH)" == "Win32 Release9x"
94 SLNARCH=Release9x|Win32
99 !ELSEIF "$(ARCH)" == "Win32 Debug9x"
100 SLNARCH=Debug9x|Win32
105 !ELSEIF "$(ARCH)" == "x64 Release"
109 ARCHOSPATH=x64\Release
111 !ELSEIF "$(ARCH)" == "x64 Debug"
120 # Only default the behavior if MAKEOPT= is omitted
122 # Microsoft NMake options
124 !ELSEIF "$(MAKE)" == "make"
125 # Borland make options? Not really supported (yet)
133 !IF !EXIST("$(APR_PATH)\apr.dsp") || !EXIST("$(API_PATH)\apriconv.dsp") \
134 || !EXIST("$(APU_PATH)\aprutil.dsp")
135 !MESSAGE Please check out or download and unpack the Apache Portability Runtime
136 !MESSAGE sources (apr, apr-iconv and apr-util) under a single parent dir,
137 !MESSAGE or provide APR_PATH, API_PATH and APU_PATH (all relative to each other,
138 !MESSAGE or all absolute paths).
139 !MESSAGE Apache cannot build without these libraries!
141 !ERROR Need apr and apr-iconv alongside apr-util to build!
145 all: buildall checkall
147 # To help win32 pick up the locations where they don't fall in the usual
148 # path locations. This may not be completely effective for USESLN/USEDSP
149 # oriented builds, just yet
151 LIB=$(APR_PATH)\$(ARCHOSPATH);$(APR_PATH)\$(LIBSOSPATH);$(API_PATH)\$(ARCHPATH);$(API_PATH)\$(LIBSPATH);$(APU_PATH)\$(ARCHPATH);$(APU_PATH)\$(LIBSPATH);$(LIB)
152 INCLUDE=$(APR_PATH)\include;$(API_PATH)\include;$(INCLUDE)
157 $(MAKE) $(MAKEOPT) -f Makefile.win ARCH="$(ARCH)" \
158 CTARGET=CLEAN buildall
162 $(MAKE) $(MAKEOPT) -f apr.mak CFG="apr - $(ARCH)" RECURSE=0 $(CTARGET)
163 $(MAKE) $(MAKEOPT) -f libapr.mak CFG="libapr - $(ARCH)" RECURSE=0 $(CTARGET)
165 $(MAKE) $(MAKEOPT) -f aprapp.mak CFG="aprapp - $(ARCH)" RECURSE=0 $(CTARGET)
166 $(MAKE) $(MAKEOPT) -f libaprapp.mak CFG="libaprapp - $(ARCH)" RECURSE=0 $(CTARGET)
169 $(MAKE) $(MAKEOPT) -f apriconv.mak CFG="apriconv - $(ARCH)" RECURSE=0 $(CTARGET)
170 $(MAKE) $(MAKEOPT) -f libapriconv.mak CFG="libapriconv - $(ARCH)" RECURSE=0 $(CTARGET)
171 !IF "$(CTARGET)" == "CLEAN"
172 $(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
173 BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
176 $(MAKE) $(MAKEOPT) -f Makefile.win all \
177 BUILD_MODE="$(ARCH)" BIND_MODE=shared
179 $(MAKE) $(MAKEOPT) -f Makefile.win all \
180 BUILD_MODE="$(ARCH)" BIND_MODE=shared
183 cd $(APU_PATH)\xml\expat\lib
184 $(MAKE) $(MAKEOPT) -f xml.mak CFG="xml - $(ARCH)" RECURSE=0 $(CTARGET)
186 $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - $(ARCH)" RECURSE=0 $(CTARGET)
187 $(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - $(ARCH)" RECURSE=0 $(CTARGET)
189 !ELSEIF $(USESLN) == 1
192 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project libaprutil
193 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project aprutil
195 $(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
196 BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
200 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project aprutil
201 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project libaprutil
207 -msdev aprutil.dsw /USEENV /MAKE "libaprutil - $(ARCH)" /CLEAN
208 -msdev aprutil.dsw /USEENV /MAKE "aprutil - $(ARCH)" /CLEAN
210 $(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
211 BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
215 @msdev aprutil.dsw /USEENV /MAKE "aprutil - $(ARCH)"
216 @msdev aprutil.dsw /USEENV /MAKE "libaprutil - $(ARCH)"
223 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
224 OUTDIR=$(LIBSOSPATH) check
225 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
226 OUTDIR=$(ARCHOSPATH) check
231 for /f %p in ('cd $(APR_PATH) && pwd') do set FOUND_APR=%p
232 for /f %p in ('cd $(API_PATH) && pwd') do set FOUND_API=%p
235 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
236 OUTDIR=$(LIBSPATH) APROUTDIR=$(LIBSOSPATH) \
237 APR_PATH=%FOUND_APR% API_PATH=%FOUND_APR% check
238 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
239 OUTDIR=$(LIBSPATH) APROUTDIR=$(ARCHOSPATH) \
240 APR_PATH=%FOUND_APR% API_PATH=%FOUND_APR% check
243 checkall: checkapr checkapu
249 @if NOT EXIST "$(PREFIX)\." mkdir "$(PREFIX)"
250 @if NOT EXIST "$(PREFIX)\bin\." mkdir "$(PREFIX)\bin"
251 @if NOT EXIST "$(PREFIX)\bin\iconv\." mkdir "$(PREFIX)\bin\iconv"
252 @if NOT EXIST "$(PREFIX)\include\." mkdir "$(PREFIX)\include"
253 @if NOT EXIST "$(PREFIX)\lib\." mkdir "$(PREFIX)\lib"
254 copy CHANGES "$(PREFIX)\CHANGES.txt" <.y
255 copy LICENSE "$(PREFIX)\LICENSE.txt" <.y
256 copy NOTICE "$(PREFIX)\NOTICE.txt" <.y
257 xcopy $(APR_PATH)\include\*.h "$(PREFIX)\include\" /d < .a
258 xcopy $(APU_PATH)\include\*.h "$(PREFIX)\include\" /d < .a
259 copy $(APR_PATH)\$(LIBSOSPATH)\apr-1.lib "$(PREFIX)\lib\" <.y
260 copy $(APR_PATH)\$(LIBSOSPATH)\apr-1.pdb "$(PREFIX)\lib\" <.y
261 copy $(APU_PATH)\$(LIBSPATH)\aprutil-1.lib "$(PREFIX)\lib\" <.y
262 copy $(APU_PATH)\$(LIBSPATH)\aprutil-1.pdb "$(PREFIX)\lib\" <.y
263 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.lib "$(PREFIX)\lib\" <.y
264 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.exp "$(PREFIX)\lib\" <.y
265 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.lib "$(PREFIX)\lib\" <.y
266 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.exp "$(PREFIX)\lib\" <.y
267 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.dll "$(PREFIX)\bin\" <.y
268 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.pdb "$(PREFIX)\bin\" <.y
269 copy $(API_PATH)\$(ARCHPATH)\libapriconv-1.dll "$(PREFIX)\bin\" <.y
270 copy $(API_PATH)\$(ARCHPATH)\libapriconv-1.pdb "$(PREFIX)\bin\" <.y
271 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.dll "$(PREFIX)\bin\" <.y
272 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.pdb "$(PREFIX)\bin\" <.y
273 xcopy $(API_PATH)\$(ARCHPATH)\iconv\*.so "$(PREFIX)\bin\iconv\" /d < .a
274 xcopy $(API_PATH)\$(ARCHPATH)\iconv\*.pdb "$(PREFIX)\bin\iconv\" /d < .a
276 copy $(OPENSSL_DIR)\$(SSLBIN)\openssl.exe "$(PREFIX)\bin\" <.y
277 copy $(OPENSSL_DIR)\$(SSLBIN)\openssl.pdb "$(PREFIX)\bin\" <.y
278 copy $(OPENSSL_DIR)\$(SSLBIN)\libeay32.dll "$(PREFIX)\bin\" <.y
279 copy $(OPENSSL_DIR)\$(SSLBIN)\libeay32.pdb "$(PREFIX)\bin\" <.y
280 copy $(OPENSSL_DIR)\$(SSLBIN)\ssleay32.dll "$(PREFIX)\bin\" <.y
281 copy $(OPENSSL_DIR)\$(SSLBIN)\ssleay32.pdb "$(PREFIX)\bin\" <.y
282 @if NOT EXIST "$(PREFIX)\conf\." mkdir "$(PREFIX)\conf"
283 copy $(OPENSSL_DIR)\apps\openssl.cnf "$(PREFIX)\conf\openssl.cnf" <.y
284 type << >> "$(PREFIX)\NOTICE.txt"
286 This binary distribution includes cryptographic software written by
287 Eric Young (eay@cryptsoft.com), software written by Tim Hudson
288 (tjh@cryptsoft.com), and software developed by the OpenSSL Project
289 for use in the OpenSSL Toolkit <http://www.openssl.org/>.
291 copy LICENSE + << + "$(OPENSSL_DIR)\LICENSE" "$(PREFIX)\LICENSE.txt" <.y
293 For the libeay32.dll, ssleay32.dll and openssl.exe components:
296 copy << + $(OPENSSL_DIR)\NEWS "$(PREFIX)\OPENSSL-NEWS.txt" <.y
298 Apache Portablity Runtime (APR) 1.3 Limited OpenSSL Distribution
300 This binary distribution includes the minimal components of OpenSSL required
301 to support aprutil 1.3 and later libraries from the Apache APR Project.
302 (Details are listed in OPENSSL-README.txt.) For the complete list of CHANGES
303 to this and later versions of OpenSSL, please refer to the definative source,
304 <http://www.openssl.org/news/changelog.html>, or see the CHANGES file in the
305 full binary or source distribution package from <http://www.openssl.org/>.
307 These OpenSSL binaries were built for distribution from the U.S. without
308 support for the patented encryption methods IDEA, MDC-2 or RC5.
310 --------------------------------------------------------------------------------
312 copy << + $(OPENSSL_DIR)\README "$(PREFIX)\OPENSSL-README.txt" <.y
314 Apache Portablity Runtime APR-util Limited OpenSSL Distribution
316 This binary installation of OpenSSL is a limited distribution of the
317 files derived from the OpenSSL project:
319 LICENSE.txt (includes openssl LICENSE)
330 These are the minimal libraries and tools required to use the aprutil 1.3
331 and later library releases distributed by the Apache APR project. No library
332 link files, headers or sources are distributed with this binary distribution.
333 Please refer to the <http://www.openssl.org/> site for complete source or
334 binary distributions.
336 These OpenSSL binaries were built for distribution from the U.S. without
337 support for the patented encryption methods IDEA, MDC-2 or RC5.
339 The Apache APR Project only supports the binary distribution of these files
340 and development of the mod_ssl module. We cannot provide support assistance
341 for using or configuring the OpenSSL package or these modules. Please refer
342 all installation and configuration questions to the appropriate forum,
343 such as the user supported lists, <http://apr.apache.org/mailing-lists.html>
344 the Apache APR Projects developer list or <http://www.openssl.org/support/>
345 the OpenSSL support page.
347 --------------------------------------------------------------------------------