2 # This contains final targets and should be included at the end of any
7 # If we are going to create an nlm, make sure we have assigned variables to
11 NLM_NAME = $(TARGET_nlm)
14 ifndef NLM_DESCRIPTION
15 NLM_DESCRIPTION = $(NLM_NAME)
18 ifndef NLM_THREAD_NAME
19 NLM_THREAD_NAME = $(NLM_NAME) Thread
22 ifndef NLM_SCREEN_NAME
23 NLM_SCREEN_NAME = DEFAULT
27 NLM_COPYRIGHT = Licensed under the Apache License, Version 2.0
30 ifeq "$(NLM_FLAGS)" ""
31 NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
34 ifeq "$(NLM_STACK_SIZE)" ""
35 NLM_STACK_SIZE = 65536
38 ifeq "$(NLM_ENTRY_SYM)" ""
39 NLM_ENTRY_SYM = _LibCPrelude
42 ifeq "$(NLM_EXIT_SYM)" ""
43 NLM_EXIT_SYM = _LibCPostlude
46 ifeq "$(NLM_VERSION)" ""
47 NLM_VERSION = $(VERSION)
51 # Create dependency lists based on the files available
55 $(APBUILD)/NWGNUhead.inc \
56 $(APBUILD)/NWGNUenvironment.inc \
57 $(APBUILD)/NWGNUtail.inc \
61 CCOPT_DEPENDS = $(STANDARD_DEPENDS)
63 $(NLM_NAME)_LINKOPT_DEPENDS = \
69 ifeq "$(words $(strip $(TARGET_lib)))" "1"
70 LIB_NAME = $(basename $(notdir $(TARGET_lib)))
71 $(LIB_NAME)_LIBLST_DEPENDS = \
78 ifeq "$(wildcard NWGNU$(LIB_NAME))" "NWGNU$(LIB_NAME)"
79 $(LIB_NAME)_LIBLST_DEPENDS += NWGNU$(LIB_NAME)
80 CCOPT_DEPENDS += NWGNU$(LIB_NAME)
82 CCOPT_DEPENDS += NWGNUmakefile
85 ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)"
86 $(NLM_NAME)_LINKOPT_DEPENDS += NWGNU$(NLM_NAME)
87 CCOPT_DEPENDS += NWGNU$(NLM_NAME)
89 CCOPT_DEPENDS += NWGNUmakefile
92 CPPOPT_DEPENDS = $(CCOPT_DEPENDS)
95 # Generic compiler rules
98 ifneq ($(MAKECMDGOALS),clean)
99 $(APBUILD)/NWGNUversion.inc: $(APBUILD)/nw_ver.awk $(SRC)/include/ap_release.h
100 # @echo Generating $@
101 @echo $(DL)GEN $@$(DL)
104 -include $(APBUILD)/NWGNUversion.inc
106 ifneq "$(strip $(VERSION_STR))" ""
107 VERSION_INC = $(APBUILD)/NWGNUversion.inc
116 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
118 $(OBJDIR)/%.o: %.c $(OBJDIR)/$(NLM_NAME)_cc.opt
119 @echo $(DL)CC $<$(DL)
120 $(CC) -o $@ $< @$(word 2, $^)
122 $(OBJDIR)/$(NLM_NAME)_cc.opt: $(CCOPT_DEPENDS)
124 @echo $(DL)GEN $@$(DL)
125 ifneq "$(strip $(CFLAGS))" ""
126 @echo $(DL)$(CFLAGS)$(DL)>> $@
128 ifneq "$(strip $(XCFLAGS))" ""
129 @echo $(DL)$(XCFLAGS)$(DL)>> $@
131 ifneq "$(strip $(XINCDIRS))" ""
132 @echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@
134 ifneq "$(strip $(INCDIRS))" ""
135 @echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@
137 ifneq "$(strip $(DEFINES))" ""
138 @echo $(DL)$(DEFINES)$(DL)>> $@
140 ifneq "$(strip $(XDEFINES))" ""
141 @echo $(DL)$(XDEFINES)$(DL)>> $@
144 $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(NLM_NAME)_cpp.opt
145 @echo $(DL)CC $<$(DL)
146 $(CC) -o $@ $< @$(word 2, $^)
148 $(OBJDIR)/$(NLM_NAME)_cpp.opt: $(CPPOPT_DEPENDS)
150 @echo $(DL)GEN $@$(DL)
151 ifneq "$(strip $(CFLAGS))" ""
152 @echo $(DL)$(CFLAGS)$(DL)>> $@
154 ifneq "$(strip $(XCFLAGS))" ""
155 @echo $(DL)$(XCFLAGS)$(DL)>> $@
157 ifneq "$(strip $(XINCDIRS))" ""
158 @echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@
160 ifneq "$(strip $(INCDIRS))" ""
161 @echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@
163 ifneq "$(strip $(DEFINES))" ""
164 @echo $(DL)$(DEFINES)$(DL)>> $@
166 ifneq "$(strip $(XDEFINES))" ""
167 @echo $(DL)$(XDEFINES)$(DL)>> $@
170 endif # one target nlm
173 # Rules to build libraries
176 # If we only have one target library then build it
178 ifeq "$(words $(strip $(TARGET_lib)))" "1"
180 $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst
182 @echo $(DL)AR $@$(DL)
185 $(OBJDIR)/$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS)
187 ifneq "$(strip $(FILES_lib_objs))" ""
188 @echo $(DL)GEN $@$(DL)
189 @echo $(DL)$(FILES_lib_objs)$(DL)>> $@
192 else # We must have more than one target library so load the individual makefiles
194 $(OBJDIR)/%.lib: NWGNU% $(STANDARD_DEPENDS) FORCE
195 @echo $(DL)Calling $<$(DL)
196 $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
201 # Rules to build nlms.
204 # If we only have one target NLM then build it
205 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
207 $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt
208 @echo $(DL)LINK $@$(DL)
209 $(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt
211 # This will force the link option file to be rebuilt if we change the
212 # corresponding makefile
214 $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS)
216 $(call DEL,$(@:.opt=.def))
217 @echo $(DL)GEN $@$(DL)
218 @echo $(DL)-warnings off$(DL)>> $@
219 @echo $(DL)-zerobss$(DL)>> $@
220 @echo $(DL)-o $(TARGET_nlm)$(DL)>> $@
221 ifneq "$(FILE_nlm_copyright)" ""
222 @$(CAT) $(FILE_nlm_copyright)>> $@
224 ifeq "$(RELEASE)" "debug"
225 @echo $(DL)-g$(DL)>> $@
226 @echo $(DL)-sym internal$(DL)>> $@
227 @echo $(DL)-sym codeview4$(DL)>> $@
228 @echo $(DL)-osym $(OBJDIR)/$(NLM_NAME).sym$(DL)>> $@
230 @echo $(DL)-sym internal$(DL)>> $@
232 @echo $(DL)-l $(SRC)/$(OBJDIR)$(DL)>> $@
233 @echo $(DL)-l $(HTTPD)/$(OBJDIR)$(DL)>> $@
234 @echo $(DL)-l $(SERVER)/$(OBJDIR)$(DL)>> $@
235 @echo $(DL)-l $(STDMOD)/$(OBJDIR)$(DL)>> $@
236 @echo $(DL)-l $(NWOS)/$(OBJDIR)$(DL)>> $@
237 @echo $(DL)-l $(NWOS)$(DL)>> $@
238 @echo $(DL)-l $(APR)/$(OBJDIR)$(DL)>> $@
239 @echo $(DL)-l $(APR)$(DL)>> $@
240 @echo $(DL)-l $(APRUTIL)/$(OBJDIR)$(DL)>> $@
241 @echo $(DL)-l $(PCRE)/$(OBJDIR)$(DL)>> $@
242 @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL)>> $@
243 @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL)>> $@
245 @echo $(DL)-l $(NOVELLLIBC)/include/winsock/IPV6$(DL)>> $@
247 @echo $(DL)-l $(NOVELLLIBC)/imports$(DL)>> $@
248 ifneq "$(LDAPSDK)" ""
249 @echo $(DL)-l $(LDAPSDK)/imports$(DL)>> $@
251 @echo $(DL)-l $(APULDAP)/$(OBJDIR)$(DL)>> $@
252 @echo $(DL)-l $(XML)/$(OBJDIR)$(DL)>> $@
253 @echo $(DL)-l $(SRC)/$(OBJDIR)$(DL)>> $@
254 @echo $(DL)-nodefaults$(DL)>> $@
255 @echo $(DL)-map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@
256 ifneq "$(strip $(XLFLAGS))" ""
257 @echo $(DL)$(XLFLAGS)$(DL)>> $@
259 ifneq "$(strip $(FILES_nlm_objs))" ""
260 @echo $(DL)$(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile))$(DL)>> $@
262 ifneq "$(FILES_nlm_libs)" ""
263 @echo $(DL)$(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(libfile))$(DL)>> $@
265 @echo $(DL)-commandfile $(@:.opt=.def)$(DL)>> $@
266 @echo $(DL)# Do not edit this file - it is created by make!$(DL)> $(@:.opt=.def)
267 @echo $(DL)# All your changes will be lost!!$(DL)>> $(@:.opt=.def)
268 ifneq "$(FILE_nlm_msg)" ""
269 @echo $(DL)Messages $(FILE_nlm_msg)$(DL)>> $(@:.opt=.def)
271 ifneq "$(FILE_nlm_hlp)" ""
272 @echo $(DL)Help $(FILE_nlm_hlp)$(DL)>> $(@:.opt=.def)
274 ifeq "$(FILE_nlm_copyright)" ""
275 @echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL)>> $(@:.opt=.def)
277 @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL)>> $(@:.opt=.def)
278 @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL)>> $(@:.opt=.def)
279 @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL)>> $(@:.opt=.def)
280 @echo $(DL)stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE))))$(DL)>> $(@:.opt=.def)
281 @echo $(DL)version $(NLM_VERSION) $(DL)>> $(@:.opt=.def)
282 @echo $(DL)start $(NLM_ENTRY_SYM)$(DL)>> $(@:.opt=.def)
283 @echo $(DL)exit $(NLM_EXIT_SYM)$(DL)>> $(@:.opt=.def)
284 ifneq "$(NLM_CHECK_SYM)" ""
285 @echo $(DL)check $(NLM_CHECK_SYM)$(DL)>> $(@:.opt=.def)
287 @echo $(DL)$(strip $(NLM_FLAGS))$(DL)>> $(@:.opt=.def)
288 ifneq "$(FILES_nlm_modules)" ""
289 @echo $(DL)module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module))$(DL)>> $(@:.opt=.def)
291 ifneq "$(FILES_nlm_Ximports)" ""
292 @echo $(DL)import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import))$(DL)>> $(@:.opt=.def)
294 ifneq "$(FILES_nlm_exports)" ""
295 @echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $(@:.opt=.def)
297 # if APACHE_UNIPROC is defined, don't include XDCData
298 ifndef APACHE_UNIPROC
299 ifneq "$(string $(XDCDATA))" ""
300 @echo $(DL)xdcdata $(XDCDATA)$(DL)>> $(@:.opt=.def)
302 @echo $(DL)xdcdata apache.xdc$(DL)>> $(@:.opt=.def)
306 else # more than one target so look for individual makefiles.
308 # Only include these if NO_LICENSE_FILE isn't set to prevent excessive
311 ifndef NO_LICENSE_FILE
313 $(OBJDIR)/%.nlm: NWGNU% $($(NLM_NAME)_LINKOPT_DEPENDS) FORCE
314 @echo $(DL)Calling $<$(DL)
315 $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
322 endif # NO_LICENSE_FILE