blob: 7754c69d29ee63a4a0bdcc8fedf6405bcef7eaf3 [file] [log] [blame]
# Makefile for Windows NT and Windows 95/98/2000
# Targets are:
# build - build flood
# install - install a flood build
# clean - remove (most) generated files
#
# The following install defaults may be customized;
#
# Option Default
# SRCLIB $(MAKEDIR)\..\..\httpd-2.0\srclib
# APRPATH $(SRCLIB)\apr
# APRUTILPATH $(APRPATH)\..\apr-util
# REGEXPATH $(SRCLIB)\pcre
# OPENSSLPATH $(SRCLIB)\openssl
#
# For example;
#
# nmake /f Makefile.win PORT=80 INSTDIR="d:\Program Files\Apache" installr
#
# Be aware that certain awk's will not accept backslahed names,
# so the server root should be given in forward slashes (quoted),
# preferably with the drive designation!
default: build
!IF "$(SRCLIB)" == ""
SRCLIB=$(MAKEDIR)\..\..\httpd-2.0\srclib
!MESSAGE Using default SRCLIB path $(SRCLIB)
!ENDIF
!IF "$(APRPATH)" == ""
APRPATH=$(SRCLIB)\apr
!MESSAGE Using default APRPATH $(APRPATH)
!ENDIF
!IF "$(APRUTILPATH)" == ""
APRUTILPATH=$(APRPATH)\..\apr-util
!MESSAGE Using default APRUTILPATH path $(APRUTILPATH)
!ENDIF
!IF "$(REGEXPATH)" == ""
REGEXPATH=$(SRCLIB)\pcre
!MESSAGE Using default REGEXPATH $(REGEXPATH)
!ENDIF
!IF "$(OPENSSLPATH)" == ""
OPENSSLPATH=$(SRCLIB)\openssl
!MESSAGE Using default OPENSSLPATH $(OPENSSLPATH)
!ENDIF
!IF !EXIST("$(APRPATH)")
!MESSAGE Please check out or download and unpack the Apache Portability Runtime
!MESSAGE sources (apr and apr-util) into your $(INSTDIR)\srclib directory.
!MESSAGE flood cannot build without these libraries!
!MESSAGE
!ERROR Need $(APRPATH)
!ENDIF
!IF !EXIST("$(APRUTILPATH)")
!MESSAGE Please check out or download and unpack the Apache Portability Runtime
!MESSAGE sources (apr and apr-util) into your $(INSTDIR)\srclib directory.
!MESSAGE flood cannot build without these libraries!
!MESSAGE
!ERROR Need $(APRUTILPATH)
!ENDIF
!IF !EXIST("$(REGEXPATH)")
!MESSAGE Please check out or download and unpack the pcre regex directory.
!MESSAGE One solution is the Apache 2.0 srclib/pcre distribution.
!MESSAGE flood cannot build without these libraries!
!MESSAGE
!ERROR Need $(REGEXPATH)
!ENDIF
!IF !EXIST("$(OPENSSLPATH)")
!IF EXIST("ssl.discovered")
[del ssl.discovered]
[del config.h]
!ENDIF
HAVE_SSL=0
!ELSE
!IF EXIST("ssl.discovered")
[echo $(OPENSSLPATH) > ssl.discovered]
[del config.h]
!ENDIF
!IFDEF DEBUG
SSLBIN=out32dll.dbg
!ELSE
SSLBIN=out32dll
!ENDIF
HAVE_SSL=1
!ENDIF
!IFDEF DEBUG
SHORT=D
LONG=Debug
!ELSE
SHORT=R
LONG=Release
!ENDIF
floodenv.bat: Makefile.win
echo @echo off>floodenv.bat
echo set SRCLIB=$(SRCLIB)>>floodenv.bat
echo set APRPATH=$(APRPATH)>>floodenv.bat
echo set APRUTILPATH=$(APRUTILPATH)>>floodenv.bat
echo set OPENSSLPATH=$(OPENSSLPATH)>>floodenv.bat
echo set REGEXPATH=$(REGEXPATH)>>floodenv.bat
echo set SSLBIN=$(SSLBIN)>>floodenv.bat
regex.h: $(REGEXPATH)\pcreposix.h
copy "$(REGEXPATH)\pcreposix.h" regex.h < <<
Y
<<
# Yup, we are our own dependency, if this inline script changes
config.h: Makefile.win floodenv.bat config.h.in regex.h
-awk -f <<script.awk config.h.in > config.h
{
sub( /@prngrand@/, "1" );
sub( /@prngrand48@/, "0" );
sub( /@prngrandom@/, "0" );
sub( /@hasstrtoll@/, "0" );
sub( /@hasstrtoq@/, "0" );
sub( /@flood_has_openssl@/, "$(HAVE_SSL)" );
sub( /@flood_has_devrand@/, "0" );
sub( /@CAPATH@/, "certs" );
print $$0;
}
<<
configure: config.h
!IFNDEF MAKEOPT
# Only default the behavior if MAKEOPT= is omitted
!IF "$(MAKE)" == "NMAKE"
# Microsoft NMake options
MAKEOPT=-nologo
!ELSEIF "($MAKE)" == "make"
# Borland make options? Not really supported (yet)
MAKEOPT=-s -N
!ENDIF
!ENDIF
!IF EXIST("flood.mak")
clean:
-floodenv.bat
$(MAKE) $(MAKEOPT) -f flood.mak CFG="flood - Win32 $(LONG)" RECURSE=0 CLEAN
del config.h floodenv.bat regex.h
build: config.h
floodenv.bat
$(MAKE) $(MAKEOPT) -f flood.mak CFG="flood - Win32 $(LONG)" RECURSE=0
!ELSEIF EXIST("flood.sln")
clean:
-floodenv.bat
devenv flood.sln /useenv /clean $(LONG) /project flood
del config.h floodenv.bat regex.h
build: config.h
floodenv.bat
devenv flood.sln /useenv /build $(LONG) /project flood
!ELSE
clean:
-floodenv.bat
msdev flood.dsw /USEENV /MAKE \
"flood - Win32 $(LONG)" /CLEAN
del config.h floodenv.bat regex.h
build: config.h
floodenv.bat
msdev flood.dsw /USEENV /MAKE \
"flood - Win32 $(LONG)"
!ENDIF
install:
echo Y >.y
echo A >.a
-mkdir "$(INSTDIR)"
-mkdir "$(INSTDIR)\bin"
-mkdir "$(INSTDIR)\certs"
copy CHANGES "$(INSTDIR)\CHANGES.txt" <.y
copy CONFIG "$(INSTDIR)\CONFIG.txt" <.y
copy DESIGN "$(INSTDIR)\DESIGN.txt" <.y
copy LICENSE "$(INSTDIR)\LICENSE.txt" <.y
copy $(LONG)\flood.exe "$(INSTDIR)\bin" <.y
!IF EXIST("$(OPENSSLPATH)")
copy $(OPENSSLPATH)\$(SSLBIN)\libeay32.dll "$(INSTDIR)\bin" <.y
copy $(OPENSSLPATH)\$(SSLBIN)\ssleay32.dll "$(INSTDIR)\bin" <.y
xcopy $(OPENSSLPATH)\certs "$(INSTDIR)\certs" < .a
type << >> "$(INSTDIR)\README.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/>.
<<
-awk -f <<script.awk < "$(OPENSSLPATH)\LICENSE" >> "$(INSTDIR)\LICENSE.txt"
BEGIN {
print "";
print "For the libeay32.dll and ssleay32.dll components:";
print "";
while ( getline > 0 ) {
print $$0;
}
}
<<
copy << + $(OPENSSLPATH)\NEWS "$(INSTDIR)\OPENSSL-NEWS.txt" <.y
Apache flood Limited OpenSSL Distribution
This binary distribution includes the minimal components of OpenSSL required
to support flood (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 << + $(OPENSSLPATH)\README "$(INSTDIR)\OPENSSL-README.txt" <.y
Apache flood Limited OpenSSL Distribution
This binary installation of OpenSSL is a limited distribution of the documents
OPENSSL-LICENSE.txt, OPENSSL-NEWS.txt and OPENSSL-README.txt, and the binaries
libeay32.dll
ssleay32.dll
These are the minimal libraries and tools required to use flood with HTTPS
support for SSL v2/v3 and TLS v1. 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 Projects only support the binary distribution of these files
and development of the flood program. 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://httpd.apache.org/userslist.html>
the Apache HTTP Server user's list or <http://www.openssl.org/support/> the
OpenSSL support page.
--------------------------------------------------------------------------------
<<
!ENDIF
del .a .y