-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.win
262 lines (220 loc) · 7.31 KB
/
Makefile.win
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# 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