MAKEFILE 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. #
  2. # Command & Conquer Red Alert(tm)
  3. # Copyright 2025 Electronic Arts Inc.
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. #
  18. #***************************************************************************
  19. #** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
  20. #***************************************************************************
  21. #* *
  22. #* Project Name : Westwood Library .LIB makefile *
  23. #* *
  24. #* File Name : MAKEFILE *
  25. #* *
  26. #* Programmer : Julio R. Jerez *
  27. #* *
  28. #* Start Date : Jan 26, 1995 *
  29. #* *
  30. #* *
  31. #*-------------------------------------------------------------------------*
  32. #* *
  33. #* Required environment variables: *
  34. #* WIN32LIB = your root WWFLAT path *
  35. #* WIN32VCS = root directory for wwlib version control archive *
  36. #* COMPILER = your Watcom installation path *
  37. #* *
  38. #* Required changes to makefile: *
  39. #* LIBS = list of all component libraries *
  40. #* *
  41. #* NOTE: For this makefile to work, each library directory MUST have the *
  42. #* same name as its library. *
  43. #* *
  44. #* "make install" installs the library on your drive *
  45. #* "make update" updates all source files in your slice *
  46. #* *
  47. #* To install or update just one library you may type: *
  48. #* "make -DLIBS=misc.lib install" *
  49. #* *
  50. #***************************************************************************
  51. !ifndef %WIN32LIB
  52. WIN32LIB=.
  53. !else
  54. WIN32LIB=$(%WIN32LIB)
  55. !endif
  56. !ifndef %WIN32VCS
  57. WIN32VCS=.
  58. !else
  59. WIN32VCS=$(%WIN32VCS)
  60. !endif
  61. #===========================================================================
  62. # User-defined section: list each library in this macro
  63. # NOTE: These are some order dependencies:
  64. # 1. The directory MISC must always be made first.
  65. # 2. The directory VIDEO must be made before the SYSTEM directory.
  66. #===========================================================================
  67. LIB_NAME = win32lib
  68. LIB_DIR = $(WIN32LIB)\lib
  69. #---------------------------------------------------------------------------
  70. # LIBS macro: a list of all component libraries
  71. # "make LIBS=xxxx.lib [target]" makes/installs/updates only that library
  72. #---------------------------------------------------------------------------
  73. LIBS = &
  74. audio.lib &
  75. dipthong.lib &
  76. drawbuff.lib &
  77. font.lib &
  78. iff.lib &
  79. keyboard.lib &
  80. mem.lib &
  81. misc.lib &
  82. mono.lib &
  83. palette.lib &
  84. shape.lib &
  85. tile.lib &
  86. timer.lib &
  87. ww_win.lib &
  88. wsa.lib &
  89. profile.lib &
  90. playcd.lib &
  91. wincomm.lib
  92. LIB_INSTALL = &
  93. audio.ins &
  94. dipthong.ins &
  95. drawbuff.ins &
  96. font.ins &
  97. iff.ins &
  98. keyboard.ins &
  99. mem.ins &
  100. misc.ins &
  101. mono.ins &
  102. palette.ins &
  103. rawfile.ins &
  104. shape.ins &
  105. tile.ins &
  106. timer.ins &
  107. ww_win.ins &
  108. wsa.ins &
  109. profile.ins &
  110. playcd.ins &
  111. wincomm.ins
  112. LIB_UPDATE = &
  113. audio.upd &
  114. dipthong.upd &
  115. drawbuff.upd &
  116. font.upd &
  117. iff.upd &
  118. keyboard.upd &
  119. mem.upd &
  120. misc.upd &
  121. mono.upd &
  122. palette.upd &
  123. rawfile.upd &
  124. shape.upd &
  125. tile.upd &
  126. timer.upd &
  127. ww_win.upd &
  128. wsa.upd &
  129. profile.upd &
  130. playcd.upd &
  131. wincomm.upd
  132. #===========================================================================
  133. # Pre-defined section: there should be little need to modify this section.
  134. #===========================================================================
  135. #---------------------------------------------------------------------------
  136. # Path macros: one path for each file type.
  137. # These paths are used to tell make where to find/put each file type.
  138. #---------------------------------------------------------------------------
  139. .lib: $(WIN32LIB)\lib
  140. #---------------------------------------------------------------------------
  141. # Tools/commands
  142. # LIB_CMD: library command
  143. # LIB_CFG: library configuration file
  144. # VCS_UPDATE: version control update command; this command should update
  145. # all relevant files in a given directory with read-only
  146. # copies from the archive
  147. #---------------------------------------------------------------------------
  148. !include $(WIN32LIB)\project.cfg
  149. LIB_CMD = ..\code\watcom\binnt\wlib
  150. VCS_UPDATE = update
  151. #---------------------------------------------------------------------------
  152. # If you like to have this makefile switch to the mono screen automatically,
  153. # you will need to do a "set MONO=Y" or to anything you like.
  154. #---------------------------------------------------------------------------
  155. !ifdef %MONO
  156. .BEFORE
  157. mode mono
  158. .AFTER
  159. mode co80
  160. .ERROR
  161. mode co80
  162. !endif
  163. #---------------------------------------------------------------------------
  164. # Default target
  165. #---------------------------------------------------------------------------
  166. all: $(LIB_DIR)\$(LIB_NAME).lib .SYMBOLIC
  167. #---------------------------------------------------------------------------
  168. # Build the library
  169. # The original library is deleted by the librarian
  170. # Lib objects & -+ commands are constructed by substituting within the
  171. # $^@ macro (which expands to all target dependents, separated with
  172. # spaces)
  173. # Tlib's cfg file is not invoked as a response file.
  174. # All headers & source files are copied into WIN32LIB\SRCDEBUG, for debugging
  175. #---------------------------------------------------------------------------
  176. $(LIB_DIR)\$(LIB_NAME).lib: $(LIBS) libs.lbc
  177. $(LIB_CMD) $(LIB_CFG) $^@ @libs.lbc
  178. #---------------------------------------------------------------------------
  179. # This construct tells make how to make all component libraries
  180. # The commands get executed for every item in the macro.
  181. # The macro $: extracts only the directory name from the macro item.
  182. #---------------------------------------------------------------------------
  183. $(LIBS):
  184. echo Making $^&...
  185. cd $^&
  186. wmake
  187. cd ..
  188. #---------------------------------------------------------------------------
  189. # Libs is librarian response file that is only genarated if any of the
  190. # sublibrary in the golbal variable LIBS was updated.
  191. #---------------------------------------------------------------------------
  192. libs.lbc : $(LIBS)
  193. %create $^@
  194. for %index in ($(LIBS)) do %append $^@ +$(LIB_DIR)\%index
  195. #---------------------------------------------------------------------------
  196. # "make install" installs the library on your drive
  197. #---------------------------------------------------------------------------
  198. install: install_dirs $(LIB_INSTALL) .SYMBOLIC
  199. echo Compiling library...
  200. wmake
  201. echo Library installation complete.
  202. #---------------------------------------------------------------------------
  203. # At installation time, this target makes all non-library directories
  204. # This is a dependency for 'install'
  205. #---------------------------------------------------------------------------
  206. install_dirs: .SYMBOLIC
  207. echo Making directories...
  208. mkdir example
  209. mkdir include
  210. mkdir lib
  211. mkdir srcdebug
  212. mkdir tools
  213. cd tools
  214. copy $(%WWVCS)\tools\vcs.cfg
  215. $(VCS_UPDATE)
  216. cd..
  217. copy $(%WWVCS)\vcs.cfg
  218. $(VCS_UPDATE)
  219. cd example
  220. copy $(%WWVCS)\example\vcs.cfg
  221. $(VCS_UPDATE)
  222. cd ..
  223. #---------------------------------------------------------------------------
  224. # This target installs all library directories
  225. # This is a dependency for 'install'
  226. #---------------------------------------------------------------------------
  227. $(LIB_INSTALL): .SYMBOLIC
  228. echo Installing $^&...
  229. md $^&
  230. cd $^&
  231. copy $(%WWVCS)\$^&\vcs.cfg
  232. $(VCS_UPDATE)
  233. copy *.h ..\include
  234. copy *.inc ..\include
  235. cd ..
  236. #---------------------------------------------------------------------------
  237. # "make update" updates all source files in your slice
  238. #---------------------------------------------------------------------------
  239. update: $(LIB_UPDATE) .SYMBOLIC
  240. echo Library updated.
  241. #---------------------------------------------------------------------------
  242. # This target updates all library directories
  243. # This is a dependency for 'updates'
  244. #---------------------------------------------------------------------------
  245. $(LIB_UPDATE): .SYMBOLIC
  246. echo Updating $^&...
  247. cd $^&
  248. $(VCS_UPDATE)
  249. copy *.h ..\include
  250. copy *.inc ..\include
  251. cd ..