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 ifneq "$(findstring clobber_,$(MAKECMDGOALS))" "clobber_"
100 $(APBUILD)/NWGNUversion.inc: $(APBUILD)/nw_ver.awk $(SRC)/include/ap_release.h
101 @echo $(DL)GEN $@$(DL)
102 $(AWK) -f $^ $(SRC)/.svn/all-wcprops > $@
104 -include $(APBUILD)/NWGNUversion.inc
106 ifneq "$(strip $(VERSION_STR))" ""
107 VERSION_INC = $(APBUILD)/NWGNUversion.inc
115 ifeq "$(USE_SVNREV)" "1"
116 ifneq "$(strip $(SVN_REVISION))" ""
117 CFLAGS += -DAP_SERVER_ADD_STRING=\"$(SVN_REVISION)\"
122 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
124 $(OBJDIR)/%.o: %.c $(OBJDIR)/$(NLM_NAME)_cc.opt
125 @echo $(DL)CC $<$(DL)
126 $(CC) -o $@ $< @$(word 2, $^)
128 $(OBJDIR)/$(NLM_NAME)_cc.opt: $(CCOPT_DEPENDS)
130 @echo $(DL)GEN $@$(DL)
131 ifneq "$(strip $(CFLAGS))" ""
132 @echo $(DL)$(CFLAGS)$(DL)>> $@
134 ifneq "$(strip $(XCFLAGS))" ""
135 @echo $(DL)$(XCFLAGS)$(DL)>> $@
137 ifneq "$(strip $(XINCDIRS))" ""
138 @echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@
140 ifneq "$(strip $(INCDIRS))" ""
141 @echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@
143 ifneq "$(strip $(DEFINES))" ""
144 @echo $(DL)$(DEFINES)$(DL)>> $@
146 ifneq "$(strip $(XDEFINES))" ""
147 @echo $(DL)$(XDEFINES)$(DL)>> $@
150 $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(NLM_NAME)_cpp.opt
151 @echo $(DL)CC $<$(DL)
152 $(CC) -o $@ $< @$(word 2, $^)
154 $(OBJDIR)/$(NLM_NAME)_cpp.opt: $(CPPOPT_DEPENDS)
156 @echo $(DL)GEN $@$(DL)
157 ifneq "$(strip $(CFLAGS))" ""
158 @echo $(DL)$(CFLAGS)$(DL)>> $@
160 ifneq "$(strip $(XCFLAGS))" ""
161 @echo $(DL)$(XCFLAGS)$(DL)>> $@
163 ifneq "$(strip $(XINCDIRS))" ""
164 @echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@
166 ifneq "$(strip $(INCDIRS))" ""
167 @echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@
169 ifneq "$(strip $(DEFINES))" ""
170 @echo $(DL)$(DEFINES)$(DL)>> $@
172 ifneq "$(strip $(XDEFINES))" ""
173 @echo $(DL)$(XDEFINES)$(DL)>> $@
176 endif # one target nlm
179 # Rules to build libraries
182 # If we only have one target library then build it
184 ifeq "$(words $(strip $(TARGET_lib)))" "1"
186 $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst
188 @echo $(DL)AR $@$(DL)
191 $(OBJDIR)/$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS)
193 ifneq "$(strip $(FILES_lib_objs))" ""
194 @echo $(DL)GEN $@$(DL)
195 @echo $(DL)$(FILES_lib_objs)$(DL)>> $@
198 else # We must have more than one target library so load the individual makefiles
200 $(OBJDIR)/%.lib: NWGNU% $(STANDARD_DEPENDS) FORCE
201 @echo $(DL)Calling $<$(DL)
202 $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
207 # Rules to build nlms.
210 # If we only have one target NLM then build it
211 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
213 $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt
214 @echo $(DL)LINK $@$(DL)
215 $(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt
217 # This will force the link option file to be rebuilt if we change the
218 # corresponding makefile
220 $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS)
222 $(call DEL,$(@:.opt=.def))
223 @echo $(DL)GEN $@$(DL)
224 @echo $(DL)-warnings off$(DL)>> $@
225 @echo $(DL)-zerobss$(DL)>> $@
226 @echo $(DL)-o $(TARGET_nlm)$(DL)>> $@
227 ifneq "$(FILE_nlm_copyright)" ""
228 @$(CAT) $(FILE_nlm_copyright)>> $@
230 ifeq "$(RELEASE)" "debug"
231 @echo $(DL)-g$(DL)>> $@
232 @echo $(DL)-sym internal$(DL)>> $@
233 @echo $(DL)-sym codeview4$(DL)>> $@
234 @echo $(DL)-osym $(OBJDIR)/$(NLM_NAME).sym$(DL)>> $@
236 @echo $(DL)-sym internal$(DL)>> $@
238 @echo $(DL)-l $(SRC)/$(OBJDIR)$(DL)>> $@
239 @echo $(DL)-l $(HTTPD)/$(OBJDIR)$(DL)>> $@
240 @echo $(DL)-l $(SERVER)/$(OBJDIR)$(DL)>> $@
241 @echo $(DL)-l $(STDMOD)/$(OBJDIR)$(DL)>> $@
242 @echo $(DL)-l $(NWOS)/$(OBJDIR)$(DL)>> $@
243 @echo $(DL)-l $(NWOS)$(DL)>> $@
244 @echo $(DL)-l $(APR)/$(OBJDIR)$(DL)>> $@
245 @echo $(DL)-l $(APR)$(DL)>> $@
246 @echo $(DL)-l $(APRUTIL)/$(OBJDIR)$(DL)>> $@
247 @echo $(DL)-l $(PCRE)/$(OBJDIR)$(DL)>> $@
248 @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL)>> $@
249 @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL)>> $@
251 @echo $(DL)-l $(NOVELLLIBC)/include/winsock/IPV6$(DL)>> $@
253 @echo $(DL)-l $(NOVELLLIBC)/imports$(DL)>> $@
254 ifneq "$(LDAPSDK)" ""
255 @echo $(DL)-l $(LDAPSDK)/imports$(DL)>> $@
257 @echo $(DL)-l $(APULDAP)/$(OBJDIR)$(DL)>> $@
258 @echo $(DL)-l $(XML)/$(OBJDIR)$(DL)>> $@
259 @echo $(DL)-l $(SRC)/$(OBJDIR)$(DL)>> $@
260 @echo $(DL)-nodefaults$(DL)>> $@
261 @echo $(DL)-map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@
262 ifneq "$(strip $(XLFLAGS))" ""
263 @echo $(DL)$(XLFLAGS)$(DL)>> $@
265 ifneq "$(strip $(FILES_nlm_objs))" ""
266 @echo $(DL)$(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile))$(DL)>> $@
268 ifneq "$(FILES_nlm_libs)" ""
269 @echo $(DL)$(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(libfile))$(DL)>> $@
271 @echo $(DL)-commandfile $(@:.opt=.def)$(DL)>> $@
272 @echo $(DL)# Do not edit this file - it is created by make!$(DL)> $(@:.opt=.def)
273 @echo $(DL)# All your changes will be lost!!$(DL)>> $(@:.opt=.def)
274 ifneq "$(FILE_nlm_msg)" ""
275 @echo $(DL)Messages $(FILE_nlm_msg)$(DL)>> $(@:.opt=.def)
277 ifneq "$(FILE_nlm_hlp)" ""
278 @echo $(DL)Help $(FILE_nlm_hlp)$(DL)>> $(@:.opt=.def)
280 ifeq "$(FILE_nlm_copyright)" ""
281 @echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL)>> $(@:.opt=.def)
283 @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL)>> $(@:.opt=.def)
284 @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL)>> $(@:.opt=.def)
285 @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL)>> $(@:.opt=.def)
286 @echo $(DL)stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE))))$(DL)>> $(@:.opt=.def)
287 @echo $(DL)version $(NLM_VERSION) $(DL)>> $(@:.opt=.def)
288 @echo $(DL)start $(NLM_ENTRY_SYM)$(DL)>> $(@:.opt=.def)
289 @echo $(DL)exit $(NLM_EXIT_SYM)$(DL)>> $(@:.opt=.def)
290 ifneq "$(NLM_CHECK_SYM)" ""
291 @echo $(DL)check $(NLM_CHECK_SYM)$(DL)>> $(@:.opt=.def)
293 @echo $(DL)$(strip $(NLM_FLAGS))$(DL)>> $(@:.opt=.def)
294 ifneq "$(FILES_nlm_modules)" ""
295 @echo $(DL)module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module))$(DL)>> $(@:.opt=.def)
297 ifneq "$(FILES_nlm_Ximports)" ""
298 @echo $(DL)import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import))$(DL)>> $(@:.opt=.def)
300 ifneq "$(FILES_nlm_exports)" ""
301 @echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $(@:.opt=.def)
303 # if APACHE_UNIPROC is defined, don't include XDCData
304 ifndef APACHE_UNIPROC
305 ifneq "$(string $(XDCDATA))" ""
306 @echo $(DL)xdcdata $(XDCDATA)$(DL)>> $(@:.opt=.def)
308 @echo $(DL)xdcdata apache.xdc$(DL)>> $(@:.opt=.def)
312 else # more than one target so look for individual makefiles.
314 # Only include these if NO_LICENSE_FILE isn't set to prevent excessive
317 ifndef NO_LICENSE_FILE
319 $(OBJDIR)/%.nlm: NWGNU% $($(NLM_NAME)_LINKOPT_DEPENDS) FORCE
320 @echo $(DL)Calling $<$(DL)
321 $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
328 endif # NO_LICENSE_FILE