blob: 0cb1bdc17e865d1f1ea49ce423638ca9ce74e5ad [file] [log] [blame]
# Makefile.win for Win32 APR + APR-iconv + APR-util
#
# Targets are:
#
# buildall - compile everything
# checkall - run APR + APR-util regression tests
# install - compile everything
# clean - mop up everything
#
# You can override the build mechansim, choose only one;
#
# USEMAK=1 - compile from exported make files
# USEDSW=1 - compile from .dsw / .dsp VC6 projects
# USESLN=1 - compile from converted .sln / .vcproj VC7+ files
#
# Define ARCH to your desired preference (your PATH must point
# to the correct compiler tools!) Choose only one;
#
# ARCH="Win32 Release"
# ARCH="Win32 Debug"
# ARCH="Win32 Release9x"
# ARCH="Win32 Debug9x"
# ARCH="x64 Release"
# ARCH="x64 Debug"
#
# Provide the APR_PATH, API_PATH and APU_PATH entirely relative
# to one another! At this time, building the libraries themselves
# is only expected to work if the defaults (../apr, ../apr-iconv
# and ../apr-util) are used, or if they are built with USEMAK=1.
#
# APR_PATH=..\apr-1.3.0
# API_PATH=..\apr-iconv-1.3.0
# APU_PATH=..\apr-util-1.3.0
#
# For example;
#
# nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean
#
!IF EXIST("aprutil.sln") && ([devenv /help > NUL 2>&1] == 0) \
&& !defined(USEMAK) && !defined(USEDSW)
USESLN=1
USEMAK=0
USEDSW=0
!ELSEIF EXIST("aprutil.mak") && !defined(USEDSW)
USESLN=0
USEMAK=1
USEDSW=0
!ELSE
USESLN=0
USEMAK=0
USEDSW=1
!ENDIF
PREFIX=..\apr-dist
!IF [$(COMSPEC) /c cl /nologo /? \
| $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0
ARCH=x64 Release
!ELSE
ARCH=Win32 Release
!ENDIF
APR_PATH=..\apr
API_PATH=..\apr-iconv
APU_PATH=..\apr-util
# Never build ssl by default, plus this needs work
#
#OPENSSL_DIR=..\openssl
!MESSAGE ARCH = $(ARCH)
!MESSAGE APR_PATH = $(APR_PATH)
!MESSAGE API_PATH = $(API_PATH) (apr-iconv)
!MESSAGE APU_PATH = $(APU_PATH) (apr-util)
!IFDEF OPENSSL_DIR
!MESSAGE OPENSSL_DIR = $(OPENSSL_DIR) (openssl)
!ENDIF
!MESSAGE PREFIX = $(PREFIX) (install path)
# Utility and Translation things, nothing here for the user
#
!IF "$(ARCH)" == "Win32 Release"
SLNARCH=Release|Win32
ARCHPATH=Release
LIBSPATH=LibR
ARCHOSPATH=Release
LIBSOSPATH=LibR
!ELSEIF "$(ARCH)" == "Win32 Debug"
SLNARCH=Debug|Win32
ARCHPATH=Debug
LIBSPATH=LibD
ARCHOSPATH=Debug
LIBSOSPATH=LibD
!ELSEIF "$(ARCH)" == "Win32 Release9x"
SLNARCH=Release9x|Win32
ARCHPATH=Release
LIBSPATH=LibR
ARCHOSPATH=9x\Release
LIBSOSPATH=9x\LibR
!ELSEIF "$(ARCH)" == "Win32 Debug9x"
SLNARCH=Debug9x|Win32
ARCHPATH=Debug
LIBSPATH=LibD
ARCHOSPATH=9x\Debug
LIBSOSPATH=9x\LibD
!ELSEIF "$(ARCH)" == "x64 Release"
SLNARCH=Release|x64
ARCHPATH=x64\Release
LIBSPATH=x64\LibR
ARCHOSPATH=x64\Release
LIBSOSPATH=x64\LibR
!ELSEIF "$(ARCH)" == "x64 Debug"
SLNARCH=Debug|x64
ARCHPATH=x64\Debug
LIBSPATH=x64\LibD
ARCHOSPATH=x64\Debug
LIBSOSPATH=x64\LibD
!ENDIF
!IFNDEF MAKEOPT
# Only default the behavior if MAKEOPT= is omitted
!IFDEF _NMAKE_VER
# Microsoft NMake options
MAKEOPT=-nologo
!ELSEIF "$(MAKE)" == "make"
# Borland make options? Not really supported (yet)
MAKEOPT=-s -N
!ENDIF
!ENDIF
# Sanity Checks
#
!IF !EXIST("$(APR_PATH)\apr.dsp") || !EXIST("$(API_PATH)\apriconv.dsp") \
|| !EXIST("$(APU_PATH)\aprutil.dsp")
!MESSAGE Please check out or download and unpack the Apache Portability Runtime
!MESSAGE sources (apr, apr-iconv and apr-util) under a single parent dir,
!MESSAGE or provide APR_PATH, API_PATH and APU_PATH (all relative to each other,
!MESSAGE or all absolute paths).
!MESSAGE Apache cannot build without these libraries!
!MESSAGE
!ERROR Need apr and apr-iconv alongside apr-util to build!
!ENDIF
all: buildall checkall
# To help win32 pick up the locations where they don't fall in the usual
# path locations. This may not be completely effective for USESLN/USEDSP
# oriented builds, just yet
#
LIB=$(APR_PATH)\$(ARCHOSPATH);$(APR_PATH)\$(LIBSOSPATH);$(API_PATH)\$(ARCHPATH);$(API_PATH)\$(LIBSPATH);$(APU_PATH)\$(ARCHPATH);$(APU_PATH)\$(LIBSPATH);$(LIB)
INCLUDE=$(APR_PATH)\include;$(API_PATH)\include;$(INCLUDE)
!IF $(USEMAK) == 1
clean:
$(MAKE) $(MAKEOPT) -f Makefile.win ARCH="$(ARCH)" \
CTARGET=CLEAN buildall
buildall:
cd $(APR_PATH)
$(MAKE) $(MAKEOPT) -f apr.mak CFG="apr - $(ARCH)" RECURSE=0 $(CTARGET)
$(MAKE) $(MAKEOPT) -f libapr.mak CFG="libapr - $(ARCH)" RECURSE=0 $(CTARGET)
cd build
$(MAKE) $(MAKEOPT) -f aprapp.mak CFG="aprapp - $(ARCH)" RECURSE=0 $(CTARGET)
$(MAKE) $(MAKEOPT) -f libaprapp.mak CFG="libaprapp - $(ARCH)" RECURSE=0 $(CTARGET)
cd ..
cd $(API_PATH)
$(MAKE) $(MAKEOPT) -f apriconv.mak CFG="apriconv - $(ARCH)" RECURSE=0 $(CTARGET)
$(MAKE) $(MAKEOPT) -f libapriconv.mak CFG="libapriconv - $(ARCH)" RECURSE=0 $(CTARGET)
!IF "$(CTARGET)" == "CLEAN"
$(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
!ELSE
cd ccs
$(MAKE) $(MAKEOPT) -f Makefile.win all \
BUILD_MODE="$(ARCH)" BIND_MODE=shared
cd ..\ces
$(MAKE) $(MAKEOPT) -f Makefile.win all \
BUILD_MODE="$(ARCH)" BIND_MODE=shared
cd ..
!ENDIF
cd $(APU_PATH)\xml\expat\lib
$(MAKE) $(MAKEOPT) -f xml.mak CFG="xml - $(ARCH)" RECURSE=0 $(CTARGET)
cd ..\..\..
$(MAKE) $(MAKEOPT) -f aprutil.mak CFG="aprutil - $(ARCH)" RECURSE=0 $(CTARGET)
$(MAKE) $(MAKEOPT) -f libaprutil.mak CFG="libaprutil - $(ARCH)" RECURSE=0 $(CTARGET)
!ELSEIF $(USESLN) == 1
clean:
-devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project libaprutil
-devenv aprutil.sln /useenv /clean "$(SLNARCH)" /project aprutil
cd $(API_PATH)
$(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
cd $(APU_PATH)
buildall:
devenv aprutil.sln /useenv /build "$(SLNARCH)" /project aprutil
devenv aprutil.sln /useenv /build "$(SLNARCH)" /project libaprutil
!ELSE
# $(USEDSP) == 1
clean:
-msdev aprutil.dsw /USEENV /MAKE "libaprutil - $(ARCH)" /CLEAN
-msdev aprutil.dsw /USEENV /MAKE "aprutil - $(ARCH)" /CLEAN
cd $(API_PATH)
$(MAKE) $(MAKEOPT) -f build\modules.mk.win clean \
BUILD_MODE="$(ARCH)" BIND_MODE=shared API_SOURCE=.
cd $(APU_PATH)
buildall:
@msdev aprutil.dsw /USEENV /MAKE "aprutil - $(ARCH)"
@msdev aprutil.dsw /USEENV /MAKE "libaprutil - $(ARCH)"
!ENDIF
checkapr:
cd $(APR_PATH)\test
$(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
OUTDIR=$(LIBSOSPATH) check
$(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
OUTDIR=$(ARCHOSPATH) check
cd ..
cd $(APU_PATH)
checkapu:
cd $(APU_PATH)
cd test
$(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
OUTDIR=$(LIBSPATH) APROUTDIR=$(LIBSOSPATH) \
APR_PATH=..\$(APR_PATH) API_PATH=..\$(API_PATH) check
$(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
OUTDIR=$(LIBSPATH) APROUTDIR=$(ARCHOSPATH) \
APR_PATH=..\$(APR_PATH) API_PATH=..\$(API_PATH) check
cd ..
checkall: checkapr checkapu
install:
echo Y >.y
echo A >.A
@if NOT EXIST "$(PREFIX)\." mkdir "$(PREFIX)"
@if NOT EXIST "$(PREFIX)\bin\." mkdir "$(PREFIX)\bin"
@if NOT EXIST "$(PREFIX)\bin\iconv\." mkdir "$(PREFIX)\bin\iconv"
@if NOT EXIST "$(PREFIX)\include\." mkdir "$(PREFIX)\include"
@if NOT EXIST "$(PREFIX)\lib\." mkdir "$(PREFIX)\lib"
copy CHANGES "$(PREFIX)\CHANGES.txt" <.y
copy LICENSE "$(PREFIX)\LICENSE.txt" <.y
copy NOTICE "$(PREFIX)\NOTICE.txt" <.y
xcopy $(APR_PATH)\include\*.h "$(PREFIX)\include\" /d < .a
xcopy $(APU_PATH)\include\*.h "$(PREFIX)\include\" /d < .a
copy $(APR_PATH)\$(LIBSOSPATH)\apr-1.lib "$(PREFIX)\lib\" <.y
copy $(APR_PATH)\$(LIBSOSPATH)\apr-1.pdb "$(PREFIX)\lib\" <.y
copy $(APU_PATH)\$(LIBSPATH)\aprutil-1.lib "$(PREFIX)\lib\" <.y
copy $(APU_PATH)\$(LIBSPATH)\aprutil-1.pdb "$(PREFIX)\lib\" <.y
copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.lib "$(PREFIX)\lib\" <.y
copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.exp "$(PREFIX)\lib\" <.y
copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.lib "$(PREFIX)\lib\" <.y
copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.exp "$(PREFIX)\lib\" <.y
copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.dll "$(PREFIX)\bin\" <.y
copy $(APR_PATH)\$(ARCHOSPATH)\libapr-1.pdb "$(PREFIX)\bin\" <.y
copy $(API_PATH)\$(ARCHPATH)\libapriconv-1.dll "$(PREFIX)\bin\" <.y
copy $(API_PATH)\$(ARCHPATH)\libapriconv-1.pdb "$(PREFIX)\bin\" <.y
copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.dll "$(PREFIX)\bin\" <.y
copy $(APU_PATH)\$(ARCHPATH)\libaprutil-1.pdb "$(PREFIX)\bin\" <.y
xcopy $(API_PATH)\$(ARCHPATH)\iconv\*.so "$(PREFIX)\bin\iconv\" /d < .a
xcopy $(API_PATH)\$(ARCHPATH)\iconv\*.pdb "$(PREFIX)\bin\iconv\" /d < .a
!IFDEF OPENSSL_DIR
copy $(OPENSSL_DIR)\$(SSLBIN)\openssl.exe "$(PREFIX)\bin\" <.y
copy $(OPENSSL_DIR)\$(SSLBIN)\openssl.pdb "$(PREFIX)\bin\" <.y
copy $(OPENSSL_DIR)\$(SSLBIN)\libeay32.dll "$(PREFIX)\bin\" <.y
copy $(OPENSSL_DIR)\$(SSLBIN)\libeay32.pdb "$(PREFIX)\bin\" <.y
copy $(OPENSSL_DIR)\$(SSLBIN)\ssleay32.dll "$(PREFIX)\bin\" <.y
copy $(OPENSSL_DIR)\$(SSLBIN)\ssleay32.pdb "$(PREFIX)\bin\" <.y
@if NOT EXIST "$(PREFIX)\conf\." mkdir "$(PREFIX)\conf"
copy $(OPENSSL_DIR)\apps\openssl.cnf "$(PREFIX)\conf\openssl.cnf" <.y
type << >> "$(PREFIX)\NOTICE.txt"
This binary distribution includes cryptographic software written by
Eric Young (eay@cryptsoft.com), software written by Tim Hudson
(tjh@cryptsoft.com), and software developed by the OpenSSL Project
for use in the OpenSSL Toolkit <http://www.openssl.org/>.
<<
copy LICENSE + << + "$(OPENSSL_DIR)\LICENSE" "$(PREFIX)\LICENSE.txt" <.y
For the libeay32.dll, ssleay32.dll and openssl.exe components:
<<
copy << + $(OPENSSL_DIR)\NEWS "$(PREFIX)\OPENSSL-NEWS.txt" <.y
Apache Portablity Runtime (APR) 1.3 Limited OpenSSL Distribution
This binary distribution includes the minimal components of OpenSSL required
to support aprutil 1.3 and later libraries from the Apache APR Project.
(Details are listed in OPENSSL-README.txt.) For the complete list of CHANGES
to this and later versions of OpenSSL, please refer to the definative source,
<http://www.openssl.org/news/changelog.html>, or see the CHANGES file in the
full binary or source distribution package from <http://www.openssl.org/>.
These OpenSSL binaries were built for distribution from the U.S. without
support for the patented encryption methods IDEA, MDC-2 or RC5.
--------------------------------------------------------------------------------
<<
copy << + $(OPENSSL_DIR)\README "$(PREFIX)\OPENSSL-README.txt" <.y
Apache Portablity Runtime APR-util Limited OpenSSL Distribution
This binary installation of OpenSSL is a limited distribution of the
files derived from the OpenSSL project:
LICENSE.txt (includes openssl LICENSE)
OPENSSL-NEWS.txt
OPENSSL-README.txt
conf\openssl.cnf
bin\libeay32.dll
bin\libeay32.pdb
bin\ssleay32.dll
bin\ssleay32.pdb
bin\openssl.exe
bin\openssl.pdb
These are the minimal libraries and tools required to use the aprutil 1.3
and later library releases distributed by the Apache APR project. No library
link files, headers or sources are distributed with this binary distribution.
Please refer to the <http://www.openssl.org/> site for complete source or
binary distributions.
These OpenSSL binaries were built for distribution from the U.S. without
support for the patented encryption methods IDEA, MDC-2 or RC5.
The Apache APR Project only supports the binary distribution of these files
and development of the mod_ssl module. We cannot provide support assistance
for using or configuring the OpenSSL package or these modules. Please refer
all installation and configuration questions to the appropriate forum,
such as the user supported lists, <http://apr.apache.org/mailing-lists.html>
the Apache APR Projects developer list or <http://www.openssl.org/support/>
the OpenSSL support page.
--------------------------------------------------------------------------------
<<
!ENDIF
del .y
del .a