]> granicus.if.org Git - apache/blob - NWGNUmakefile
update transformation
[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                         $(SRC)/include \
65                         $(STDMOD)/core \
66                         $(STDMOD)/filters \
67                         $(STDMOD)/generators \
68                         $(STDMOD)/proxy \
69                         $(NWOS) \
70                         $(EOLIST)
71
72 #
73 # These flags will come after CFLAGS
74 #
75 XCFLAGS         += \
76                         -DHAVE_CONFIG_H \
77                         $(EOLIST)
78
79 #
80 # These defines will come after DEFINES
81 #
82 XDEFINES        += \
83                         $(EOLIST)
84
85 #
86 # These flags will be added to the link.opt file
87 #
88 XLFLAGS         += \
89                         $(EOLIST)
90
91 #
92 # These values will be appended to the correct variables based on the value of
93 # RELEASE
94 #
95 ifeq "$(RELEASE)" "debug"
96 XINCDIRS        += \
97                         $(EOLIST)
98
99 XCFLAGS         += \
100                         $(EOLIST)
101
102 XDEFINES        += \
103                         $(EOLIST)
104
105 XLFLAGS         += \
106                         $(EOLIST)
107 endif
108
109 ifeq "$(RELEASE)" "noopt"
110 XINCDIRS        += \
111                         $(EOLIST)
112
113 XCFLAGS         += \
114                         $(EOLIST)
115
116 XDEFINES        += \
117                         $(EOLIST)
118
119 XLFLAGS         += \
120                         $(EOLIST)
121 endif
122
123 ifeq "$(RELEASE)" "release"
124 XINCDIRS        += \
125                         $(EOLIST)
126
127 XCFLAGS         += \
128                         $(EOLIST)
129
130 XDEFINES        += \
131                         $(EOLIST)
132
133 XLFLAGS         += \
134                         $(EOLIST)
135 endif
136
137 #
138 # These are used by the link target if an NLM is being generated
139 # This is used by the link 'name' directive to name the nlm.  If left blank
140 # TARGET_nlm (see below) will be used.
141 #
142 NLM_NAME        = Apache2
143
144 #
145 # This is used by the link '-desc ' directive.
146 # If left blank, NLM_NAME will be used.
147 #
148 NLM_DESCRIPTION = Apache Web Server $(VERSION_STR) $(VERSION_SKT)
149
150 #
151 # This is used by the '-threadname' directive.  If left blank,
152 # NLM_NAME Thread will be used.
153 #
154 NLM_THREAD_NAME = $(NLM_NAME)
155
156 #
157 # This is used by the '-screenname' directive.  If left blank,
158 # 'Apache for NetWare' Thread will be used.
159 #
160 NLM_SCREEN_NAME = Apache $(VERSION_STR) for NetWare
161
162
163 #
164 # If this is specified, it will override VERSION value in
165 # $(AP_WORK)/build/NWGNUenvironment.inc
166 #
167 NLM_VERSION     =
168
169 #
170 # If this is specified, it will override the default of 64K
171 #
172 NLM_STACK_SIZE  = 65536
173
174
175 #
176 # If this is specified it will be used by the link '-entry' directive
177 #
178 NLM_ENTRY_SYM   =
179
180 #
181 # If this is specified it will be used by the link '-exit' directive
182 #
183 NLM_EXIT_SYM    =
184
185 #
186 # If this is specified it will be used by the link '-check' directive
187 #
188 NLM_CHECK_SYM   = _LibCCheckUnload
189
190 #
191 # If these are specified it will be used by the link '-flags' directive
192 #
193 NLM_FLAGS       = PSEUDOPREEMPTION
194
195 #
196 # If this is specified it will be linked in with the XDCData option in the def
197 # file instead of the default of $(NWOS)/apache.xdc.  XDCData can be disabled
198 # by setting APACHE_UNIPROC in the environment
199 #
200 XDCDATA         =
201
202 #
203 # If there is an NLM target, put it here
204 #
205 TARGET_nlm = \
206         $(OBJDIR)/$(NLM_NAME).nlm \
207         $(EOLIST)
208
209 #
210 # If there is an LIB target, put it here
211 #
212 TARGET_lib = \
213         $(PCRELIB) \
214         $(EOLIST)
215
216 #
217 # These are the OBJ files needed to create the NLM target above.
218 # Paths must all use the '/' character
219 #
220 FILES_nlm_objs = \
221         $(OBJDIR)/apreq_cookie.o \
222         $(OBJDIR)/apreq_error.o \
223         $(OBJDIR)/apreq_module.o \
224         $(OBJDIR)/apreq_module_cgi.o \
225         $(OBJDIR)/apreq_module_custom.o \
226         $(OBJDIR)/apreq_param.o \
227         $(OBJDIR)/apreq_parser.o \
228         $(OBJDIR)/apreq_parser_header.o \
229         $(OBJDIR)/apreq_parser_multipart.o \
230         $(OBJDIR)/apreq_parser_urlencoded.o \
231         $(OBJDIR)/apreq_util.o \
232         $(OBJDIR)/buildmark.o \
233         $(OBJDIR)/config.o \
234         $(OBJDIR)/connection.o \
235         $(OBJDIR)/core.o \
236         $(OBJDIR)/core_filters.o \
237         $(OBJDIR)/eoc_bucket.o \
238         $(OBJDIR)/eor_bucket.o \
239         $(OBJDIR)/error_bucket.o \
240         $(OBJDIR)/http_core.o \
241         $(OBJDIR)/http_protocol.o \
242         $(OBJDIR)/http_request.o \
243         $(OBJDIR)/byterange_filter.o \
244         $(OBJDIR)/chunk_filter.o \
245         $(OBJDIR)/http_etag.o \
246         $(OBJDIR)/http_filters.o \
247         $(OBJDIR)/listen.o \
248         $(OBJDIR)/log.o \
249         $(OBJDIR)/main.o \
250         $(OBJDIR)/mod_authn_core.o \
251         $(OBJDIR)/mod_authz_core.o \
252         $(OBJDIR)/mod_authz_host.o \
253         $(OBJDIR)/mod_alias.o \
254         $(OBJDIR)/mod_dir.o \
255         $(OBJDIR)/mod_env.o \
256         $(OBJDIR)/mod_include.o \
257         $(OBJDIR)/mod_log_config.o \
258         $(OBJDIR)/mod_mime.o \
259         $(OBJDIR)/mod_negotiation.o \
260         $(OBJDIR)/mod_netware.o \
261         $(OBJDIR)/mod_setenvif.o \
262         $(OBJDIR)/mod_so.o \
263         $(OBJDIR)/mod_watchdog.o \
264         $(OBJDIR)/modules.o \
265         $(OBJDIR)/mpm_common.o \
266         $(OBJDIR)/mpm_netware.o \
267         $(OBJDIR)/protocol.o \
268         $(OBJDIR)/provider.o \
269         $(OBJDIR)/request.o \
270         $(OBJDIR)/scoreboard.o \
271         $(OBJDIR)/util.o \
272         $(OBJDIR)/util_cfgtree.o \
273         $(OBJDIR)/util_charset.o \
274         $(OBJDIR)/util_cookies.o \
275         $(OBJDIR)/util_debug.o \
276         $(OBJDIR)/util_expr_eval.o \
277         $(OBJDIR)/util_expr_parse.o \
278         $(OBJDIR)/util_expr_scan.o \
279         $(OBJDIR)/util_fcgi.o \
280         $(OBJDIR)/util_filter.o \
281         $(OBJDIR)/util_md5.o \
282         $(OBJDIR)/util_mutex.o \
283         $(OBJDIR)/util_nw.o \
284         $(OBJDIR)/util_pcre.o \
285         $(OBJDIR)/util_regex.o \
286         $(OBJDIR)/util_script.o \
287         $(OBJDIR)/util_time.o \
288         $(OBJDIR)/util_xml.o \
289         $(OBJDIR)/vhost.o \
290         $(EOLIST)
291
292 # Build in mod_nw_ssl if Winsock is being used
293 ifndef USE_STDSOCKETS
294 FILES_nlm_objs += $(OBJDIR)/mod_nw_ssl.o \
295         $(EOLIST)
296 endif
297
298 #
299 # These are the LIB files needed to create the NLM target above.
300 # These will be added as a library command in the link.opt file.
301 #
302 FILES_nlm_libs = \
303         $(PCRELIB) \
304         $(PRELUDE) \
305         $(EOLIST)
306
307 #
308 # These are the modules that the above NLM target depends on to load.
309 # These will be added as a module command in the link.opt file.
310 #
311 FILES_nlm_modules = \
312         aprlib \
313         Libc \
314         $(EOLIST)
315
316 #
317 # If the nlm has a msg file, put it's path here
318 #
319 FILE_nlm_msg =
320
321 #
322 # If the nlm has a hlp file put it's path here
323 #
324 FILE_nlm_hlp =
325
326 #
327 # If this is specified, it will override $(NWOS)\copyright.txt.
328 #
329 FILE_nlm_copyright =
330
331 #
332 # Any additional imports go here
333 #
334 FILES_nlm_Ximports = \
335         @aprlib.imp \
336         @libc.imp \
337         @netware.imp \
338         GetCurrentAddressSpace \
339         $(EOLIST)
340
341 # Don't link with Winsock if standard sockets are being used
342 ifndef USE_STDSOCKETS
343 FILES_nlm_Ximports += @ws2nlm.imp \
344         $(EOLIST)
345 endif
346
347 #
348 # Any symbols exported to here
349 #
350 FILES_nlm_exports = \
351         @httpd.imp \
352         $(EOLIST)
353
354 #
355 # These are the OBJ files needed to create the LIB target above.
356 # Paths must all use the '/' character
357 #
358 ifeq "$(wildcard $(PCRE)/pcre.c)" "$(PCRE)/pcre.c"
359
360 FILES_lib_objs = \
361         $(OBJDIR)/pcre.o \
362         $(EOLIST)
363
364 else
365
366 FILES_lib_objs = \
367         $(OBJDIR)/chartables.o \
368         $(OBJDIR)/pcre_compile.o \
369         $(OBJDIR)/pcre_exec.o \
370         $(OBJDIR)/pcre_fullinfo.o \
371         $(OBJDIR)/pcre_globals.o \
372         $(OBJDIR)/pcre_newline.o \
373         $(OBJDIR)/pcre_tables.o \
374         $(OBJDIR)/pcre_version.o \
375         $(EOLIST)
376 ifeq "$(wildcard $(PCRE)/pcre_try_flipped.c)" "$(PCRE)/pcre_try_flipped.c"
377 FILES_lib_objs += \
378         $(OBJDIR)/pcre_try_flipped.o \
379         $(EOLIST)
380 endif 
381
382 endif
383
384 #
385 # implement targets and dependancies (leave this section alone)
386 #
387
388 libs :: $(OBJDIR) $(TARGET_lib)
389
390 nlms :: libs $(TARGET_nlm)
391
392 #
393 # Updated this target to create necessary directories and copy files to the
394 # correct place.  (See $(AP_WORK)/build/NWGNUhead.inc for examples)
395 #
396 MKCNF   = $(AWK) -v BDIR=$(BASEDIR) -v PORT=$(PORT) -v SSLPORT=$(SSLPORT) -v MODSSL=$(WITH_SSL) -v MODHTTP2=$(WITH_HTTP2) -v BSDSKT=$(USE_STDSOCKETS) -f build/mkconfNW.awk $1 > $2
397
398 install :: nlms instscripts FORCE
399         $(call COPY,$(OBJDIR)/$(NLM_NAME).nlm,                         $(INSTALLBASE)/)
400         $(call COPY,ABOUT_APACHE,                                      $(INSTALLBASE)/)
401         $(call COPY,CHANGES,                                           $(INSTALLBASE)/)
402         $(call COPY,LICENSE,                                           $(INSTALLBASE)/)
403         $(call COPY,README,                                            $(INSTALLBASE)/)
404         $(call COPY,VERSIONING,                                        $(INSTALLBASE)/)
405         $(call COPY,STATUS,                                            $(INSTALLBASE)/)
406         $(call COPY,support/dbmmanage.in,                              $(INSTALLBASE)/bin/dbmmanage.pl)
407         $(call COPY,support/logresolve.pl.in,                          $(INSTALLBASE)/bin/logresolve.pl)
408         $(call COPY,support/split-logfile.in,                          $(INSTALLBASE)/bin/split-logfile.pl)
409         $(call COPY,support/check_forensic,                            $(INSTALLBASE)/bin/check_forensic.sh)
410         $(call COPY,docs/conf/magic,                                   $(INSTALLBASE)/conf/)
411         $(call COPY,docs/conf/mime.types,                              $(INSTALLBASE)/conf/)
412         $(call COPY,docs/conf/charset.conv,                            $(INSTALLBASE)/conf/)
413         $(call COPY,docs/cgi-examples/printenv,                        $(INSTALLBASE)/cgi-bin/printenv.pl)
414         $(call MKCNF,docs/conf/httpd.conf.in,                          $(INSTALLBASE)/conf/httpd.conf)
415         $(call MKCNF,docs/conf/extra/httpd-autoindex.conf.in,          $(INSTALLBASE)/conf/extra/httpd-autoindex.conf)
416         $(call MKCNF,docs/conf/extra/httpd-dav.conf.in,                $(INSTALLBASE)/conf/extra/httpd-dav.conf)
417         $(call MKCNF,docs/conf/extra/httpd-default.conf.in,            $(INSTALLBASE)/conf/extra/httpd-default.conf)
418         $(call MKCNF,docs/conf/extra/httpd-info.conf.in,               $(INSTALLBASE)/conf/extra/httpd-info.conf)
419         $(call MKCNF,docs/conf/extra/httpd-languages.conf.in,          $(INSTALLBASE)/conf/extra/httpd-languages.conf)
420         $(call MKCNF,docs/conf/extra/httpd-macro.conf.in,              $(INSTALLBASE)/conf/extra/httpd-macro.conf)
421         $(call MKCNF,docs/conf/extra/httpd-manual.conf.in,             $(INSTALLBASE)/conf/extra/httpd-manual.conf)
422         $(call MKCNF,docs/conf/extra/httpd-mpm.conf.in,                $(INSTALLBASE)/conf/extra/httpd-mpm.conf)
423         $(call MKCNF,docs/conf/extra/httpd-multilang-errordoc.conf.in, $(INSTALLBASE)/conf/extra/httpd-multilang-errordoc.conf)
424         $(call MKCNF,docs/conf/extra/httpd-userdir.conf.in,            $(INSTALLBASE)/conf/extra/httpd-userdir.conf)
425         $(call MKCNF,docs/conf/extra/httpd-vhosts.conf.in,             $(INSTALLBASE)/conf/extra/httpd-vhosts.conf)
426         $(call MKCNF,docs/conf/extra/httpd-policy.conf.in,             $(INSTALLBASE)/conf/extra/httpd-policy.conf)
427         $(call MKCNF,docs/conf/extra/httpd-ssl.conf.in,                $(INSTALLBASE)/conf/extra/httpd-ssl.conf)
428         $(call MKCNF,docs/conf/extra/proxy-html.conf.in,               $(INSTALLBASE)/conf/extra/proxy-html.conf)
429         $(call COPYR,docs/docroot,                                     $(INSTALLBASE)/htdocs)
430         $(call COPYR,docs/error,                                       $(INSTALLBASE)/error)
431         $(call COPYR,docs/icons,                                       $(INSTALLBASE)/icons)
432         $(call COPYR,docs/man,                                         $(INSTALLBASE)/man)
433         $(call COPYR,docs/manual,                                      $(INSTALLBASE)/manual)
434
435 installdev :: FORCE
436         $(call COPY,$(SRC)/include/*.h,                                $(INSTALLBASE)/include/)
437         $(call COPY,$(NWOS)/*.h,                                       $(INSTALLBASE)/include/)
438         $(call COPY,$(APR)/include/*.h,                                $(INSTALLBASE)/include/)
439         $(call COPY,$(APRUTIL)/include/*.h,                            $(INSTALLBASE)/include/)
440         $(call COPY,$(STDMOD)/core/mod_so.h,                           $(INSTALLBASE)/include/)
441         $(call COPY,$(STDMOD)/core/mod_watchdog.h,                     $(INSTALLBASE)/include/)
442         $(call COPY,$(STDMOD)/cache/mod_cache.h,                       $(INSTALLBASE)/include/)
443         $(call COPY,$(STDMOD)/cache/cache_common.h,                    $(INSTALLBASE)/include/)
444         $(call COPY,$(STDMOD)/database/mod_dbd.h,                      $(INSTALLBASE)/include/)
445         $(call COPY,$(STDMOD)/dav/main/mod_dav.h,                      $(INSTALLBASE)/include/)
446         $(call COPY,$(STDMOD)/filters/mod_include.h,                   $(INSTALLBASE)/include/)
447         $(call COPY,$(STDMOD)/generators/mod_cgi.h,                    $(INSTALLBASE)/include/)
448         $(call COPY,$(STDMOD)/generators/mod_status.h,                 $(INSTALLBASE)/include/)
449         $(call COPY,$(STDMOD)/loggers/mod_log_config.h,                $(INSTALLBASE)/include/)
450         $(call COPY,$(STDMOD)/mappers/mod_rewrite.h,                   $(INSTALLBASE)/include/)
451         $(call COPY,$(STDMOD)/proxy/mod_proxy.h,                       $(INSTALLBASE)/include/)
452         $(call COPY,$(STDMOD)/proxy/mod_serf.h,                        $(INSTALLBASE)/include/)
453         $(call COPY,$(STDMOD)/session/mod_session.h,                   $(INSTALLBASE)/include/)
454         $(call COPY,$(STDMOD)/ssl/mod_ssl.h,                           $(INSTALLBASE)/include/)
455         $(call COPY,$(STDMOD)/ssl/mod_ssl_openssl.h,                   $(INSTALLBASE)/include/)
456         $(call COPY,$(APR)/*.imp,                                      $(INSTALLBASE)/lib/)
457         $(call COPY,$(NWOS)/*.imp,                                     $(INSTALLBASE)/lib/)
458         $(call COPY,$(NWOS)/*.xdc,                                     $(INSTALLBASE)/lib/)
459         $(call COPY,$(APBUILD)/NWGNU*.inc,                             $(INSTALLBASE)/build/)
460
461 prebuild :: FORCE
462         $(MAKE) -C $(SERVER) -f NWGNUmakefile
463         $(MAKE) -C $(PCRE) -f NWGNUmakefile
464         $(call MKDIR,$(PREBUILD_INST))
465         $(call COPY,$(SERVER)/$(OBJDIR)/*.nlm,                         $(PREBUILD_INST)/)
466         $(call COPY,$(PCRE)/$(OBJDIR)/*.nlm,                           $(PREBUILD_INST)/)
467
468 #
469 # Any specialized rules here
470 #
471
472 vpath %.c server:modules/arch/netware:modules/http:modules/aaa:modules/mappers
473 vpath %.c modules/generators:modules/metadata:modules/filters:modules/loggers
474 vpath %.c modules/core:os/netware:server/mpm/netware:$(PCRE)
475
476 $(OBJDIR)/chartables.o: os/netware/chartables.c
477
478 #
479 # Include the 'tail' makefile that has targets that depend on variables defined
480 # in this makefile
481 #
482
483 include $(APBUILD)/NWGNUtail.inc
484
485 include $(APBUILD)/NWGNUscripts.inc
486
487