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
35 # Provide a DBD_LIST argument after configuring LIB and INCLUDE with
36 # the SDK paths of the corresponding client support libraries.
37 # ODBC is always built on Windows, so it does not get included in DBD_LIST
38 # Note that at this time, none of these are supported on win32, per say.
40 # DBD_LIST="sqlite3 pgsql oracle mysql freetds"
44 # nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean
47 !IF EXIST("aprutil.sln") && ([devenv /help > NUL 2>&1] == 0) \
48 && !defined(USEMAK) && !defined(USEDSW)
52 !ELSEIF EXIST("aprutil.mak") && !defined(USEDSW)
64 !IF [$(COMSPEC) /c cl /nologo /? \
65 | $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0
75 !MESSAGE ARCH = $(ARCH)
76 !MESSAGE APR_PATH = $(APR_PATH)
77 !MESSAGE API_PATH = $(API_PATH) (apr-iconv)
78 !MESSAGE APU_PATH = $(APU_PATH) (apr-util)
79 !MESSAGE PREFIX = $(PREFIX) (install path)
80 !MESSAGE DBD_LIST = $(DBD_LIST)
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 $(MAKE) $(MAKEOPT) -f apr_ldap.mak CFG="apr_ldap - $(ARCH)" RECURSE=0 $(CTARGET)
195 for %d in (odbc $(DBD_LIST)) do \
196 $(MAKE) $(MAKEOPT) -f apr_dbd_%d.mak CFG="apr_dbd_%d - $(ARCH)" RECURSE=0 $(CTARGET)
199 !ELSEIF $(USESLN) == 1
202 -for %d in (odbc $(DBD_LIST)) do \
203 devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project apr_dbd_%d
204 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project apr_ldap
205 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project libaprutil
206 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project aprutil
208 -$(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
209 BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
211 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project libapriconv
212 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project apriconv
213 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project libaprapp
214 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project aprapp
215 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project libapr
216 -devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project apr
219 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project aprapp
220 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project libaprapp
221 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project aprutil
222 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project libaprutil
223 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project apr_ldap
224 for %d in (odbc $(DBD_LIST)) do \
225 devenv aprutil.sln /useenv /build "$(SLNARCH)" /project apr_dbd_%d
231 -for %d in (odbc $(DBD_LIST)) do \
232 msdev aprutil.dsw /USEENV /MAKE "apr_dbd_%d - $(ARCH)" /CLEAN
233 -msdev aprutil.dsw /USEENV /MAKE "apr_ldap - $(ARCH)" /CLEAN
234 -msdev aprutil.dsw /USEENV /MAKE "libaprutil - $(ARCH)" /CLEAN
235 -msdev aprutil.dsw /USEENV /MAKE "aprutil - $(ARCH)" /CLEAN
237 $(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
238 BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
240 -msdev aprutil.dsw /USEENV /MAKE "libapriconv - $(ARCH)" /CLEAN
241 -msdev aprutil.dsw /USEENV /MAKE "apriconv - $(ARCH)" /CLEAN
242 -msdev aprutil.dsw /USEENV /MAKE "libaprapp - $(ARCH)" /CLEAN
243 -msdev aprutil.dsw /USEENV /MAKE "aprapp - $(ARCH)" /CLEAN
244 -msdev aprutil.dsw /USEENV /MAKE "libapr - $(ARCH)" /CLEAN
245 -msdev aprutil.dsw /USEENV /MAKE "apr - $(ARCH)" /CLEAN
248 @msdev aprutil.dsw /USEENV /MAKE "aprapp - $(ARCH)"
249 @msdev aprutil.dsw /USEENV /MAKE "aprutil - $(ARCH)"
250 @msdev aprutil.dsw /USEENV /MAKE "libaprapp - $(ARCH)"
251 @msdev aprutil.dsw /USEENV /MAKE "libaprutil - $(ARCH)"
252 @msdev aprutil.dsw /USEENV /MAKE "apr_ldap - $(ARCH)"
253 @for %d in (odbc $(DBD_LIST)) do \
254 msdev aprutil.dsw /USEENV /MAKE "apr_dbd_%d - $(ARCH)"
261 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
262 OUTDIR=$(LIBSOSPATH) check
263 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
264 OUTDIR=$(ARCHOSPATH) check
271 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
272 OUTDIR=$(LIBSPATH) APROUTDIR=$(LIBSOSPATH) \
273 APR_PATH=..\$(APR_PATH) API_PATH=..\$(API_PATH) check
274 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
275 OUTDIR=$(ARCHPATH) APROUTDIR=$(ARCHOSPATH) \
276 APR_PATH=..\$(APR_PATH) API_PATH=..\$(API_PATH) check
279 checkall: checkapr checkapu
285 @if NOT EXIST "$(PREFIX)\." mkdir "$(PREFIX)"
286 @if NOT EXIST "$(PREFIX)\bin\." mkdir "$(PREFIX)\bin"
287 @if NOT EXIST "$(PREFIX)\bin\iconv\." mkdir "$(PREFIX)\bin\iconv"
288 @if NOT EXIST "$(PREFIX)\include\." mkdir "$(PREFIX)\include"
289 @if NOT EXIST "$(PREFIX)\lib\." mkdir "$(PREFIX)\lib"
290 copy CHANGES "$(PREFIX)\CHANGES.txt" <.y
291 copy LICENSE "$(PREFIX)\LICENSE.txt" <.y
292 copy NOTICE "$(PREFIX)\NOTICE.txt" <.y
293 xcopy $(APR_PATH)\include\*.h "$(PREFIX)\include\" /d < .a
294 xcopy $(APU_PATH)\include\*.h "$(PREFIX)\include\" /d < .a
295 copy $(APR_PATH)\$(LIBSOSPATH)\apr-1.lib "$(PREFIX)\lib\" <.y
296 copy $(APR_PATH)\$(LIBSOSPATH)\apr-1.pdb "$(PREFIX)\lib\" <.y
297 copy $(APU_PATH)\$(LIBSPATH)\aprutil-1.lib "$(PREFIX)\lib\" <.y
298 copy $(APU_PATH)\$(LIBSPATH)\aprutil-1.pdb "$(PREFIX)\lib\" <.y
299 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.lib "$(PREFIX)\lib\" <.y
300 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.exp "$(PREFIX)\lib\" <.y
301 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.lib "$(PREFIX)\lib\" <.y
302 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.exp "$(PREFIX)\lib\" <.y
303 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.dll "$(PREFIX)\bin\" <.y
304 copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.pdb "$(PREFIX)\bin\" <.y
305 copy $(API_PATH)\$(ARCHPATH)\libapriconv-1.dll "$(PREFIX)\bin\" <.y
306 copy $(API_PATH)\$(ARCHPATH)\libapriconv-1.pdb "$(PREFIX)\bin\" <.y
307 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.dll "$(PREFIX)\bin\" <.y
308 copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.pdb "$(PREFIX)\bin\" <.y
309 copy $(APU_PATH)\ldap\$(ARCHPATH)\apr_ldap-1.dll "$(PREFIX)\bin\" <.y
310 copy $(APU_PATH)\ldap\$(ARCHPATH)\apr_ldap-1.pdb "$(PREFIX)\bin\" <.y
311 for %d in (odbc $(DBD_LIST)) do ( \
312 copy $(APU_PATH)\dbd\$(ARCHPATH)\apr_dbd_%d-1.dll "$(PREFIX)\bin\" <.y && \
313 copy $(APU_PATH)\dbd\$(ARCHPATH)\apr_dbd_%d-1.pdb "$(PREFIX)\bin\" <.y \
315 xcopy $(API_PATH)\$(ARCHPATH)\iconv\*.so "$(PREFIX)\bin\iconv\" /d < .a
316 xcopy $(API_PATH)\$(ARCHPATH)\iconv\*.pdb "$(PREFIX)\bin\iconv\" /d < .a