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
10 echo NLM_NAME=$(NLM_NAME)
12 NLM_NAME = $(TARGET_nlm)
15 ifndef NLM_DESCRIPTION
16 NLM_DESCRIPTION = $(NLM_NAME)
19 ifndef NLM_THREAD_NAME
20 NLM_THREAD_NAME = $(NLM_NAME) Thread
23 ifndef NLM_SCREEN_NAME
24 NLM_SCREEN_NAME = DEFAULT
28 NLM_COPYRIGHT = Licensed under the Apache License Version 2.0
32 # Create dependency lists based on the files available
37 $(APR_WORK)\build\NWGNUhead.inc \
38 $(APR_WORK)\build\NWGNUenvironment.inc \
39 $(APR_WORK)\build\NWGNUtail.inc \
45 $(APR_WORK)\build\NWGNUhead.inc \
46 $(APR_WORK)\build\NWGNUenvironment.inc \
47 $(APR_WORK)\build\NWGNUtail.inc \
52 $(NLM_NAME)_LINKOPT_DEPENDS = \
54 $(APR_WORK)\build\NWGNUenvironment.inc \
56 $(APR_WORK)\build\NWGNUtail.inc \
61 ifeq "$(words $(strip $(TARGET_lib)))" "1"
62 LIB_NAME = $(basename $(notdir $(TARGET_lib)))
63 $(LIB_NAME)_LIBLST_DEPENDS = \
65 $(APR_WORK)\build\NWGNUenvironment.inc \
67 $(APR_WORK)\build\NWGNUtail.inc \
72 ifeq "$(wildcard NWGNU$(LIB_NAME))" "NWGNU$(LIB_NAME)"
73 $(LIB_NAME)_LIBLST_DEPENDS += NWGNU$(LIB_NAME)
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)
83 # Generic compiler rules
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 /,\,$@)
91 -include $(APR_WORK)\build\NWGNUversion.inc
93 ifneq "$(strip $(VERSION_STR))" ""
94 VERSION_INC = $(APR_WORK)\build\NWGNUversion.inc
101 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
105 ifeq "$(words $(strip $(TARGET_lib)))" "1"
109 ifeq "$(INCLUDE_BLDCMDS)" "1"
111 $(OBJDIR)/%.o: %.c $(OBJDIR)\$(NLM_NAME)_cc.opt
113 $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\$(NLM_NAME)_cc.opt
115 $(OBJDIR)\$(NLM_NAME)_cc.opt: $(CCOPT_DEPENDS)
116 @echo CCOPT_DEPENDS=$(CCOPT_DEPENDS)
119 ifneq "$(strip $(CFLAGS))" ""
120 @echo $(CFLAGS) >> $@
122 ifneq "$(strip $(XCFLAGS))" ""
123 @echo $(XCFLAGS) >> $@
125 ifneq "$(strip $(XINCDIRS))" ""
126 @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@
128 ifneq "$(strip $(INCDIRS))" ""
129 @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@
131 ifneq "$(strip $(DEFINES))" ""
132 @echo $(DEFINES) >> $@
134 ifneq "$(strip $(XDEFINES))" ""
135 @echo $(XDEFINES) >> $@
138 $(OBJDIR)/%.o: %.cpp $(OBJDIR)\cpp.opt
140 $(CPP) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cpp.opt
142 $(OBJDIR)\cpp.opt: $(CPPOPT_DEPENDS)
145 ifneq "$(strip $(CFLAGS))" ""
146 @echo $(CFLAGS) >> $@
148 ifneq "$(strip $(XCFLAGS))" ""
149 @echo $(XCFLAGS) >> $@
151 ifneq "$(strip $(XINCDIRS))" ""
152 @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@
154 ifneq "$(strip $(INCDIRS))" ""
155 @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@
157 ifneq "$(strip $(DEFINES))" ""
158 @echo $(DEFINES) >> $@
160 ifneq "$(strip $(XDEFINES))" ""
161 @echo $(XDEFINES) >> $@
164 endif # one target nlm
167 # Rules to build libraries
170 # If we only have one target library then build it
172 ifeq "$(words $(strip $(TARGET_lib)))" "1"
174 $(TARGET_lib) : $(OBJDIR)\$(LIB_NAME)_lib.lst
176 $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F)
177 $(LIB) -o $(OBJDIR)\$(@F) @$?
179 $(OBJDIR)\$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS)
182 ifneq "$(strip $(FILES_lib_objs))" ""
183 @echo $(foreach objfile,$(FILES_lib_objs),$(subst /,\,$(objfile)) ) >> $@
186 else # We must have more than one target library so load the individual makefiles
188 $(OBJDIR)/%.lib: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(APR_WORK)\build\NWGNUenvironment.inc FORCE
190 $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
195 # Rules to build nlms.
198 vpath libcpre.o $(NOVELLLIBC)\imports
200 # If we only have one target NLM then build it
201 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
203 $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)\$(NLM_NAME)_link.opt
205 $(LINK) @$(OBJDIR)\$(NLM_NAME)_link.opt
207 # This will force the link option file to be rebuilt if we change the
208 # corresponding makefile
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
214 @echo -warnings off >> $@
216 @echo -desc "$(NLM_DESCRIPTION)" >> $@
217 @echo -o $(TARGET_nlm) >> $@
218 ifneq "$(FILE_nlm_copyright)" ""
219 @-type $(FILE_nlm_copyright) >> $@
221 @echo -copy "$(NLM_COPYRIGHT)" >> $@
223 ifeq "$(RELEASE)" "debug"
225 @echo -sym internal >> $@
226 @echo -sym codeview4 >> $@
227 @echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@
229 @echo -sym internal >> $@
231 @echo -screenname "$(NLM_SCREEN_NAME)" >> $@
232 ifneq "$(NLM_VERSION)" ""
233 @echo -nlmversion=$(NLM_VERSION) >> $@
235 @echo -nlmversion=$(VERSION) >> $@
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++" >> $@
243 @echo -l $(NOVELLLIBC)\include\winsock\IPV6 >> $@
245 @echo -l $(NOVELLLIBC)/imports >> $@
246 ifneq "$(LDAPSDK)" ""
247 @echo -l $(LDAPSDK)/lib/nlm >> $@
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)))) >> $@
255 @echo -stacksize 64000 >> $@
257 ifneq "$(NLM_ENTRY_SYM)" ""
258 @echo -entry $(NLM_ENTRY_SYM) >> $@
260 ifneq "$(NLM_EXIT_SYM)" ""
261 @echo -exit $(NLM_EXIT_SYM) >> $@
263 ifneq "$(NLM_CHECK_SYM)" ""
264 @echo -check $(NLM_CHECK_SYM) >> $@
266 ifneq "$(NLM_FLAGS)" ""
267 @echo -flags $(NLM_FLAGS) >> $@
269 ifneq "$(strip $(XLFLAGS))" ""
270 @echo $(XLFLAGS) >> $@
272 ifneq "$(strip $(FILES_nlm_objs))" ""
273 @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(subst /,\,$(objfile))) >> $@
275 ifneq "$(FILES_nlm_libs)" ""
276 @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(subst /,\,$(libfile))) >> $@
278 @echo -commandfile $(OBJDIR)\$(NLM_NAME)_link.def >> $@
279 ifneq "$(FILE_nlm_msg)" ""
280 @echo Messages $(FILE_nlm_msg) >> $(OBJDIR)\$(NLM_NAME)_link.def
282 ifneq "$(FILE_nlm_hlp)" ""
283 @echo Help $(FILE_nlm_hlp) >> $(OBJDIR)\$(NLM_NAME)_link.def
285 ifneq "$(FILES_nlm_modules)" ""
286 @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(subst /,\,$(module))) >> $(OBJDIR)\$(NLM_NAME)_link.def
288 ifneq "$(FILES_nlm_Ximports)" ""
289 @echo Import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(OBJDIR)\$(NLM_NAME)_link.def
291 ifneq "$(FILES_nlm_exports)" ""
292 @echo Export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def
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
300 @echo XDCData $(APR)\misc\netware\apr.xdc >> $(OBJDIR)\$(NLM_NAME)_link.def
304 else # more than one target so look for individual makefiles.
306 # Only include these if NO_LICENSE_FILE isn't set to prevent excessive
309 ifndef NO_LICENSE_FILE
311 $(OBJDIR)/%.nlm: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(APR_WORK)\build\NWGNUenvironment.inc $(CUSTOM_INI) $(VERSION_INC) FORCE
313 $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
320 endif # NO_LICENSE_FILE
322 endif # multiple targets