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 entirely relative
27 # to one another! At this time, building the libraries themselves
28 # is only expected to work if the defaults (../apr, ../apr-iconv
29 # and ../apr-util) are used, or if they are built with USEMAK=1.
31 # APR_PATH=..\apr-1.3.0
32 # API_PATH=..\apr-iconv-1.3.0
33 # APU_PATH=..\apr-util-1.3.0
37 # nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean
40 !IF EXIST("aprutil.sln") && ([devenv /help > NUL 2>&1] == 0) \
41 && !defined(USEMAK) && !defined(USEDSW)
45 !ELSEIF EXIST("aprutil.mak") && !defined(USEDSW)
57 !IF [$(COMSPEC) /c cl /nologo /? \
58 | $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0
68 # Never build ssl by default, plus this needs work
70 #OPENSSL_DIR=..\openssl
72 !MESSAGE ARCH = $(ARCH)
73 !MESSAGE APR_PATH = $(APR_PATH)
74 !MESSAGE API_PATH = $(API_PATH) (apr-iconv)
75 !MESSAGE APU_PATH = $(APU_PATH) (apr-util)
77 !MESSAGE OPENSSL_DIR = $(OPENSSL_DIR) (openssl)
79 !MESSAGE PREFIX = $(PREFIX) (install path)
82 # Utility and Translation things, nothing here for the user
84 !IF "$(ARCH)" == "Win32 Release"
90 !ELSEIF "$(ARCH)" == "Win32 Debug"
96 !ELSEIF "$(ARCH)" == "Win32 Release9x"
97 SLNARCH=Release9x|Win32
100 ARCHOSPATH=9x\Release
102 !ELSEIF "$(ARCH)" == "Win32 Debug9x"
103 SLNARCH=Debug9x|Win32
108 !ELSEIF "$(ARCH)" == "x64 Release"
112 ARCHOSPATH=x64\Release
114 !ELSEIF "$(ARCH)" == "x64 Debug"
123 # Only default the behavior if MAKEOPT= is omitted
125 # Microsoft NMake options
127 !ELSEIF "$(MAKE)" == "make"
128 # Borland make options? Not really supported (yet)
136 !IF !EXIST("$(APR_PATH)\apr.dsp") || !EXIST("$(API_PATH)\apriconv.dsp") \
137 || !EXIST("$(APU_PATH)\aprutil.dsp")
138 !MESSAGE Please check out or download and unpack the Apache Portability Runtime
139 !MESSAGE sources (apr, apr-iconv and apr-util) under a single parent dir,
140 !MESSAGE or provide APR_PATH, API_PATH and APU_PATH (all relative to each other,
141 !MESSAGE or all absolute paths).
142 !MESSAGE Apache cannot build without these libraries!
144 !ERROR Need apr and apr-iconv alongside apr-util to build!
148 all: buildall checkall
150 # To help win32 pick up the locations where they don't fall in the usual
151 # path locations. This may not be completely effective for USESLN/USEDSP
152 # oriented builds, just yet
154 LIB=$(APR_PATH)\$(ARCHOSPATH);$(APR_PATH)\$(LIBSOSPATH);$(API_PATH)\$(ARCHPATH);$(API_PATH)\$(LIBSPATH);$(APU_PATH)\$(ARCHPATH);$(APU_PATH)\$(LIBSPATH);$(LIB)
155 INCLUDE=$(APR_PATH)\include;$(API_PATH)\include;$(INCLUDE)
160 $(MAKE) $(MAKEOPT) -f Makefile.win ARCH="$(ARCH)" \
161 CTARGET=CLEAN buildall
165 $(MAKE) $(MAKEOPT) -f apr.mak CFG="apr - $(ARCH)" RECURSE=0 $(CTARGET)
166 $(MAKE) $(MAKEOPT) -f libapr.mak CFG="libapr - $(ARCH)" RECURSE=0 $(CTARGET)
168 $(MAKE) $(MAKEOPT) -f aprapp.mak CFG="aprapp - $(ARCH)" RECURSE=0 $(CTARGET)
169 $(MAKE) $(MAKEOPT) -f libaprapp.mak CFG="libaprapp - $(ARCH)" RECURSE=0 $(CTARGET)
172 $(MAKE) $(MAKEOPT) -f apriconv.mak CFG="apriconv - $(ARCH)" RECURSE=0 $(CTARGET)
173 $(MAKE) $(MAKEOPT) -f libapriconv.mak CFG="libapriconv - $(ARCH)" RECURSE=0 $(CTARGET)
174 !IF "$(CTARGET)" == "CLEAN"
175 $(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
176 BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
179 $(MAKE) $(MAKEOPT) -f Makefile.win all \
180 BUILD_MODE="$(ARCH)" BIND_MODE=shared
182 $(MAKE) $(MAKEOPT) -f Makefile.win all \
183 BUILD_MODE="$(ARCH)" BIND_MODE=shared
186 cd $(APU_PATH)\xml\expat\lib
187 $(MAKE) $(MAKEOPT) -f xml.mak CFG="xml - $(ARCH)" RECURSE=0 $(CTARGET)
189 $(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - $(ARCH)" RECURSE=0 $(CTARGET)
190 $(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - $(ARCH)" RECURSE=0 $(CTARGET)
192 !ELSEIF $(USESLN) == 1
195 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project libaprutil
196 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project aprutil
198 $(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
199 BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
203 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project aprutil
204 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project libaprutil
210 -msdev aprutil.dsw /USEENV /MAKE "libaprutil - $(ARCH)" /CLEAN
211 -msdev aprutil.dsw /USEENV /MAKE "aprutil - $(ARCH)" /CLEAN
213 $(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
214 BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
218 @msdev aprutil.dsw /USEENV /MAKE "aprutil - $(ARCH)"
219 @msdev aprutil.dsw /USEENV /MAKE "libaprutil - $(ARCH)"
226 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
227 OUTDIR=$(LIBSOSPATH) check
228 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
229 OUTDIR=$(ARCHOSPATH) check
236 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
237 OUTDIR=$(LIBSPATH) APROUTDIR=$(LIBSOSPATH) \
238 APR_PATH=..\$(APR_PATH) API_PATH=..\$(API_PATH) check
239 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
240 OUTDIR=$(LIBSPATH) APROUTDIR=$(ARCHOSPATH) \
241 APR_PATH=..\$(APR_PATH) API_PATH=..\$(API_PATH) check
244 checkall: checkapr checkapu
250 @if NOT EXIST "$(PREFIX)\." mkdir "$(PREFIX)"
251 @if NOT EXIST "$(PREFIX)\bin\." mkdir "$(PREFIX)\bin"
252 @if NOT EXIST "$(PREFIX)\bin\iconv\." mkdir "$(PREFIX)\bin\iconv"
253 @if NOT EXIST "$(PREFIX)\include\." mkdir "$(PREFIX)\include"
254 @if NOT EXIST "$(PREFIX)\lib\." mkdir "$(PREFIX)\lib"
255 copy CHANGES "$(PREFIX)\CHANGES.txt" <.y
256 copy LICENSE "$(PREFIX)\LICENSE.txt" <.y
257 copy NOTICE "$(PREFIX)\NOTICE.txt" <.y
258 xcopy $(APR_PATH)\include\*.h "$(PREFIX)\include\" /d < .a
259 xcopy $(APU_PATH)\include\*.h "$(PREFIX)\include\" /d < .a
260 copy $(APR_PATH)\$(LIBSOSPATH)\apr-1.lib "$(PREFIX)\lib\" <.y
261 copy $(APR_PATH)\$(LIBSOSPATH)\apr-1.pdb "$(PREFIX)\lib\" <.y
262 copy $(APU_PATH)\$(LIBSPATH)\aprutil-1.lib "$(PREFIX)\lib\" <.y
263 copy $(APU_PATH)\$(LIBSPATH)\aprutil-1.pdb "$(PREFIX)\lib\" <.y
264 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.lib "$(PREFIX)\lib\" <.y
265 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.exp "$(PREFIX)\lib\" <.y
266 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.lib "$(PREFIX)\lib\" <.y
267 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.exp "$(PREFIX)\lib\" <.y
268 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.dll "$(PREFIX)\bin\" <.y
269 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.pdb "$(PREFIX)\bin\" <.y
270 copy $(API_PATH)\$(ARCHPATH)\libapriconv-1.dll "$(PREFIX)\bin\" <.y
271 copy $(API_PATH)\$(ARCHPATH)\libapriconv-1.pdb "$(PREFIX)\bin\" <.y
272 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.dll "$(PREFIX)\bin\" <.y
273 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.pdb "$(PREFIX)\bin\" <.y
274 xcopy $(API_PATH)\$(ARCHPATH)\iconv\*.so "$(PREFIX)\bin\iconv\" /d < .a
275 xcopy $(API_PATH)\$(ARCHPATH)\iconv\*.pdb "$(PREFIX)\bin\iconv\" /d < .a
277 copy $(OPENSSL_DIR)\$(SSLBIN)\openssl.exe "$(PREFIX)\bin\" <.y
278 copy $(OPENSSL_DIR)\$(SSLBIN)\openssl.pdb "$(PREFIX)\bin\" <.y
279 copy $(OPENSSL_DIR)\$(SSLBIN)\libeay32.dll "$(PREFIX)\bin\" <.y
280 copy $(OPENSSL_DIR)\$(SSLBIN)\libeay32.pdb "$(PREFIX)\bin\" <.y
281 copy $(OPENSSL_DIR)\$(SSLBIN)\ssleay32.dll "$(PREFIX)\bin\" <.y
282 copy $(OPENSSL_DIR)\$(SSLBIN)\ssleay32.pdb "$(PREFIX)\bin\" <.y
283 @if NOT EXIST "$(PREFIX)\conf\." mkdir "$(PREFIX)\conf"
284 copy $(OPENSSL_DIR)\apps\openssl.cnf "$(PREFIX)\conf\openssl.cnf" <.y
285 type << >> "$(PREFIX)\NOTICE.txt"
287 This binary distribution includes cryptographic software written by
288 Eric Young (eay@cryptsoft.com), software written by Tim Hudson
289 (tjh@cryptsoft.com), and software developed by the OpenSSL Project
290 for use in the OpenSSL Toolkit <http://www.openssl.org/>.
292 copy LICENSE + << + "$(OPENSSL_DIR)\LICENSE" "$(PREFIX)\LICENSE.txt" <.y
294 For the libeay32.dll, ssleay32.dll and openssl.exe components:
297 copy << + $(OPENSSL_DIR)\NEWS "$(PREFIX)\OPENSSL-NEWS.txt" <.y
299 Apache Portablity Runtime (APR) 1.3 Limited OpenSSL Distribution
301 This binary distribution includes the minimal components of OpenSSL required
302 to support aprutil 1.3 and later libraries from the Apache APR Project.
303 (Details are listed in OPENSSL-README.txt.) For the complete list of CHANGES
304 to this and later versions of OpenSSL, please refer to the definative source,
305 <http://www.openssl.org/news/changelog.html>, or see the CHANGES file in the
306 full binary or source distribution package from <http://www.openssl.org/>.
308 These OpenSSL binaries were built for distribution from the U.S. without
309 support for the patented encryption methods IDEA, MDC-2 or RC5.
311 --------------------------------------------------------------------------------
313 copy << + $(OPENSSL_DIR)\README "$(PREFIX)\OPENSSL-README.txt" <.y
315 Apache Portablity Runtime APR-util Limited OpenSSL Distribution
317 This binary installation of OpenSSL is a limited distribution of the
318 files derived from the OpenSSL project:
320 LICENSE.txt (includes openssl LICENSE)
331 These are the minimal libraries and tools required to use the aprutil 1.3
332 and later library releases distributed by the Apache APR project. No library
333 link files, headers or sources are distributed with this binary distribution.
334 Please refer to the <http://www.openssl.org/> site for complete source or
335 binary distributions.
337 These OpenSSL binaries were built for distribution from the U.S. without
338 support for the patented encryption methods IDEA, MDC-2 or RC5.
340 The Apache APR Project only supports the binary distribution of these files
341 and development of the mod_ssl module. We cannot provide support assistance
342 for using or configuring the OpenSSL package or these modules. Please refer
343 all installation and configuration questions to the appropriate forum,
344 such as the user supported lists, <http://apr.apache.org/mailing-lists.html>
345 the Apache APR Projects developer list or <http://www.openssl.org/support/>
346 the OpenSSL support page.
348 --------------------------------------------------------------------------------