NWGNUmakefile 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. #
  2. # Define our required macro's if not already done.
  3. #
  4. ifndef AP_WORK
  5. export AP_WORK = $(CURDIR)
  6. endif
  7. ifndef APR_WORK
  8. ifeq "$(wildcard $(AP_WORK)/srclib/apr)" "$(AP_WORK)/srclib/apr"
  9. export APR_WORK = $(AP_WORK)/srclib/apr
  10. endif
  11. endif
  12. ifneq "$(wildcard $(APR_WORK)/include/apr_version.h)" "$(APR_WORK)/include/apr_version.h"
  13. $(error APR_WORK does not point to a valid APR source tree)
  14. endif
  15. ifndef APU_WORK
  16. ifeq "$(wildcard $(AP_WORK)/srclib/apr-util)" "$(AP_WORK)/srclib/apr-util"
  17. export APU_WORK = $(AP_WORK)/srclib/apr-util
  18. endif
  19. endif
  20. ifndef APU_WORK
  21. ifeq "$(wildcard $(APR_WORK)/include/apu_version.h)" "$(APR_WORK)/include/apu_version.h"
  22. export APU_WORK = $(APR_WORK)
  23. endif
  24. endif
  25. ifneq "$(wildcard $(APU_WORK)/include/apu_version.h)" "$(APU_WORK)/include/apu_version.h"
  26. $(error APU_WORK does not point to a valid APU source tree)
  27. endif
  28. #
  29. # Declare the sub-directories to be built here
  30. #
  31. SUBDIRS = \
  32. $(APR_WORK) \
  33. build \
  34. support \
  35. modules \
  36. $(EOLIST)
  37. #
  38. # Get the 'head' of the build environment. This includes default targets and
  39. # paths to tools
  40. #
  41. include $(AP_WORK)\build\NWGNUhead.inc
  42. #
  43. # build this level's files
  44. #
  45. # Make sure all needed macro's are defined
  46. #
  47. #
  48. # These directories will be at the beginning of the include list, followed by
  49. # INCDIRS
  50. #
  51. XINCDIRS += \
  52. $(APR)/include \
  53. $(APRUTIL)/include \
  54. $(AP_WORK)/include \
  55. $(AP_WORK)/modules/filters/ \
  56. $(AP_WORK)/modules/generators/ \
  57. $(AP_WORK)/modules/http/ \
  58. $(AP_WORK)/modules/loggers/ \
  59. $(AP_WORK)/modules/mappers/ \
  60. $(AP_WORK)/modules/proxy/ \
  61. $(AP_WORK)/server/mpm/NetWare \
  62. $(PCRE) \
  63. $(NWOS) \
  64. $(EOLIST)
  65. #
  66. # These flags will come after CFLAGS
  67. #
  68. XCFLAGS += \
  69. $(EOLIST)
  70. #
  71. # These defines will come after DEFINES
  72. #
  73. XDEFINES += \
  74. $(EOLIST)
  75. #
  76. # These flags will be added to the link.opt file
  77. #
  78. XLFLAGS += \
  79. $(EOLIST)
  80. #
  81. # These values will be appended to the correct variables based on the value of
  82. # RELEASE
  83. #
  84. ifeq "$(RELEASE)" "debug"
  85. XINCDIRS += \
  86. $(EOLIST)
  87. XCFLAGS += \
  88. $(EOLIST)
  89. XDEFINES += \
  90. $(EOLIST)
  91. XLFLAGS += \
  92. $(EOLIST)
  93. endif
  94. ifeq "$(RELEASE)" "noopt"
  95. XINCDIRS += \
  96. $(EOLIST)
  97. XCFLAGS += \
  98. $(EOLIST)
  99. XDEFINES += \
  100. $(EOLIST)
  101. XLFLAGS += \
  102. $(EOLIST)
  103. endif
  104. ifeq "$(RELEASE)" "release"
  105. XINCDIRS += \
  106. $(EOLIST)
  107. XCFLAGS += \
  108. $(EOLIST)
  109. XDEFINES += \
  110. $(EOLIST)
  111. XLFLAGS += \
  112. $(EOLIST)
  113. endif
  114. #
  115. # These are used by the link target if an NLM is being generated
  116. # This is used by the link 'name' directive to name the nlm. If left blank
  117. # TARGET_nlm (see below) will be used.
  118. #
  119. NLM_NAME = Apache2
  120. #
  121. # This is used by the link '-desc ' directive.
  122. # If left blank, NLM_NAME will be used.
  123. #
  124. NLM_DESCRIPTION = Apache Web Server $(VERSION_STR) $(VERSION_SKT)
  125. #
  126. # This is used by the '-threadname' directive. If left blank,
  127. # NLM_NAME Thread will be used.
  128. #
  129. NLM_THREAD_NAME = Apache
  130. #
  131. # This is used by the '-screenname' directive. If left blank,
  132. # 'Apache for NetWare' Thread will be used.
  133. #
  134. NLM_SCREEN_NAME = Apache $(VERSION_STR) for NetWare
  135. #
  136. # If this is specified, it will override VERSION value in
  137. # $(AP_WORK)\build\NWGNUenvironment.inc
  138. #
  139. NLM_VERSION =
  140. #
  141. # If this is specified, it will override the default of 64K
  142. #
  143. NLM_STACK_SIZE = 65536
  144. #
  145. # If this is specified it will be used by the link '-entry' directive
  146. #
  147. NLM_ENTRY_SYM = _LibCPrelude
  148. #
  149. # If this is specified it will be used by the link '-exit' directive
  150. #
  151. NLM_EXIT_SYM = _LibCPostlude
  152. #
  153. # If this is specified it will be used by the link '-check' directive
  154. #
  155. NLM_CHECK_SYM = _LibCCheckUnload
  156. #
  157. # If these are specified it will be used by the link '-flags' directive
  158. #
  159. NLM_FLAGS = PSEUDOPREEMPTION
  160. #
  161. # If this is specified it will be linked in with the XDCData option in the def
  162. # file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled
  163. # by setting APACHE_UNIPROC in the environment
  164. #
  165. XDCDATA =
  166. #
  167. # If there is an NLM target, put it here
  168. #
  169. TARGET_nlm = \
  170. $(OBJDIR)/Apache2.nlm \
  171. $(EOLIST)
  172. #
  173. # If there is an LIB target, put it here
  174. #
  175. TARGET_lib = \
  176. $(EOLIST)
  177. #
  178. # These are the OBJ files needed to create the NLM target above.
  179. # Paths must all use the '/' character
  180. #
  181. FILES_nlm_objs = \
  182. $(OBJDIR)/buildmark.o \
  183. $(OBJDIR)/config.o \
  184. $(OBJDIR)/connection.o \
  185. $(OBJDIR)/core.o \
  186. $(OBJDIR)/core_filters.o \
  187. $(OBJDIR)/eoc_bucket.o \
  188. $(OBJDIR)/error_bucket.o \
  189. $(OBJDIR)/http_core.o \
  190. $(OBJDIR)/http_protocol.o \
  191. $(OBJDIR)/http_request.o \
  192. $(OBJDIR)/byterange_filter.o \
  193. $(OBJDIR)/chunk_filter.o \
  194. $(OBJDIR)/http_etag.o \
  195. $(OBJDIR)/http_filters.o \
  196. $(OBJDIR)/listen.o \
  197. $(OBJDIR)/log.o \
  198. $(OBJDIR)/main.o \
  199. $(OBJDIR)/mod_authz_host.o \
  200. $(OBJDIR)/mod_alias.o \
  201. $(OBJDIR)/mod_dir.o \
  202. $(OBJDIR)/mod_env.o \
  203. $(OBJDIR)/mod_include.o \
  204. $(OBJDIR)/mod_log_config.o \
  205. $(OBJDIR)/mod_mime.o \
  206. $(OBJDIR)/mod_negotiation.o \
  207. $(OBJDIR)/mod_netware.o \
  208. $(OBJDIR)/mod_setenvif.o \
  209. $(OBJDIR)/mod_so.o \
  210. $(OBJDIR)/modules.o \
  211. $(OBJDIR)/mpm_common.o \
  212. $(OBJDIR)/mpm_netware.o \
  213. $(OBJDIR)/pcre.o \
  214. $(OBJDIR)/protocol.o \
  215. $(OBJDIR)/provider.o \
  216. $(OBJDIR)/request.o \
  217. $(OBJDIR)/scoreboard.o \
  218. $(OBJDIR)/util.o \
  219. $(OBJDIR)/util_cfgtree.o \
  220. $(OBJDIR)/util_charset.o \
  221. $(OBJDIR)/util_debug.o \
  222. $(OBJDIR)/util_filter.o \
  223. $(OBJDIR)/util_md5.o \
  224. $(OBJDIR)/util_nw.o \
  225. $(OBJDIR)/util_pcre.o \
  226. $(OBJDIR)/util_script.o \
  227. $(OBJDIR)/util_time.o \
  228. $(OBJDIR)/util_xml.o \
  229. $(OBJDIR)/vhost.o \
  230. $(EOLIST)
  231. # Build in mod_nw_ssl if Winsock is being used
  232. ifndef USE_STDSOCKETS
  233. FILES_nlm_objs += $(OBJDIR)/mod_nw_ssl.o \
  234. $(EOLIST)
  235. endif
  236. #
  237. # These are the LIB files needed to create the NLM target above.
  238. # These will be added as a library command in the link.opt file.
  239. #
  240. FILES_nlm_libs = \
  241. libcpre.o \
  242. $(EOLIST)
  243. #
  244. # These are the modules that the above NLM target depends on to load.
  245. # These will be added as a module command in the link.opt file.
  246. #
  247. FILES_nlm_modules = \
  248. aprlib \
  249. Libc \
  250. $(EOLIST)
  251. #
  252. # If the nlm has a msg file, put it's path here
  253. #
  254. FILE_nlm_msg =
  255. #
  256. # If the nlm has a hlp file put it's path here
  257. #
  258. FILE_nlm_hlp =
  259. #
  260. # If this is specified, it will override $(NWOS)\copyright.txt.
  261. #
  262. FILE_nlm_copyright =
  263. #
  264. # Any additional imports go here
  265. #
  266. FILES_nlm_Ximports = \
  267. @netware.imp \
  268. @$(APR)/aprlib.imp \
  269. @libc.imp \
  270. GetCurrentAddressSpace \
  271. $(EOLIST)
  272. # Don't link with Winsock if standard sockets are being used
  273. ifndef USE_STDSOCKETS
  274. FILES_nlm_Ximports += @ws2nlm.imp \
  275. $(EOLIST)
  276. endif
  277. #
  278. # Any symbols exported to here
  279. #
  280. FILES_nlm_exports = \
  281. @$(NWOS)/httpd.imp \
  282. $(EOLIST)
  283. #
  284. # These are the OBJ files needed to create the LIB target above.
  285. # Paths must all use the '/' character
  286. #
  287. FILES_lib_objs = \
  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 $(AP_WORK)\build\NWGNUhead.inc for examples)
  297. #
  298. install :: nlms instscripts FORCE
  299. -copy $(OBJDIR)\Apache2.nlm $(INSTALL)\$(BASEDIR)\*.*
  300. -copy ABOUT_APACHE $(INSTALL)\$(BASEDIR)\*.*
  301. -copy README $(INSTALL)\$(BASEDIR)\*.*
  302. -copy STATUS $(INSTALL)\$(BASEDIR)\*.*
  303. -copy LICENSE $(INSTALL)\$(BASEDIR)\*.*
  304. -copy CHANGES $(INSTALL)\$(BASEDIR)\*.*
  305. -copy VERSIONING $(INSTALL)\$(BASEDIR)\*.*
  306. -copy support\dbmmanage.in $(INSTALL)\$(BASEDIR)\bin\dbmmanage.pl
  307. -copy support\logresolve.pl.in $(INSTALL)\$(BASEDIR)\bin\logresolve.pl
  308. -copy support\split-logfile.in $(INSTALL)\$(BASEDIR)\bin\split-logfile.pl
  309. -$(AWK) -v BDIR=$(BASEDIR) -v PORT=$(PORT) -v SSLPORT=$(SSLPORT) -v MODSSL=$(WITH_MOD_SSL) -v BSDSKT=$(USE_STDSOCKETS) -f build\mkconfnw.awk docs\conf\httpd.conf.in >$(INSTALL)\$(BASEDIR)\conf\httpd.conf
  310. $(CHKNOT) $(INSTALL)\$(BASEDIR)\conf\extra\nul mkdir $(INSTALL)\$(BASEDIR)\conf\extra
  311. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-autoindex.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-autoindex.conf
  312. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-dav.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-dav.conf
  313. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-default.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-default.conf
  314. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-info.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-info.conf
  315. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-languages.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-languages.conf
  316. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-manual.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-manual.conf
  317. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-mpm.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-mpm.conf
  318. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-multilang-errordoc.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-multilang-errordoc.conf
  319. -$(AWK) -v BDIR=$(BASEDIR) -f build\mkconfnw.awk docs\conf\extra\httpd-userdir.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-userdir.conf
  320. -$(AWK) -v BDIR=$(BASEDIR) -v PORT=$(PORT) -f build\mkconfnw.awk docs\conf\extra\httpd-vhosts.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-vhosts.conf
  321. -$(AWK) -v BDIR=$(BASEDIR) -v SSLPORT=$(SSLPORT) -f build\mkconfnw.awk docs\conf\extra\httpd-ssl.conf.in >$(INSTALL)\$(BASEDIR)\conf\extra\httpd-ssl.conf
  322. -copy docs\conf\magic $(INSTALL)\$(BASEDIR)\conf\magic
  323. -copy docs\conf\mime.types $(INSTALL)\$(BASEDIR)\conf\mime.types
  324. -copy docs\conf\charset.conv $(INSTALL)\$(BASEDIR)\conf\charset.conv
  325. -copy docs\cgi-examples\printenv $(INSTALL)\$(BASEDIR)\cgi-bin\printenv.pl
  326. @xcopy $(XCOPYSW) docs\error $(INSTALL)\$(BASEDIR)\error
  327. @xcopy $(XCOPYSW) docs\docroot $(INSTALL)\$(BASEDIR)\htdocs
  328. @xcopy $(XCOPYSW) docs\icons $(INSTALL)\$(BASEDIR)\icons
  329. @xcopy $(XCOPYSW) docs\man $(INSTALL)\$(BASEDIR)\man
  330. @xcopy $(XCOPYSW) docs\manual $(INSTALL)\$(BASEDIR)\manual
  331. installdev :: FORCE
  332. -copy $(subst /,\,$(AP_WORK))\include\*.h $(INSTALL)\$(BASEDIR)\include\*.*
  333. -copy $(subst /,\,$(AP_WORK))\os\netware\*.h $(INSTALL)\$(BASEDIR)\include\*.*
  334. -copy $(subst /,\,$(NWOS))\*.imp $(INSTALL)\$(BASEDIR)\lib\*.*
  335. -copy $(subst /,\,$(APR))\include\*.h $(INSTALL)\$(BASEDIR)\include\*.*
  336. -copy $(subst /,\,$(APRUTIL))\include\*.h $(INSTALL)\$(BASEDIR)\include\*.*
  337. -copy $(subst /,\,$(APR))\*.imp $(INSTALL)\$(BASEDIR)\lib\*.*
  338. -copy $(subst /,\,$(NWOS))\*.xdc $(INSTALL)\$(BASEDIR)\lib\*.*
  339. prebuild :: FORCE
  340. $(MAKE) -C server -f NWGNUMakefile
  341. $(MAKE) -C srclib/pcre -f NWGNUMakefile
  342. $(CHKNOT) $(PREBUILD_INST)\nul mkdir $(PREBUILD_INST)
  343. -copy $(AP_WORK)\server\$(OBJDIR)\*.nlm $(PREBUILD_INST)\*.*
  344. -copy $(AP_WORK)\srclib\pcre\$(basename $(OBJDIR))\*.nlm $(PREBUILD_INST)\*.*
  345. #
  346. # Any specialized rules here
  347. #
  348. vpath %.c server:modules/arch/netware:modules/http:modules/aaa:modules/mappers
  349. vpath %.c modules/generators:modules/metadata:modules/filters:modules/loggers
  350. vpath %.c os/netware:server/mpm/netware:srclib/pcre
  351. #
  352. # Include the 'tail' makefile that has targets that depend on variables defined
  353. # in this makefile
  354. #
  355. include $(AP_WORK)\build\NWGNUtail.inc
  356. include $(AP_WORK)\build\NWGNUscripts.inc