NWGNUmakefile 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. #
  2. # Declare the sub-directories to be built here
  3. #
  4. SUBDIRS = \
  5. build \
  6. $(APU_WORK) \
  7. $(EOLIST)
  8. #
  9. # Get the 'head' of the build environment. This includes default targets and
  10. # paths to tools
  11. #
  12. include $(APR_WORK)\build\NWGNUhead.inc
  13. #
  14. # build this level's files
  15. #
  16. # Make sure all needed macro's are defined
  17. #
  18. #
  19. # These directories will be at the beginning of the include list, followed by
  20. # INCDIRS
  21. #
  22. XINCDIRS += \
  23. $(APR)/include \
  24. $(APR)/include/arch/NetWare \
  25. $(APR)/include/arch/unix \
  26. $(APR)/memory/unix \
  27. $(APR)/random/unix \
  28. $(APRUTIL)/xml \
  29. $(EOLIST)
  30. #
  31. # These flags will come after CFLAGS
  32. #
  33. XCFLAGS += \
  34. $(EOLIST)
  35. #
  36. # These defines will come after DEFINES
  37. #
  38. XDEFINES += \
  39. $(EOLIST)
  40. #
  41. # These flags will be added to the link.opt file
  42. #
  43. XLFLAGS += \
  44. $(EOLIST)
  45. #
  46. # These values will be appended to the correct variables based on the value of
  47. # RELEASE
  48. #
  49. ifeq "$(RELEASE)" "debug"
  50. XINCDIRS += \
  51. $(EOLIST)
  52. XCFLAGS += \
  53. $(EOLIST)
  54. XDEFINES += \
  55. $(EOLIST)
  56. XLFLAGS += \
  57. $(EOLIST)
  58. endif
  59. ifeq "$(RELEASE)" "noopt"
  60. XINCDIRS += \
  61. $(EOLIST)
  62. XCFLAGS += \
  63. $(EOLIST)
  64. XDEFINES += \
  65. $(EOLIST)
  66. XLFLAGS += \
  67. $(EOLIST)
  68. endif
  69. ifeq "$(RELEASE)" "release"
  70. XINCDIRS += \
  71. $(EOLIST)
  72. XCFLAGS += \
  73. $(EOLIST)
  74. XDEFINES += \
  75. $(EOLIST)
  76. XLFLAGS += \
  77. $(EOLIST)
  78. endif
  79. #
  80. # These are used by the link target if an NLM is being generated
  81. # This is used by the link 'name' directive to name the nlm. If left blank
  82. # TARGET_nlm (see below) will be used.
  83. #
  84. NLM_NAME = aprlib
  85. #
  86. # This is used by the link '-desc ' directive.
  87. # If left blank, NLM_NAME will be used.
  88. #
  89. NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR)
  90. #
  91. # This is used by the '-threadname' directive. If left blank,
  92. # NLM_NAME Thread will be used.
  93. #
  94. NLM_THREAD_NAME =
  95. #
  96. # If this is specified, it will override VERSION value in
  97. # $(APR_WORK)\build\NWGNUenvironment.inc
  98. #
  99. NLM_VERSION =
  100. #
  101. # If this is specified, it will override the default of 64K
  102. #
  103. NLM_STACK_SIZE =
  104. #
  105. # If this is specified it will be used by the link '-entry' directive
  106. #
  107. NLM_ENTRY_SYM = _LibCPrelude
  108. #
  109. # If this is specified it will be used by the link '-exit' directive
  110. #
  111. NLM_EXIT_SYM = _LibCPostlude
  112. #
  113. # If this is specified it will be used by the link '-check' directive
  114. #
  115. NLM_CHECK_SYM =
  116. #
  117. # If this is specified it will be used by the link '-flags' directive
  118. #
  119. NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
  120. #
  121. # If this is specified it will be linked in with the XDCData option in the def
  122. # file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can
  123. # be disabled by setting APACHE_UNIPROC in the environment
  124. #
  125. XDCDATA =
  126. #
  127. # Declare all target files (you must add your files here)
  128. #
  129. #
  130. # If there is an NLM target, put it here
  131. #
  132. TARGET_nlm = \
  133. $(OBJDIR)/aprlib.nlm \
  134. $(EOLIST)
  135. #
  136. # If there is an LIB target, put it here
  137. #
  138. TARGET_lib = \
  139. $(OBJDIR)/aprlib.lib \
  140. $(EOLIST)
  141. #
  142. # These are the OBJ files needed to create the NLM target above.
  143. # Paths must all use the '/' character
  144. #
  145. FILES_nlm_objs = \
  146. $(OBJDIR)/libprews.o \
  147. $(EOLIST)
  148. #
  149. # These are the LIB files needed to create the NLM target above.
  150. # These will be added as a library command in the link.opt file.
  151. #
  152. FILES_nlm_libs = \
  153. libcpre.o \
  154. $(APRLIB) \
  155. $(APRUTLIB) \
  156. $(APULDAPLIB) \
  157. $(XMLLIB) \
  158. $(EOLIST)
  159. #
  160. # These are the modules that the above NLM target depends on to load.
  161. # These will be added as a module command in the link.opt file.
  162. #
  163. FILES_nlm_modules = \
  164. Libc \
  165. $(EOLIST)
  166. # Include the Winsock libraries if Winsock is being used
  167. ifndef USE_STDSOCKETS
  168. FILES_nlm_modules += ws2_32 \
  169. $(EOLIST)
  170. endif
  171. #If the LDAP support is defined then add the auto-load modules
  172. ifneq "$(LDAPSDK)" ""
  173. FILES_nlm_modules += \
  174. lldapsdk \
  175. lldapssl \
  176. $(EOLIST)
  177. endif
  178. #
  179. # If the nlm has a msg file, put it's path here
  180. #
  181. FILE_nlm_msg =
  182. #
  183. # If the nlm has a hlp file put it's path here
  184. #
  185. FILE_nlm_hlp =
  186. #
  187. # If this is specified, it will override $(NWOS)\copyright.txt.
  188. #
  189. FILE_nlm_copyright =
  190. #
  191. # Any additional imports go here
  192. #
  193. FILES_nlm_Ximports = \
  194. @libc.imp \
  195. @netware.imp \
  196. $(EOLIST)
  197. # Include the Winsock imports if Winsock is being used
  198. ifndef USE_STDSOCKETS
  199. FILES_nlm_Ximports += \
  200. @ws2nlm.imp \
  201. WSAStartupRTags \
  202. WSACleanupRTag \
  203. $(EOLIST)
  204. endif
  205. #If the LDAP support is defined then add the imports
  206. ifneq "$(LDAPSDK)" ""
  207. FILES_nlm_Ximports += \
  208. @$(LDAPSDK)/imports/lldapsdk.imp \
  209. @$(LDAPSDK)/imports/lldapssl.imp \
  210. $(EOLIST)
  211. endif
  212. #
  213. # Any symbols exported to here
  214. #
  215. FILES_nlm_exports = \
  216. @aprlib.imp \
  217. $(EOLIST)
  218. #
  219. # These are the OBJ files needed to create the LIB target above.
  220. # Paths must all use the '/' character
  221. #
  222. FILES_lib_objs = \
  223. $(OBJDIR)/apr_atomic.o \
  224. $(OBJDIR)/apr_cpystrn.o \
  225. $(OBJDIR)/apr_fnmatch.o \
  226. $(OBJDIR)/apr_getpass.o \
  227. $(OBJDIR)/apr_hash.o \
  228. $(OBJDIR)/apr_pools.o \
  229. $(OBJDIR)/apr_random.o \
  230. $(OBJDIR)/apr_snprintf.o \
  231. $(OBJDIR)/apr_strings.o \
  232. $(OBJDIR)/apr_strnatcmp.o \
  233. $(OBJDIR)/apr_strtok.o \
  234. $(OBJDIR)/apr_tables.o \
  235. $(OBJDIR)/charset.o \
  236. $(OBJDIR)/copy.o \
  237. $(OBJDIR)/common.o \
  238. $(OBJDIR)/dir.o \
  239. $(OBJDIR)/dso.o \
  240. $(OBJDIR)/errorcodes.o \
  241. $(OBJDIR)/env.o \
  242. $(OBJDIR)/fileacc.o \
  243. $(OBJDIR)/filedup.o \
  244. $(OBJDIR)/filepath.o \
  245. $(OBJDIR)/filepath_util.o \
  246. $(OBJDIR)/filestat.o \
  247. $(OBJDIR)/filesys.o \
  248. $(OBJDIR)/flock.o \
  249. $(OBJDIR)/fullrw.o \
  250. $(OBJDIR)/getopt.o \
  251. $(OBJDIR)/groupinfo.o \
  252. $(OBJDIR)/inet_pton.o \
  253. $(OBJDIR)/inet_ntop.o \
  254. $(OBJDIR)/libprews.o \
  255. $(OBJDIR)/mktemp.o \
  256. $(OBJDIR)/mmap.o \
  257. $(OBJDIR)/multicast.o \
  258. $(OBJDIR)/open.o \
  259. $(OBJDIR)/pipe.o \
  260. $(OBJDIR)/otherchild.o \
  261. $(OBJDIR)/proc.o \
  262. $(OBJDIR)/procsup.o \
  263. $(OBJDIR)/proc_mutex.o \
  264. $(OBJDIR)/rand.o \
  265. $(OBJDIR)/readwrite.o \
  266. $(OBJDIR)/seek.o \
  267. $(OBJDIR)/select.o \
  268. $(OBJDIR)/sendrecv.o \
  269. $(OBJDIR)/sha2.o \
  270. $(OBJDIR)/sha2_glue.o \
  271. $(OBJDIR)/shm.o \
  272. $(OBJDIR)/signals.o \
  273. $(OBJDIR)/sockaddr.o \
  274. $(OBJDIR)/sockets.o \
  275. $(OBJDIR)/sockopt.o \
  276. $(OBJDIR)/start.o \
  277. $(OBJDIR)/tempdir.o \
  278. $(OBJDIR)/thread.o \
  279. $(OBJDIR)/thread_cond.o \
  280. $(OBJDIR)/thread_mutex.o \
  281. $(OBJDIR)/thread_rwlock.o \
  282. $(OBJDIR)/threadpriv.o \
  283. $(OBJDIR)/time.o \
  284. $(OBJDIR)/timestr.o \
  285. $(OBJDIR)/userinfo.o \
  286. $(OBJDIR)/version.o \
  287. $(OBJDIR)/waitio.o \
  288. $(EOLIST)
  289. #
  290. # implement targets and dependancies (leave this section alone)
  291. #
  292. libs :: $(OBJDIR) $(TARGET_lib)
  293. nlms :: libs $(TARGET_nlm)
  294. #
  295. # Updated this target to create necessary directories and copy files to the
  296. # correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples)
  297. #
  298. install :: nlms $(INSTDIRS) FORCE
  299. copy $(OBJDIR)\aprlib.nlm $(INSTALLBASE)\*.*
  300. ifndef DEST
  301. -copy $(subst /,\,$(APR))\STATUS $(INSTALLBASE)\*.apr
  302. -copy $(subst /,\,$(APR))\LICENSE $(INSTALLBASE)\*
  303. -copy $(subst /,\,$(APR))\CHANGES $(INSTALLBASE)\*.apr
  304. -copy $(subst /,\,$(APRUTIL))\STATUS $(INSTALLBASE)\*.apu
  305. -copy $(subst /,\,$(APRUTIL))\CHANGES $(INSTALLBASE)\*.apu
  306. @echo rem copying the docs directories > xc.bat
  307. @echo xcopy docs $(INSTALLBASE)\docs\*.* $(XCOPYSW) >> xc.bat
  308. $(CMD) xc.bat
  309. $(DEL) xc.bat
  310. endif
  311. $(INSTDIRS) ::
  312. $(CHKNOT) $@\NUL mkdir $@
  313. ifndef DEST
  314. installdev :: $(INSTDEVDIRS) FORCE
  315. -copy $(subst /,\,$(APR))\include\*.h $(INSTALLBASE)\include\*.*
  316. -copy $(subst /,\,$(APRUTIL))\include\*.h $(INSTALLBASE)\include\*.*
  317. -copy $(subst /,\,$(APR))\*.imp $(INSTALLBASE)\lib\*.*
  318. -copy $(subst /,\,$(APR))\misc\netware\*.xdc $(INSTALLBASE)\lib\*.*
  319. $(INSTDEVDIRS) ::
  320. $(CHKNOT) $@\NUL mkdir $@
  321. endif
  322. #
  323. # Any specialized rules here
  324. #
  325. vpath %.c atomic/netware:strings:tables:passwd:lib:time/unix
  326. vpath %.c file_io/unix:locks/netware:misc/netware:misc/unix:threadproc/netware
  327. vpath %.c poll/unix:shmem\unix:support/unix:random/unix
  328. vpath %.c dso/netware:memory/unix:mmap/unix:user/netware
  329. # Use the win32 network_io if Winsock is being used
  330. ifdef USE_STDSOCKETS
  331. vpath %.c network_io/unix
  332. else
  333. vpath %.c network_io/win32:network_io/unix
  334. endif
  335. $(OBJDIR)/%.o: file_io/netware/%.c $(OBJDIR)\$(NLM_NAME)_cc.opt
  336. @echo Compiling $<
  337. $(CC) file_io\netware\$(<F) -cwd source -o=$(OBJDIR)\$(@F) @$(OBJDIR)\$(NLM_NAME)_cc.opt
  338. #
  339. # Include the 'tail' makefile that has targets that depend on variables defined
  340. # in this makefile
  341. #
  342. include $(APR_WORK)\build\NWGNUtail.inc