]> granicus.if.org Git - apache/blob - NWGNUmakefile
The discussion of conditional logging is much better than I remember it being.
[apache] / NWGNUmakefile
1 #
2 # Define our required macro's if not already done.
3 #
4
5 ifndef AP_WORK
6 export AP_WORK = $(CURDIR)
7 endif
8
9 ifndef APR_WORK
10 ifeq "$(wildcard $(AP_WORK)/srclib/apr)" "$(AP_WORK)/srclib/apr"
11 export APR_WORK = $(AP_WORK)/srclib/apr
12 endif
13 endif
14 ifneq "$(wildcard $(APR_WORK)/include/apr_version.h)" "$(APR_WORK)/include/apr_version.h"
15 $(error APR_WORK does not point to a valid APR source tree) 
16 endif
17
18 ifndef APU_WORK
19 ifeq "$(wildcard $(AP_WORK)/srclib/apr-util)" "$(AP_WORK)/srclib/apr-util"
20 export APU_WORK = $(AP_WORK)/srclib/apr-util
21 endif
22 endif
23 ifndef APU_WORK
24 ifeq "$(wildcard $(APR_WORK)/include/apu_version.h)" "$(APR_WORK)/include/apu_version.h"
25 export APU_WORK = $(APR_WORK)
26 endif
27 endif
28 ifneq "$(wildcard $(APU_WORK)/include/apu_version.h)" "$(APU_WORK)/include/apu_version.h"
29 $(error APU_WORK does not point to a valid APU source tree) 
30 endif
31
32 #
33 # Declare the sub-directories to be built here
34 #
35
36 SUBDIRS = \
37         $(APR_WORK) \
38         build \
39         support \
40         modules \
41         $(EOLIST)
42
43 #
44 # Get the 'head' of the build environment.  This includes default targets and
45 # paths to tools
46 #
47
48 include $(AP_WORK)\build\NWGNUhead.inc
49
50 #
51 # build this level's files
52
53 #
54 # Make sure all needed macro's are defined
55 #
56
57 #
58 # These directories will be at the beginning of the include list, followed by
59 # INCDIRS
60 #
61 XINCDIRS        += \
62                         $(APR)/include \
63                         $(APRUTIL)/include \
64                         $(AP_WORK)/include \
65                         $(STDMOD)/aaa \
66                         $(STDMOD)/core \
67                         $(STDMOD)/filters \
68                         $(STDMOD)/generators \
69                         $(STDMOD)/http \
70                         $(STDMOD)/loggers \
71                         $(STDMOD)/mappers \
72                         $(STDMOD)/proxy \
73                         $(STDMOD)/ssl \
74                         $(AP_WORK)/server/mpm/netware \
75                         $(PCRE) \
76                         $(NWOS) \
77                         $(EOLIST)
78
79 #
80 # These flags will come after CFLAGS
81 #
82 XCFLAGS         += \
83                         -DHAVE_CONFIG_H \
84                         $(EOLIST)
85
86 #
87 # These defines will come after DEFINES
88 #
89 XDEFINES        += \
90                         $(EOLIST)
91
92 #
93 # These flags will be added to the link.opt file
94 #
95 XLFLAGS         += \
96                         $(EOLIST)
97
98 #
99 # These values will be appended to the correct variables based on the value of
100 # RELEASE
101 #
102 ifeq "$(RELEASE)" "debug"
103 XINCDIRS        += \
104                         $(EOLIST)
105
106 XCFLAGS         += \
107                         $(EOLIST)
108
109 XDEFINES        += \
110                         $(EOLIST)
111
112 XLFLAGS         += \
113                         $(EOLIST)
114 endif
115
116 ifeq "$(RELEASE)" "noopt"
117 XINCDIRS        += \
118                         $(EOLIST)
119
120 XCFLAGS         += \
121                         $(EOLIST)
122
123 XDEFINES        += \
124                         $(EOLIST)
125
126 XLFLAGS         += \
127                         $(EOLIST)
128 endif
129
130 ifeq "$(RELEASE)" "release"
131 XINCDIRS        += \
132                         $(EOLIST)
133
134 XCFLAGS         += \
135                         $(EOLIST)
136
137 XDEFINES        += \
138                         $(EOLIST)
139
140 XLFLAGS         += \
141                         $(EOLIST)
142 endif
143
144 #
145 # These are used by the link target if an NLM is being generated
146 # This is used by the link 'name' directive to name the nlm.  If left blank
147 # TARGET_nlm (see below) will be used.
148 #
149 NLM_NAME        = Apache2
150
151 #
152 # This is used by the link '-desc ' directive.
153 # If left blank, NLM_NAME will be used.
154 #
155 NLM_DESCRIPTION = Apache Web Server $(VERSION_STR) $(VERSION_SKT)
156
157 #
158 # This is used by the '-threadname' directive.  If left blank,
159 # NLM_NAME Thread will be used.
160 #
161 NLM_THREAD_NAME = $(NLM_NAME)
162
163 #
164 # This is used by the '-screenname' directive.  If left blank,
165 # 'Apache for NetWare' Thread will be used.
166 #
167 NLM_SCREEN_NAME = Apache $(VERSION_STR) for NetWare
168
169
170 #
171 # If this is specified, it will override VERSION value in
172 # $(AP_WORK)\build\NWGNUenvironment.inc
173 #
174 NLM_VERSION     =
175
176 #
177 # If this is specified, it will override the default of 64K
178 #
179 NLM_STACK_SIZE  = 65536
180
181
182 #
183 # If this is specified it will be used by the link '-entry' directive
184 #
185 NLM_ENTRY_SYM   = _LibCPrelude
186
187 #
188 # If this is specified it will be used by the link '-exit' directive
189 #
190 NLM_EXIT_SYM    = _LibCPostlude
191
192 #
193 # If this is specified it will be used by the link '-check' directive
194 #
195 NLM_CHECK_SYM   = _LibCCheckUnload
196
197 #
198 # If these are specified it will be used by the link '-flags' directive
199 #
200 NLM_FLAGS       = PSEUDOPREEMPTION
201
202 #
203 # If this is specified it will be linked in with the XDCData option in the def
204 # file instead of the default of $(NWOS)/apache.xdc.  XDCData can be disabled
205 # by setting APACHE_UNIPROC in the environment
206 #
207 XDCDATA         =
208
209 #
210 # If there is an NLM target, put it here
211 #
212 TARGET_nlm = \
213         $(OBJDIR)/$(NLM_NAME).nlm \
214         $(EOLIST)
215
216 #
217 # If there is an LIB target, put it here
218 #
219 TARGET_lib = \
220         $(OBJDIR)/pcre.lib \
221         $(EOLIST)
222
223 #
224 # These are the OBJ files needed to create the NLM target above.
225 # Paths must all use the '/' character
226 #
227 FILES_nlm_objs = \
228         $(OBJDIR)/buildmark.o \
229         $(OBJDIR)/config.o \
230         $(OBJDIR)/connection.o \
231         $(OBJDIR)/core.o \
232         $(OBJDIR)/core_filters.o \
233         $(OBJDIR)/eoc_bucket.o \
234         $(OBJDIR)/eor_bucket.o \
235         $(OBJDIR)/error_bucket.o \
236         $(OBJDIR)/http_core.o \
237         $(OBJDIR)/http_protocol.o \
238         $(OBJDIR)/http_request.o \
239         $(OBJDIR)/byterange_filter.o \
240         $(OBJDIR)/chunk_filter.o \
241         $(OBJDIR)/http_etag.o \
242         $(OBJDIR)/http_filters.o \
243         $(OBJDIR)/listen.o \
244         $(OBJDIR)/log.o \
245         $(OBJDIR)/main.o \
246         $(OBJDIR)/mod_authn_core.o \
247         $(OBJDIR)/mod_authz_core.o \
248         $(OBJDIR)/mod_authz_host.o \
249         $(OBJDIR)/mod_alias.o \
250         $(OBJDIR)/mod_dir.o \
251         $(OBJDIR)/mod_env.o \
252         $(OBJDIR)/mod_include.o \
253         $(OBJDIR)/mod_log_config.o \
254         $(OBJDIR)/mod_mime.o \
255         $(OBJDIR)/mod_negotiation.o \
256         $(OBJDIR)/mod_netware.o \
257         $(OBJDIR)/mod_setenvif.o \
258         $(OBJDIR)/mod_so.o \
259         $(OBJDIR)/mod_watchdog.o \
260         $(OBJDIR)/modules.o \
261         $(OBJDIR)/mpm_common.o \
262         $(OBJDIR)/mpm_netware.o \
263         $(OBJDIR)/protocol.o \
264         $(OBJDIR)/provider.o \
265         $(OBJDIR)/request.o \
266         $(OBJDIR)/scoreboard.o \
267         $(OBJDIR)/util.o \
268         $(OBJDIR)/util_cfgtree.o \
269         $(OBJDIR)/util_charset.o \
270         $(OBJDIR)/util_cookies.o \
271         $(OBJDIR)/util_debug.o \
272         $(OBJDIR)/util_expr.o \
273         $(OBJDIR)/util_filter.o \
274         $(OBJDIR)/util_md5.o \
275         $(OBJDIR)/util_mutex.o \
276         $(OBJDIR)/util_nw.o \
277         $(OBJDIR)/util_pcre.o \
278         $(OBJDIR)/util_regex.o \
279         $(OBJDIR)/util_script.o \
280         $(OBJDIR)/util_time.o \
281         $(OBJDIR)/util_xml.o \
282         $(OBJDIR)/vhost.o \
283         $(EOLIST)
284
285 # Build in mod_nw_ssl if Winsock is being used
286 ifndef USE_STDSOCKETS
287 FILES_nlm_objs += $(OBJDIR)/mod_nw_ssl.o \
288         $(EOLIST)
289 endif
290
291 #
292 # These are the LIB files needed to create the NLM target above.
293 # These will be added as a library command in the link.opt file.
294 #
295 FILES_nlm_libs = \
296         $(PCRELIB) \
297         libcpre.o \
298         $(EOLIST)
299
300 #
301 # These are the modules that the above NLM target depends on to load.
302 # These will be added as a module command in the link.opt file.
303 #
304 FILES_nlm_modules = \
305         aprlib \
306         Libc \
307         $(EOLIST)
308
309 #
310 # If the nlm has a msg file, put it's path here
311 #
312 FILE_nlm_msg =
313
314 #
315 # If the nlm has a hlp file put it's path here
316 #
317 FILE_nlm_hlp =
318
319 #
320 # If this is specified, it will override $(NWOS)\copyright.txt.
321 #
322 FILE_nlm_copyright =
323
324 #
325 # Any additional imports go here
326 #
327 FILES_nlm_Ximports = \
328         @netware.imp \
329         @$(APR)/aprlib.imp \
330         @libc.imp \
331         GetCurrentAddressSpace \
332         $(EOLIST)
333
334 # Don't link with Winsock if standard sockets are being used
335 ifndef USE_STDSOCKETS
336 FILES_nlm_Ximports += @ws2nlm.imp \
337         $(EOLIST)
338 endif
339
340 #
341 # Any symbols exported to here
342 #
343 FILES_nlm_exports = \
344         @$(NWOS)/httpd.imp \
345         $(EOLIST)
346
347 #
348 # These are the OBJ files needed to create the LIB target above.
349 # Paths must all use the '/' character
350 #
351 ifeq "$(wildcard $(PCRE)/pcre.c)" "$(PCRE)/pcre.c"
352
353 FILES_lib_objs = \
354         $(OBJDIR)/pcre.o \
355         $(EOLIST)
356
357 else
358
359 FILES_lib_objs = \
360         $(OBJDIR)/pcre_compile.o \
361         $(OBJDIR)/pcre_exec.o \
362         $(OBJDIR)/pcre_fullinfo.o \
363         $(OBJDIR)/pcre_globals.o \
364         $(OBJDIR)/pcre_info.o \
365         $(OBJDIR)/pcre_newline.o \
366         $(OBJDIR)/pcre_tables.o \
367         $(OBJDIR)/pcre_try_flipped.o \
368         $(OBJDIR)/pcre_version.o \
369         $(EOLIST)
370
371 endif
372
373 FILES_lib_objs += \
374         $(OBJDIR)/chartables.o \
375         $(EOLIST)
376
377 #
378 # implement targets and dependancies (leave this section alone)
379 #
380
381 libs :: $(OBJDIR) $(TARGET_lib)
382
383 nlms :: libs $(TARGET_nlm)
384
385 #
386 # Updated this target to create necessary directories and copy files to the
387 # correct place.  (See $(AP_WORK)\build\NWGNUhead.inc for examples)
388 #
389 install :: nlms instscripts FORCE
390         -copy $(OBJDIR)\$(NLM_NAME).nlm  $(INSTALL)\$(BASEDIR)\*.*
391         -copy ABOUT_APACHE               $(INSTALL)\$(BASEDIR)\*.*
392         -copy CHANGES                    $(INSTALL)\$(BASEDIR)\*.*
393         -copy LICENSE                    $(INSTALL)\$(BASEDIR)\*.*
394         -copy README                     $(INSTALL)\$(BASEDIR)\*.*
395         -copy VERSIONING                 $(INSTALL)\$(BASEDIR)\*.*
396         -copy STATUS                     $(INSTALL)\$(BASEDIR)\*.*
397         -copy support\dbmmanage.in       $(INSTALL)\$(BASEDIR)\bin\dbmmanage.pl
398         -copy support\logresolve.pl.in   $(INSTALL)\$(BASEDIR)\bin\logresolve.pl
399         -copy support\split-logfile.in   $(INSTALL)\$(BASEDIR)\bin\split-logfile.pl
400         -copy support\check_forensic     $(INSTALL)\$(BASEDIR)\bin\check_forensic.sh
401         -copy docs\conf\magic            $(INSTALL)\$(BASEDIR)\conf\magic
402         -copy docs\conf\mime.types       $(INSTALL)\$(BASEDIR)\conf\mime.types
403         -copy docs\conf\charset.conv     $(INSTALL)\$(BASEDIR)\conf\charset.conv
404         -copy docs\cgi-examples\printenv $(INSTALL)\$(BASEDIR)\cgi-bin\printenv.pl
405         -$(AWK) -v BDIR=$(BASEDIR) -v PORT=$(PORT) -v SSLPORT=$(SSLPORT) -v MODSSL=$(WITH_MOD_SSL) -v BSDSKT=$(USE_STDSOCKETS) -f build\mkconfnw.awk docs\conf\httpd.conf.in >$(INSTALL)\$(BASEDIR)\conf\httpd.conf
406         $(CHKNOT) $(INSTALL)\$(BASEDIR)\conf\extra\nul mkdir $(INSTALL)\$(BASEDIR)\conf\extra
407         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-autoindex.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-autoindex.conf
408         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-dav.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-dav.conf
409         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-default.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-default.conf
410         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-info.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-info.conf
411         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-languages.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-languages.conf
412         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-manual.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-manual.conf
413         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-mpm.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-mpm.conf
414         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-multilang-errordoc.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-multilang-errordoc.conf
415         -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-userdir.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-userdir.conf
416         -$(AWK) -v BDIR=$(BASEDIR) -v PORT=$(PORT) -f build\mkconfnw.awk docs\conf\extra\httpd-vhosts.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-vhosts.conf
417         -$(AWK) -v BDIR=$(BASEDIR) -v SSLPORT=$(SSLPORT) -f build\mkconfnw.awk docs\conf\extra\httpd-ssl.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-ssl.conf
418         @xcopy $(XCOPYSW) docs\error     $(INSTALL)\$(BASEDIR)\error
419         @xcopy $(XCOPYSW) docs\docroot   $(INSTALL)\$(BASEDIR)\htdocs
420         @xcopy $(XCOPYSW) docs\icons     $(INSTALL)\$(BASEDIR)\icons
421         @xcopy $(XCOPYSW) docs\man       $(INSTALL)\$(BASEDIR)\man
422         @xcopy $(XCOPYSW) docs\manual    $(INSTALL)\$(BASEDIR)\manual
423
424 installdev :: FORCE
425         -copy $(subst /,\,$(AP_WORK))\include\*.h  $(INSTALL)\$(BASEDIR)\include\*.*
426         -copy $(subst /,\,$(NWOS))\*.h             $(INSTALL)\$(BASEDIR)\include\*.*
427         -copy $(subst /,\,$(APR))\include\*.h      $(INSTALL)\$(BASEDIR)\include\*.*
428         -copy $(subst /,\,$(APRUTIL))\include\*.h  $(INSTALL)\$(BASEDIR)\include\*.*
429         -copy $(subst /,\,$(APR))\*.imp            $(INSTALL)\$(BASEDIR)\lib\*.*
430         -copy $(subst /,\,$(NWOS))\*.imp           $(INSTALL)\$(BASEDIR)\lib\*.*
431         -copy $(subst /,\,$(NWOS))\*.xdc           $(INSTALL)\$(BASEDIR)\lib\*.*
432
433 prebuild :: FORCE
434         $(MAKE) -C $(SERVER) -f NWGNUmakefile
435         $(MAKE) -C $(PCRE) -f NWGNUmakefile
436         $(CHKNOT) $(subst /,\,$(PREBUILD_INST))\nul mkdir $(subst /,\,$(PREBUILD_INST))
437         -copy $(AP_WORK)\server\$(OBJDIR)\*.nlm $(PREBUILD_INST)\*.*
438         -copy $(PCRE)\$(basename $(OBJDIR))\*.nlm $(PREBUILD_INST)\*.*
439
440 #
441 # Any specialized rules here
442 #
443
444 vpath %.c server:modules/arch/netware:modules/http:modules/aaa:modules/mappers
445 vpath %.c modules/generators:modules/metadata:modules/filters:modules/loggers
446 vpath %.c modules/core:os/netware:server/mpm/netware:$(PCRE)
447
448 #
449 # Include the 'tail' makefile that has targets that depend on variables defined
450 # in this makefile
451 #
452
453 include $(AP_WORK)\build\NWGNUtail.inc
454
455 include $(AP_WORK)\build\NWGNUscripts.inc
456
457