"Fossies" - the Fresh Open Source Software Archive 
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 # Makefile for Windows NT and Windows 95/98/2000
2
3 # Targets are:
4 # _apacher - build Apache in Release mode
5 # _apached - build Apache in Debug mode
6 # installr - build and install a Release build
7 # installd - build and install a Debug build
8 # clean - remove (most) generated files
9 #
10 # The following install defaults may be customized;
11 #
12 # Option Default
13 # INSTDIR /Apache2x
14 # FTPPORT 21
15 # DOMAINNAME example.com
16 # SERVERNAME www.example.com
17 # SERVERNAME admin@example.com
18 #
19 # For example;
20 #
21 # nmake -f Makefile-ftp.win PORT=80 INSTDIR="d:/Program Files/Apache" installr
22 #
23 # Be aware that certain awk's will not accept backslashed names,
24 # so the server root should be given in forward slashes (quoted),
25 # preferably with the drive designation!
26
27 INSTDIR=\Apache22
28
29 !IF EXIST("httpd.vcproj") && ([devenv /help > NUL 2>&1] == 0) \
30 && !defined(USEMAK) && !defined(USEDSW)
31 USESLN=1
32 USEMAK=0
33 USEDSW=0
34 !ELSEIF EXIST("httpd.mak") && !defined(USEDSW)
35 USESLN=0
36 USEMAK=1
37 USEDSW=0
38 !ELSE
39 USESLN=0
40 USEMAK=0
41 USEDSW=1
42 !ENDIF
43
44 !IF ("$(CTARGET)" == "") && ($(USESLN) == 1)
45 CTARGET=/build
46 !ENDIF
47
48 APACHE2_HOME=$(INSTDIR)
49
50 !IF EXIST("$(APACHE2_HOME)\lib\libapr-1.lib")
51 APACHE2_APRSFX=-1
52 !ELSEIF EXIST("$(APACHE2_HOME)\lib\libapr.lib")
53 APACHE2_APRSFX=
54 !ELSE
55 !MESSAGE Point INSTDIR at the directory containing an already installed httpd
56 !MESSAGE including build support directories of lib and include. It must
57 !MESSAGE include apr and apr-util. mod_ftp cannot build without these files!
58 !ENDIF
59
60 !IF "$(INSTDIR)" == ""
61 INSTDIR=\Apache2x
62 !ENDIF
63 !IF "$(DOMAINNAME)" == ""
64 DOMAINNAME=example.com
65 !ENDIF
66 !IF "$(SERVERNAME)" == ""
67 SERVERNAME=www.$(DOMAINNAME)
68 !ENDIF
69 !IF "$(SERVERADMIN)" == ""
70 SERVERADMIN=admin@$(DOMAINNAME)
71 !ENDIF
72 !IF "$(FTPPORT)" == ""
73 FTPPORT=21
74 !ENDIF
75
76 !IF "$(LONG)" == ""
77 !MESSAGE
78 !MESSAGE INSTDIR = $(INSTDIR)
79 !MESSAGE DOMAINNAME = $(DOMAINNAME)
80 !MESSAGE SERVERNAME = $(SERVERNAME)
81 !MESSAGE SERVERADMIN = $(SERVERADMIN)
82 !MESSAGE FTPPORT = $(FTPPORT)
83 !MESSAGE
84 !MESSAGE To change these options use 'nmake -f Makefile-ftp.win [option=value]'
85 !MESSAGE Example: nmake -f Makefile-ftp.win FTPPORT=8021
86 !MESSAGE
87 !ENDIF
88
89 !IFNDEF MAKEOPT
90 # Only default the behavior if MAKEOPT= is omitted
91 !IFDEF _NMAKE_VER
92 # Microsoft NMake options
93 MAKEOPT=-nologo
94 !ELSEIF "$(MAKE)" == "make"
95 # Borland make options? Not really supported (yet)
96 MAKEOPT=-s -N
97 !ENDIF
98 !ENDIF
99
100 _buildr:
101 @$(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=R LONG=Release _build
102
103 _buildd:
104 @$(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=D LONG=Debug _build
105
106 installr:
107 @$(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=R LONG=Release _build _install
108
109 installd:
110 @$(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=D LONG=Debug _build _install
111
112 clean: _cleanr _cleand
113 -if exist Browse\. rd /s Browse < << > nul
114 y
115 <<
116
117 !IF $(USEMAK) == 1
118
119 _cleanr:
120 $(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=R LONG=Release CTARGET=CLEAN _build
121
122 _cleand:
123 $(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=D LONG=Debug CTARGET=CLEAN _build
124
125 _build:
126 echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
127 cd modules\ftp
128 $(MAKE) $(MAKEOPT) -f mod_ftp.mak CFG="mod_ftp - Win32 $(LONG)" RECURSE=0 $(CTARGET)
129 !IFDEF ALL
130 $(MAKE) $(MAKEOPT) -f mod_ftp_example.mak CFG="mod_ftp_example - Win32 $(LONG)" RECURSE=0 $(CTARGET)
131 !ENDIF
132 cd ..\..
133
134 !ELSEIF $(USESLN) == 1
135
136 _cleanr:
137 $(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=R LONG=Release CTARGET="/clean" _build
138
139 _cleand:
140 $(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=D LONG=Debug CTARGET="/clean" _build
141
142 _build:
143 echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
144 devenv mod_ftp.sln /useenv $(CTARGET) $(LONG) /project mod_ftp
145 !IFDEF ALL
146 devenv mod_ftp.sln /useenv $(CTARGET) $(LONG) /project mod_ftp_example
147 !ENDIF
148
149 !ELSE
150
151 _cleanr:
152 @$(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=R LONG=Release CTARGET="/CLEAN" _build
153
154 _cleand:
155 @$(MAKE) $(MAKEOPT) -f Makefile-ftp.win SHORT=D LONG=Debug CTARGET="/CLEAN" _build
156
157 _build:
158 @echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
159 @msdev mod_ftp.dsw /USEENV /MAKE "mod_ftp - Win32 $(LONG)" $(CTARGET)
160 !IFDEF ALL
161 @msdev mod_ftp.dsw /USEENV /MAKE "mod_ftp_example - Win32 $(LONG)" $(CTARGET)
162 !ENDIF
163
164 !ENDIF
165
166 httpd_conffile=$(INSTDIR)\conf\httpd.conf
167 httpd_origconffile=$(INSTDIR)\conf\original\httpd.conf
168
169 _install:
170 echo Y >.y
171 echo A >.A
172 -mkdir "$(INSTDIR)"
173 -mkdir "$(INSTDIR)\conf"
174 -mkdir "$(INSTDIR)\conf\extra"
175 -mkdir "$(INSTDIR)\conf\original"
176 -mkdir "$(INSTDIR)\conf\original\extra"
177 -mkdir "$(INSTDIR)\ftpdocs"
178 -mkdir "$(INSTDIR)\manual"
179 -mkdir "$(INSTDIR)\include"
180 -mkdir "$(INSTDIR)\modules"
181 copy CHANGES-FTP "$(INSTDIR)\CHANGES-FTP.txt" <.y
182 copy LICENSE-FTP "$(INSTDIR)\LICENSE-FTP.txt" <.y
183 copy NOTICE-FTP "$(INSTDIR)\NOTICE-FTP.txt" <.y
184 copy README-FTP "$(INSTDIR)\README-FTP.txt" <.y
185 copy modules\ftp\$(LONG)\mod_ftp.so "$(INSTDIR)\modules" <.y
186 copy modules\ftp\$(LONG)\mod_ftp.pdb "$(INSTDIR)\modules" <.y
187 !IFDEF ALL
188 copy modules\ftp\$(LONG)\mod_ftp_example.so "$(INSTDIR)\modules" <.y
189 copy modules\ftp\$(LONG)\mod_ftp_example.pdb "$(INSTDIR)\modules" <.y
190 !ENDIF
191 xcopy docs\ftproot "$(INSTDIR)\ftpdocs" /d < .a
192 xcopy docs\manual "$(INSTDIR)\manual" /s /d < .a
193 copy include\mod_ftp.h "$(INSTDIR)\include" < .y > nul
194 -awk -f build/addloadexample.awk -v MODULE=ftp -v DSO=.so \
195 -v LIBPATH=modules -v EXAMPLECONF=conf/extra/ftpd.conf \
196 "$(httpd_conffile)" > "$(httpd_origconffile).new" && \
197 ( move "$(httpd_origconffile)" "$(httpd_origconffile).bak" && \
198 move "$(httpd_origconffile).new" $(httpd_origconffile) )
199 -awk -f build/addloadexample.awk -v MODULE=ftp -v DSO=.so \
200 -v LIBPATH=modules -v EXAMPLECONF=conf/extra/ftpd.conf \
201 "$(httpd_conffile)" > "$(httpd_conffile).new" && \
202 ( move "$(httpd_conffile)" "$(httpd_conffile).bak" && \
203 move "$(httpd_conffile).new" $(httpd_conffile) )
204 copy docs\conf\extra\ftpd.conf "$(INSTDIR)\conf\original\extra\ftpd.conf" <.y
205 awk -f << docs\conf\extra\ftpd.conf > "$(INSTDIR)\conf\original\extra\ftpd.conf"
206 /^\#@@LoadFtpModules@@/ { next; }
207 { sub(/@exp_ftpdocsdir@/, "$(INSTDIR:\=/)/ftpdocs");
208 sub(/@exp_runtimedir@/, "logs");
209 sub(/@exp_sysconfdir@/, "conf");
210 sub(/@rel_sysconfdir@/, "conf");
211 sub(/@rel_logfiledir@/, "logs");
212 sub(/@@FTPPort@@/, "$(FTPPORT)");
213 print $0;
214 }
215 <<
216 if not exist "$(INSTDIR)\conf\extra\ftpd.conf" \
217 copy "$(INSTDIR)\conf\original\extra\ftpd.conf" \
218 "$(INSTDIR)\conf\extra\ftpd.conf" <.y
219 del .y
220 del .a
221