upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr / build / NWGNUtail.inc
1 #
2 # This contains final targets and should be included at the end of any
3 # NWGNUmakefile file
4 #
5
6 #
7 # If we are going to create an nlm, make sure we have assigned variables to
8 # use during the link.
9 #
10 echo NLM_NAME=$(NLM_NAME)
11 ifndef NLM_NAME
12 NLM_NAME = $(TARGET_nlm)
13 endif
14
15 ifndef NLM_DESCRIPTION
16 NLM_DESCRIPTION = $(NLM_NAME)
17 endif
18
19 ifndef NLM_THREAD_NAME
20 NLM_THREAD_NAME = $(NLM_NAME) Thread
21 endif
22
23 ifndef NLM_SCREEN_NAME
24 NLM_SCREEN_NAME = DEFAULT
25 endif
26
27 ifndef NLM_COPYRIGHT
28 NLM_COPYRIGHT = Licensed under the Apache License Version 2.0
29 endif
30
31 #
32 # Create dependency lists based on the files available
33 #
34
35
36 CCOPT_DEPENDS   = \
37                                 $(APR_WORK)\build\NWGNUhead.inc \
38                                 $(APR_WORK)\build\NWGNUenvironment.inc \
39                                 $(APR_WORK)\build\NWGNUtail.inc \
40                                 NWGNUmakefile \
41                                 $(CUSTOM_INI) \
42                                 $(EOLIST)
43
44 CPPOPT_DEPENDS  = \
45                                 $(APR_WORK)\build\NWGNUhead.inc \
46                                 $(APR_WORK)\build\NWGNUenvironment.inc \
47                                 $(APR_WORK)\build\NWGNUtail.inc \
48                                 NWGNUmakefile \
49                                 $(CUSTOM_INI) \
50                                 $(EOLIST)
51
52 $(NLM_NAME)_LINKOPT_DEPENDS     = \
53                                 $(TARGET_lib) \
54                                 $(APR_WORK)\build\NWGNUenvironment.inc \
55                                 NWGNUmakefile \
56                                 $(APR_WORK)\build\NWGNUtail.inc \
57                                 $(CUSTOM_INI) \
58                                 $(VERSION_INC) \
59                                 $(EOLIST)
60
61 ifeq "$(words $(strip $(TARGET_lib)))" "1"
62 LIB_NAME                                        = $(basename $(notdir $(TARGET_lib)))
63 $(LIB_NAME)_LIBLST_DEPENDS      = \
64                                 $(FILES_lib_objs) \
65                                 $(APR_WORK)\build\NWGNUenvironment.inc \
66                                 NWGNUmakefile \
67                                 $(APR_WORK)\build\NWGNUtail.inc \
68                                 $(CUSTOM_INI) \
69                                 $(EOLIST)
70 endif
71
72 ifeq "$(wildcard NWGNU$(LIB_NAME))" "NWGNU$(LIB_NAME)"
73 $(LIB_NAME)_LIBLST_DEPENDS      += NWGNU$(LIB_NAME)
74 endif
75
76 ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)"
77 $(NLM_NAME)_LINKOPT_DEPENDS     += NWGNU$(NLM_NAME)
78 CCOPT_DEPENDS   += NWGNU$(NLM_NAME)
79 CPPOPT_DEPENDS  += NWGNU$(NLM_NAME)
80 endif
81
82 #
83 # Generic compiler rules
84 #
85
86 ifneq ($(MAKECMDGOALS),clean)
87 $(APR_WORK)\build\NWGNUversion.inc : $(APR_WORK)\build\nw_ver.awk $(APR_WORK)\include\apr_version.h
88         @echo Generating $(subst /,\,$@)
89         @$(AWK) -f $^ > $@
90
91 -include $(APR_WORK)\build\NWGNUversion.inc
92
93 ifneq "$(strip $(VERSION_STR))" ""
94 VERSION_INC = $(APR_WORK)\build\NWGNUversion.inc
95 else
96 VERSION         = 0,9,0
97 VERSION_STR     = 0.9.0
98 endif
99 endif
100
101 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
102 INCLUDE_BLDCMDS=1
103 endif
104
105 ifeq "$(words $(strip $(TARGET_lib)))" "1"
106 INCLUDE_BLDCMDS=1
107 endif
108
109 ifeq "$(INCLUDE_BLDCMDS)" "1"
110
111 $(OBJDIR)/%.o: %.c $(OBJDIR)\$(NLM_NAME)_cc.opt
112         @echo Compiling $<
113         $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\$(NLM_NAME)_cc.opt
114
115 $(OBJDIR)\$(NLM_NAME)_cc.opt: $(CCOPT_DEPENDS)
116         @echo CCOPT_DEPENDS=$(CCOPT_DEPENDS)
117         $(CHK) $@ $(DEL) $@
118         @echo Generating $@
119 ifneq "$(strip $(CFLAGS))" ""
120         @echo $(CFLAGS) >> $@
121 endif
122 ifneq "$(strip $(XCFLAGS))" ""
123         @echo $(XCFLAGS) >> $@
124 endif
125 ifneq "$(strip $(XINCDIRS))" ""
126         @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@
127 endif
128 ifneq "$(strip $(INCDIRS))" ""
129         @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@
130 endif
131 ifneq "$(strip $(DEFINES))" ""
132         @echo $(DEFINES) >> $@
133 endif
134 ifneq "$(strip $(XDEFINES))" ""
135         @echo $(XDEFINES) >> $@
136 endif
137
138 $(OBJDIR)/%.o: %.cpp $(OBJDIR)\cpp.opt
139         @echo Compiling $<
140         $(CPP) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cpp.opt
141
142 $(OBJDIR)\cpp.opt: $(CPPOPT_DEPENDS)
143         $(CHK) $@ $(DEL) $@
144         @echo Generating $@
145 ifneq "$(strip $(CFLAGS))" ""
146         @echo $(CFLAGS) >> $@
147 endif
148 ifneq "$(strip $(XCFLAGS))" ""
149         @echo $(XCFLAGS) >> $@
150 endif
151 ifneq "$(strip $(XINCDIRS))" ""
152         @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@
153 endif
154 ifneq "$(strip $(INCDIRS))" ""
155         @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@
156 endif
157 ifneq "$(strip $(DEFINES))" ""
158         @echo $(DEFINES) >> $@
159 endif
160 ifneq "$(strip $(XDEFINES))" ""
161         @echo $(XDEFINES) >> $@
162 endif
163
164 endif # one target nlm
165
166 #
167 # Rules to build libraries
168 #
169
170 # If we only have one target library then build it
171
172 ifeq "$(words $(strip $(TARGET_lib)))" "1"
173
174 $(TARGET_lib) : $(OBJDIR)\$(LIB_NAME)_lib.lst
175         @echo Generating $@
176         $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F)
177         $(LIB) -o $(OBJDIR)\$(@F) @$?
178
179 $(OBJDIR)\$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS)
180         $(CHK) $@ $(DEL) $@
181         @echo Generating $@
182 ifneq "$(strip $(FILES_lib_objs))" ""
183         @echo $(foreach objfile,$(FILES_lib_objs),$(subst /,\,$(objfile)) ) >> $@
184 endif
185
186 else # We must have more than one target library so load the individual makefiles
187
188 $(OBJDIR)/%.lib: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(APR_WORK)\build\NWGNUenvironment.inc FORCE
189         @echo Calling $<
190         $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
191
192 endif
193
194 #
195 # Rules to build nlms.
196 #
197
198 vpath libcpre.o $(NOVELLLIBC)\imports
199
200 # If we only have one target NLM then build it
201 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
202
203 $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)\$(NLM_NAME)_link.opt
204         @echo Linking $@
205         $(LINK) @$(OBJDIR)\$(NLM_NAME)_link.opt
206
207 # This will force the link option file to be rebuilt if we change the
208 # corresponding makefile
209
210 $(OBJDIR)\$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS)
211         $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F)
212         $(CHK) $(OBJDIR)\$(NLM_NAME)_link.def $(DEL) $(OBJDIR)\$(NLM_NAME)_link.def
213         @echo Generating $@
214         @echo -warnings off >> $@
215         @echo -zerobss >> $@
216         @echo -desc "$(NLM_DESCRIPTION)" >> $@
217         @echo -o $(TARGET_nlm) >> $@
218 ifneq "$(FILE_nlm_copyright)" ""
219         @-type $(FILE_nlm_copyright) >> $@
220 else
221         @echo -copy "$(NLM_COPYRIGHT)" >> $@
222 endif
223 ifeq "$(RELEASE)" "debug"
224         @echo -g >> $@
225         @echo -sym internal >> $@
226         @echo -sym codeview4 >> $@
227         @echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@
228 else
229         @echo -sym internal >> $@
230 endif
231         @echo -screenname "$(NLM_SCREEN_NAME)" >> $@
232 ifneq "$(NLM_VERSION)" ""
233         @echo -nlmversion=$(NLM_VERSION) >> $@
234 else
235         @echo -nlmversion=$(VERSION) >> $@
236 endif
237         @echo -l $(APR)/$(OBJDIR) >> $@
238         @echo -l $(APRUTIL)/$(OBJDIR) >> $@
239         @echo -l $(XML)/$(OBJDIR) >> $@
240         @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime" >> $@
241         @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++" >> $@
242 ifneq "$(IPV6)" ""
243         @echo -l $(NOVELLLIBC)\include\winsock\IPV6 >> $@
244 endif
245                 @echo -l $(NOVELLLIBC)/imports >> $@
246 ifneq "$(LDAPSDK)" ""
247         @echo -l $(LDAPSDK)/lib/nlm >> $@
248 endif
249         @echo -nodefaults >> $@
250         @echo -map $(OBJDIR)\$(NLM_NAME).map>> $@
251         @echo -threadname "$(NLM_THREAD_NAME)" >> $@
252 ifneq "$(NLM_STACK_SIZE)" ""
253         @echo -stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $@
254 else
255         @echo -stacksize 64000 >> $@
256 endif
257 ifneq "$(NLM_ENTRY_SYM)" ""
258         @echo -entry $(NLM_ENTRY_SYM) >> $@
259 endif
260 ifneq "$(NLM_EXIT_SYM)" ""
261         @echo -exit $(NLM_EXIT_SYM) >> $@
262 endif
263 ifneq "$(NLM_CHECK_SYM)" ""
264         @echo -check $(NLM_CHECK_SYM) >> $@
265 endif
266 ifneq "$(NLM_FLAGS)" ""
267         @echo -flags $(NLM_FLAGS) >> $@
268 endif
269 ifneq "$(strip $(XLFLAGS))" ""
270         @echo $(XLFLAGS) >> $@
271 endif
272 ifneq "$(strip $(FILES_nlm_objs))" ""
273         @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(subst /,\,$(objfile))) >> $@
274 endif
275 ifneq "$(FILES_nlm_libs)" ""
276         @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(subst /,\,$(libfile))) >> $@
277 endif
278         @echo -commandfile $(OBJDIR)\$(NLM_NAME)_link.def >> $@
279 ifneq "$(FILE_nlm_msg)" ""
280         @echo Messages $(FILE_nlm_msg) >> $(OBJDIR)\$(NLM_NAME)_link.def
281 endif
282 ifneq "$(FILE_nlm_hlp)" ""
283         @echo Help $(FILE_nlm_hlp) >> $(OBJDIR)\$(NLM_NAME)_link.def
284 endif
285 ifneq "$(FILES_nlm_modules)" ""
286         @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(subst /,\,$(module))) >> $(OBJDIR)\$(NLM_NAME)_link.def
287 endif
288 ifneq "$(FILES_nlm_Ximports)" ""
289         @echo Import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(OBJDIR)\$(NLM_NAME)_link.def
290 endif
291 ifneq "$(FILES_nlm_exports)" ""
292         @echo Export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def
293 endif
294
295 # if APACHE_UNIPROC is defined, don't include XDCData
296 ifndef APACHE_UNIPROC
297 ifneq "$(string $(XDCDATA))" ""
298         @echo XDCData $(XDCDATA) >> $(OBJDIR)\$(NLM_NAME)_link.def
299 else
300         @echo XDCData $(APR)\misc\netware\apr.xdc >> $(OBJDIR)\$(NLM_NAME)_link.def
301 endif
302 endif
303
304 else # more than one target so look for individual makefiles.
305
306 # Only include these if NO_LICENSE_FILE isn't set to prevent excessive
307 # recursion
308
309 ifndef NO_LICENSE_FILE
310
311 $(OBJDIR)/%.nlm: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(APR_WORK)\build\NWGNUenvironment.inc $(CUSTOM_INI) $(VERSION_INC) FORCE
312         @echo Calling $<
313         $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
314         $(CMD) echo.
315
316 else
317
318 $(TARGET_nlm):
319
320 endif # NO_LICENSE_FILE
321
322 endif # multiple targets
323