MAKEFILE 9.3 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 : April 27, 1994 *
  29. #* *
  30. #* Last Update : May 12, 1994 [BRR] *
  31. #* *
  32. #*-------------------------------------------------------------------------*
  33. #* *
  34. #* Required environment variables: *
  35. #* WWFLAT = your root WWFLAT path *
  36. #* WWVCS = root directory for wwlib version control archive *
  37. #* WATCOM = your Watcom installation path *
  38. #* *
  39. #* Required changes to makefile: *
  40. #* LIBS = list of all component libraries *
  41. #* *
  42. #* NOTE: For this makefile to work, each library directory MUST have the *
  43. #* same name as its library. *
  44. #* *
  45. #* "make install" installs the library on your drive *
  46. #* "make update" updates all source files in your slice *
  47. #* *
  48. #* To install or update just one library you may type: *
  49. #* "make -DLIBS=misc.lib install" *
  50. #* *
  51. #***************************************************************************
  52. #---------------------------------------------------------------------------
  53. # Verify user's environment
  54. #---------------------------------------------------------------------------
  55. !ifndef %WWFLAT
  56. !error WWFLAT Environment var not configured.
  57. !endif
  58. #===========================================================================
  59. # User-defined section: list each library in this macro
  60. # NOTE: These are some order dependencies:
  61. # 1. The directory MISC must always be made first.
  62. # 2. The directory VIDEO must be made before the SYSTEM directory.
  63. #===========================================================================
  64. LIB_NAME = wwflat32
  65. LIB_DIR = $(%WWFLAT)\lib
  66. #---------------------------------------------------------------------------
  67. # LIBS macro: a list of all component libraries
  68. # "make LIBS=xxxx.lib [target]" makes/installs/updates only that library
  69. #---------------------------------------------------------------------------
  70. LIBS = &
  71. audio.lib &
  72. descmgmt.lib &
  73. dipthong.lib &
  74. file.lib &
  75. font.lib &
  76. iff.lib &
  77. keyboard.lib &
  78. mcgaprim.lib &
  79. mem.lib &
  80. misc.lib &
  81. mono.lib &
  82. palette.lib &
  83. playcd.lib &
  84. shape.lib &
  85. sosdw1ps.lib &
  86. svgaprim.lib &
  87. tile.lib &
  88. timer.lib &
  89. video.lib &
  90. windows.lib &
  91. wsa.lib
  92. LIB_INSTALL = &
  93. audio.ins &
  94. descmgmt.ins &
  95. dipthong.ins &
  96. file.ins &
  97. font.ins &
  98. iff.ins &
  99. keyboard.ins &
  100. mcgaprim.ins &
  101. mem.ins &
  102. misc.ins &
  103. mono.ins &
  104. palette.ins &
  105. playcd.ins &
  106. shape.ins &
  107. svgaprim.ins &
  108. tile.ins &
  109. timer.ins &
  110. video.ins &
  111. windows.ins &
  112. wsa.ins
  113. LIB_UPDATE = &
  114. audio.upd &
  115. descmgmt.upd &
  116. dipthong.upd &
  117. file.upd &
  118. font.upd &
  119. iff.upd &
  120. keyboard.upd &
  121. mcgaprim.upd &
  122. mem.upd &
  123. misc.upd &
  124. mono.upd &
  125. palette.upd &
  126. playcd.upd &
  127. shape.upd &
  128. svgaprim.upd &
  129. tile.upd &
  130. timer.upd &
  131. video.upd &
  132. windows.upd &
  133. wsa.upd
  134. #===========================================================================
  135. # Pre-defined section: there should be little need to modify this section.
  136. #===========================================================================
  137. #---------------------------------------------------------------------------
  138. # Path macros: one path for each file type.
  139. # These paths are used to tell make where to find/put each file type.
  140. #---------------------------------------------------------------------------
  141. .lib: $(%WWFLAT)\lib
  142. #---------------------------------------------------------------------------
  143. # Tools/commands
  144. # LIB_CMD: library command
  145. # LIB_CFG: library configuration file
  146. # VCS_UPDATE: version control update command; this command should update
  147. # all relevant files in a given directory with read-only
  148. # copies from the archive
  149. #---------------------------------------------------------------------------
  150. !include $(%WWFLAT)\project.cfg
  151. LIB_CMD = wlib
  152. VCS_UPDATE = update
  153. #---------------------------------------------------------------------------
  154. # If you like to have this makefile switch to the mono screen automatically,
  155. # you will need to do a "set MONO=Y" or to anything you like.
  156. #---------------------------------------------------------------------------
  157. !ifdef %MONO
  158. .BEFORE
  159. mode mono
  160. .AFTER
  161. mode co80
  162. .ERROR
  163. mode co80
  164. !endif
  165. #---------------------------------------------------------------------------
  166. # Default target
  167. #---------------------------------------------------------------------------
  168. all: $(LIB_DIR)\$(LIB_NAME).lib .SYMBOLIC
  169. #---------------------------------------------------------------------------
  170. # Build the library
  171. # The original library is deleted by the librarian
  172. # Lib objects & -+ commands are constructed by substituting within the
  173. # $^@ macro (which expands to all target dependents, separated with
  174. # spaces)
  175. # Tlib's cfg file is not invoked as a response file.
  176. # All headers & source files are copied into WWFLAT\SRCDEBUG, for debugging
  177. #---------------------------------------------------------------------------
  178. $(LIB_DIR)\$(LIB_NAME).lib: $(LIBS) libs.lbc
  179. $(LIB_CMD) $(LIB_CFG) $^@ @libs.lbc
  180. #---------------------------------------------------------------------------
  181. # This construct tells make how to make all component libraries
  182. # The commands get executed for every item in the macro.
  183. # The macro $: extracts only the directory name from the macro item.
  184. #---------------------------------------------------------------------------
  185. $(LIBS):
  186. echo Making $^&...
  187. cd $^&
  188. wmake
  189. cd ..
  190. #---------------------------------------------------------------------------
  191. # Libs is librarian response file that is only genarated if any of the
  192. # sublibrary in the golbal variable LIBS was updated.
  193. #---------------------------------------------------------------------------
  194. libs.lbc : $(LIBS)
  195. %create $^@
  196. for %index in ($(LIBS)) do %append $^@ +$(LIB_DIR)\%index
  197. #---------------------------------------------------------------------------
  198. # "make install" installs the library on your drive
  199. #---------------------------------------------------------------------------
  200. install: install_dirs $(LIB_INSTALL) .SYMBOLIC
  201. echo Compiling library...
  202. wmake
  203. echo Library installation complete.
  204. #---------------------------------------------------------------------------
  205. # At installation time, this target makes all non-library directories
  206. # This is a dependency for 'install'
  207. #---------------------------------------------------------------------------
  208. install_dirs: .SYMBOLIC
  209. echo Making directories...
  210. mkdir example
  211. mkdir include
  212. mkdir lib
  213. mkdir srcdebug
  214. mkdir tools
  215. cd tools
  216. copy $(%WWVCS)\tools\vcs.cfg
  217. $(VCS_UPDATE)
  218. cd..
  219. copy $(%WWVCS)\vcs.cfg
  220. $(VCS_UPDATE)
  221. cd example
  222. copy $(%WWVCS)\example\vcs.cfg
  223. $(VCS_UPDATE)
  224. cd ..
  225. #---------------------------------------------------------------------------
  226. # This target installs all library directories
  227. # This is a dependency for 'install'
  228. #---------------------------------------------------------------------------
  229. $(LIB_INSTALL): .SYMBOLIC
  230. echo Installing $^&...
  231. md $^&
  232. cd $^&
  233. copy $(%WWVCS)\$^&\vcs.cfg
  234. $(VCS_UPDATE)
  235. copy *.h ..\include
  236. copy *.inc ..\include
  237. cd ..
  238. #---------------------------------------------------------------------------
  239. # "make update" updates all source files in your slice
  240. #---------------------------------------------------------------------------
  241. update: $(LIB_UPDATE) .SYMBOLIC
  242. echo Library updated.
  243. #---------------------------------------------------------------------------
  244. # This target updates all library directories
  245. # This is a dependency for 'updates'
  246. #---------------------------------------------------------------------------
  247. $(LIB_UPDATE): .SYMBOLIC
  248. echo Updating $^&...
  249. cd $^&
  250. $(VCS_UPDATE)
  251. copy *.h ..\include
  252. copy *.inc ..\include
  253. cd ..