00001 # 00002 # This contains final targets and should be included at the end of any 00003 # NWGNUmakefile file 00004 # 00005 00006 # 00007 # If we are going to create an nlm, make sure we have assigned variables to 00008 # use during the link. 00009 # 00010 echo NLM_NAME=$(NLM_NAME) 00011 ifndef NLM_NAME 00012 NLM_NAME = $(TARGET_nlm) 00013 endif 00014 00015 ifndef NLM_DESCRIPTION 00016 NLM_DESCRIPTION = $(NLM_NAME) 00017 endif 00018 00019 ifndef NLM_THREAD_NAME 00020 NLM_THREAD_NAME = $(NLM_NAME) Thread 00021 endif 00022 00023 ifndef NLM_SCREEN_NAME 00024 NLM_SCREEN_NAME = DEFAULT 00025 endif 00026 00027 ifndef NLM_COPYRIGHT 00028 NLM_COPYRIGHT = Licensed under the Apache License, Version 2.0 00029 endif 00030 00031 # 00032 # Create dependency lists based on the files available 00033 # 00034 00035 CCOPT_DEPENDS = \ 00036 $(AP_WORK)\build\NWGNUhead.inc \ 00037 $(AP_WORK)\build\NWGNUenvironment.inc \ 00038 $(AP_WORK)\build\NWGNUtail.inc \ 00039 NWGNUmakefile \ 00040 $(CUSTOM_INI) \ 00041 $(EOLIST) 00042 00043 CPPOPT_DEPENDS = \ 00044 $(AP_WORK)\build\NWGNUhead.inc \ 00045 $(AP_WORK)\build\NWGNUenvironment.inc \ 00046 $(AP_WORK)\build\NWGNUtail.inc \ 00047 NWGNUmakefile \ 00048 $(CUSTOM_INI) \ 00049 $(EOLIST) 00050 00051 $(NLM_NAME)_LINKOPT_DEPENDS = \ 00052 $(TARGET_lib) \ 00053 $(AP_WORK)\build\NWGNUenvironment.inc \ 00054 NWGNUmakefile \ 00055 $(AP_WORK)\build\NWGNUtail.inc \ 00056 $(CUSTOM_INI) \ 00057 $(VERSION_INC) \ 00058 $(EOLIST) 00059 00060 ifeq "$(words $(strip $(TARGET_lib)))" "1" 00061 LIB_NAME = $(basename $(notdir $(TARGET_lib))) 00062 $(LIB_NAME)_LIBLST_DEPENDS = \ 00063 $(FILES_lib_objs) \ 00064 $(AP_WORK)\build\NWGNUenvironment.inc \ 00065 NWGNUmakefile \ 00066 $(AP_WORK)\build\NWGNUtail.inc \ 00067 $(CUSTOM_INI) \ 00068 $(EOLIST) 00069 endif 00070 00071 ifeq "$(wildcard NWGNU$(LIB_NAME))" "NWGNU$(LIB_NAME)" 00072 $(LIB_NAME)_LIBLST_DEPENDS += NWGNU$(LIB_NAME) 00073 endif 00074 00075 ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)" 00076 $(NLM_NAME)_LINKOPT_DEPENDS += NWGNU$(NLM_NAME) 00077 CCOPT_DEPENDS += NWGNU$(NLM_NAME) 00078 CPPOPT_DEPENDS += NWGNU$(NLM_NAME) 00079 endif 00080 00081 # 00082 # Generic compiler rules 00083 # 00084 00085 $(AP_WORK)\build\NWGNUversion.inc : $(AP_WORK)\include\ap_release.h $(AP_WORK)\build\nw_ver.awk 00086 @echo Generating $(subst /,\,$@) 00087 $(AWK) -f $(AP_WORK)\build\nw_ver.awk $(AP_WORK)\include\ap_release.h > $(AP_WORK)\build\NWGNUversion.inc 00088 00089 -include $(AP_WORK)\build\NWGNUversion.inc 00090 00091 ifneq "$(strip $(VERSION_STR))" "" 00092 VERSION_INC = $(AP_WORK)\build\NWGNUversion.inc 00093 else 00094 VERSION = 2,0,0 00095 VERSION_STR = 2.0.0 00096 endif 00097 00098 00099 ifeq "$(words $(strip $(TARGET_nlm)))" "1" 00100 00101 $(OBJDIR)/%.o: %.c $(OBJDIR)\$(NLM_NAME)_cc.opt 00102 @echo Compiling $< 00103 $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\$(NLM_NAME)_cc.opt 00104 00105 $(OBJDIR)\$(NLM_NAME)_cc.opt: $(CCOPT_DEPENDS) 00106 $(CHK) $@ $(DEL) $@ 00107 @echo Generating $@ 00108 ifneq "$(strip $(CFLAGS))" "" 00109 @echo $(CFLAGS) >> $@ 00110 endif 00111 ifneq "$(strip $(XCFLAGS))" "" 00112 @echo $(XCFLAGS) >> $@ 00113 endif 00114 ifneq "$(strip $(XINCDIRS))" "" 00115 @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ 00116 endif 00117 ifneq "$(strip $(INCDIRS))" "" 00118 @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ 00119 endif 00120 ifneq "$(strip $(DEFINES))" "" 00121 @echo $(DEFINES) >> $@ 00122 endif 00123 ifneq "$(strip $(XDEFINES))" "" 00124 @echo $(XDEFINES) >> $@ 00125 endif 00126 00127 $(OBJDIR)/%.o: %.cpp $(OBJDIR)\cpp.opt 00128 @echo Compiling $< 00129 $(CPP) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cpp.opt 00130 00131 $(OBJDIR)\cpp.opt: $(CPPOPT_DEPENDS) 00132 $(CHK) $@ $(DEL) $@ 00133 @echo Generating $@ 00134 ifneq "$(strip $(CFLAGS))" "" 00135 @echo $(CFLAGS) >> $@ 00136 endif 00137 ifneq "$(strip $(XCFLAGS))" "" 00138 @echo $(XCFLAGS) >> $@ 00139 endif 00140 ifneq "$(strip $(XINCDIRS))" "" 00141 @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ 00142 endif 00143 ifneq "$(strip $(INCDIRS))" "" 00144 @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ 00145 endif 00146 ifneq "$(strip $(DEFINES))" "" 00147 @echo $(DEFINES) >> $@ 00148 endif 00149 ifneq "$(strip $(XDEFINES))" "" 00150 @echo $(XDEFINES) >> $@ 00151 endif 00152 00153 endif # one target nlm 00154 00155 # 00156 # Rules to build libraries 00157 # 00158 00159 # If we only have one target library then build it 00160 00161 ifeq "$(words $(strip $(TARGET_lib)))" "1" 00162 00163 $(TARGET_lib) : $(OBJDIR)\$(LIB_NAME)_lib.lst 00164 @echo Generating $@ 00165 $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F) 00166 $(LIB) -o $(OBJDIR)\$(@F) @$? 00167 00168 $(OBJDIR)\$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) 00169 $(CHK) $@ $(DEL) $@ 00170 @echo Generating $@ 00171 ifneq "$(strip $(FILES_lib_objs))" "" 00172 @echo $(foreach objfile,$(FILES_lib_objs),$(subst /,\,$(objfile)) ) >> $@ 00173 endif 00174 00175 else # We must have more than one target library so load the individual makefiles 00176 00177 $(OBJDIR)/%.lib: NWGNU% $(AP_WORK)\build\NWGNUhead.inc $(AP_WORK)\build\NWGNUtail.inc $(AP_WORK)\build\NWGNUenvironment.inc FORCE 00178 @echo Calling $< 00179 $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) 00180 00181 endif 00182 00183 # 00184 # Rules to build nlms. 00185 # 00186 00187 vpath libcpre.o $(NOVELLLIBC)\imports 00188 00189 # If we only have one target NLM then build it 00190 ifeq "$(words $(strip $(TARGET_nlm)))" "1" 00191 00192 $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)\$(NLM_NAME)_link.opt 00193 @echo Linking $@ 00194 $(LINK) @$(OBJDIR)\$(NLM_NAME)_link.opt 00195 00196 # This will force the link option file to be rebuilt if we change the 00197 # corresponding makefile 00198 00199 $(OBJDIR)\$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) 00200 $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F) 00201 $(CHK) $(OBJDIR)\$(NLM_NAME)_link.def $(DEL) $(OBJDIR)\$(NLM_NAME)_link.def 00202 @echo Generating $@ 00203 @echo -warnings off >> $@ 00204 @echo -zerobss >> $@ 00205 @echo -o $(TARGET_nlm) >> $@ 00206 ifneq "$(FILE_nlm_copyright)" "" 00207 @-type $(FILE_nlm_copyright) >> $@ 00208 endif 00209 ifeq "$(RELEASE)" "debug" 00210 @echo -g >> $@ 00211 @echo -sym internal >> $@ 00212 @echo -sym codeview4 >> $@ 00213 @echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@ 00214 else 00215 @echo -sym internal >> $@ 00216 endif 00217 @echo -l $(NWOS) >> $@ 00218 @echo -l $(AP)/$(OBJDIR) >> $@ 00219 @echo -l $(APR)/$(OBJDIR) >> $@ 00220 @echo -l $(APRUTIL)/$(OBJDIR) >> $@ 00221 @echo -l $(PCRE)/$(OBJDIR) >> $@ 00222 @echo -l $(HTTPD)/$(OBJDIR) >> $@ 00223 @echo -l $(SERVER)/$(OBJDIR) >> $@ 00224 @echo -l $(STDMOD)/$(OBJDIR) >> $@ 00225 @echo -l $(NWOS)/$(OBJDIR) >> $@ 00226 @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime" >> $@ 00227 @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++" >> $@ 00228 ifneq "$(IPV6)" "" 00229 @echo -l $(NOVELLLIBC)\include\winsock\IPV6 >> $@ 00230 endif 00231 @echo -l $(NOVELLLIBC)/imports >> $@ 00232 ifneq "$(LDAPSDK)" "" 00233 @echo -l $(LDAPSDK)/lib/nlm >> $@ 00234 endif 00235 @echo -l $(APULDAP)/$(OBJDIR) >> $@ 00236 @echo -l $(XML)/$(OBJDIR) >> $@ 00237 @echo -nodefaults >> $@ 00238 @echo -map $(OBJDIR)\$(NLM_NAME).map>> $@ 00239 ifneq "$(strip $(XLFLAGS))" "" 00240 @echo $(XLFLAGS) >> $@ 00241 endif 00242 ifneq "$(strip $(FILES_nlm_objs))" "" 00243 @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(subst /,\,$(objfile))) >> $@ 00244 endif 00245 ifneq "$(FILES_nlm_libs)" "" 00246 @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(subst /,\,$(libfile))) >> $@ 00247 endif 00248 @echo -commandfile $(OBJDIR)\$(NLM_NAME)_link.def >> $@ 00249 @echo # Do not edit this file - it is created by make! > $(OBJDIR)\$(NLM_NAME)_link.def 00250 @echo # All your changes will be lost!! >> $(OBJDIR)\$(NLM_NAME)_link.def 00251 ifneq "$(FILE_nlm_msg)" "" 00252 @echo Messages $(FILE_nlm_msg) >> $(OBJDIR)\$(NLM_NAME)_link.def 00253 endif 00254 ifneq "$(FILE_nlm_hlp)" "" 00255 @echo Help $(FILE_nlm_hlp) >> $(OBJDIR)\$(NLM_NAME)_link.def 00256 endif 00257 ifeq "$(FILE_nlm_copyright)" "" 00258 @echo copyright "$(NLM_COPYRIGHT)" >> $(OBJDIR)\$(NLM_NAME)_link.def 00259 endif 00260 @echo description "$(NLM_DESCRIPTION)" >> $(OBJDIR)\$(NLM_NAME)_link.def 00261 @echo threadname "$(NLM_THREAD_NAME)" >> $(OBJDIR)\$(NLM_NAME)_link.def 00262 ifneq "$(NLM_STACK_SIZE)" "" 00263 @echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(OBJDIR)\$(NLM_NAME)_link.def 00264 else 00265 @echo stacksize 64000 >> $(OBJDIR)\$(NLM_NAME)_link.def 00266 endif 00267 @echo screenname "$(NLM_SCREEN_NAME)" >> $(OBJDIR)\$(NLM_NAME)_link.def 00268 ifneq "$(NLM_VERSION)" "" 00269 @echo version $(NLM_VERSION) >> $(OBJDIR)\$(NLM_NAME)_link.def 00270 else 00271 @echo version $(VERSION) >> $(OBJDIR)\$(NLM_NAME)_link.def 00272 endif 00273 ifneq "$(NLM_ENTRY_SYM)" "" 00274 @echo start $(NLM_ENTRY_SYM) >> $(OBJDIR)\$(NLM_NAME)_link.def 00275 endif 00276 ifneq "$(NLM_EXIT_SYM)" "" 00277 @echo exit $(NLM_EXIT_SYM) >> $(OBJDIR)\$(NLM_NAME)_link.def 00278 endif 00279 ifneq "$(NLM_CHECK_SYM)" "" 00280 @echo check $(NLM_CHECK_SYM) >> $(OBJDIR)\$(NLM_NAME)_link.def 00281 endif 00282 ifneq "$(NLM_FLAGS)" "" 00283 @echo $(strip $(NLM_FLAGS)) >> $(OBJDIR)\$(NLM_NAME)_link.def 00284 endif 00285 ifneq "$(FILES_nlm_modules)" "" 00286 @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(subst /,\,$(module))) >> $(OBJDIR)\$(NLM_NAME)_link.def 00287 endif 00288 ifneq "$(FILES_nlm_Ximports)" "" 00289 @echo import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(OBJDIR)\$(NLM_NAME)_link.def 00290 endif 00291 ifneq "$(FILES_nlm_exports)" "" 00292 @echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def 00293 endif 00294 00295 # if APACHE_UNIPROC is defined, don't include XDCData 00296 ifndef APACHE_UNIPROC 00297 ifneq "$(string $(XDCDATA))" "" 00298 @echo xdcdata $(XDCDATA) >> $(OBJDIR)\$(NLM_NAME)_link.def 00299 else 00300 @echo xdcdata $(NWOS)\apache.xdc >> $(OBJDIR)\$(NLM_NAME)_link.def 00301 endif 00302 endif 00303 00304 else # more than one target so look for individual makefiles. 00305 00306 # Only include these if NO_LICENSE_FILE isn't set to prevent excessive 00307 # recursion 00308 00309 ifndef NO_LICENSE_FILE 00310 00311 $(OBJDIR)/%.nlm: NWGNU% $(AP_WORK)\build\NWGNUhead.inc $(AP_WORK)\build\NWGNUtail.inc $(AP_WORK)\build\NWGNUenvironment.inc $(CUSTOM_INI) $(VERSION_INC) FORCE 00312 @echo Calling $< 00313 $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) 00314 $(CMD) echo. 00315 00316 else 00317 00318 $(TARGET_nlm): 00319 00320 endif # NO_LICENSE_FILE 00321 00322 endif 00323