2
0

NWGNUtail.inc 8.9 KB

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