MAKEFILE 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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. #* WWFLAT = your root WWFLAT path *
  35. #* WWVCS = root directory for wwlib version control archive *
  36. #* WATCOM = your Watcom installation path *
  37. #* *
  38. #* Required changes to makefile: *
  39. #* PROJ_NAME = name of the library you're building *
  40. #* OBJECTS = list of objects in your library *
  41. #* *
  42. #* Optional changes to makefile: *
  43. #* PROJ_DIR = full pathname of your working directory *
  44. #* .path.xxx = full pathname where various file types live *
  45. #* *
  46. #***************************************************************************
  47. #---------------------------------------------------------------------------
  48. # Verify user's environment
  49. #---------------------------------------------------------------------------
  50. !ifndef %WWFLAT
  51. !error WWFLAT Environment var not configured.
  52. !endif
  53. !ifndef %WWVCS
  54. !error WWVCS Environment var not configured.
  55. !endif
  56. !ifndef %WATCOM
  57. !error WATCOM Environment var not configured.
  58. !endif
  59. #===========================================================================
  60. # User-defined section: the user should tailor this section for each project
  61. #===========================================================================
  62. PROJ_NAME = mcgaprim
  63. PROJ_DIR = $(%WWFLAT)\$(PROJ_NAME)
  64. LIB_DIR = $(%WWFLAT)\lib
  65. !include $(%WWFLAT)\project.cfg
  66. #---------------------------------------------------------------------------
  67. # Project-dependent variables
  68. #---------------------------------------------------------------------------
  69. OBJECTS = &
  70. bitblit.obj &
  71. buffer.obj &
  72. buffglbl.obj &
  73. clear.obj &
  74. drawline.obj &
  75. drawrect.obj &
  76. fillquad.obj &
  77. fillrect.obj &
  78. gbuffer.obj &
  79. getclip.obj &
  80. getpix.obj &
  81. putpix.obj &
  82. remap.obj &
  83. scale.obj &
  84. shadow.obj &
  85. stamp.obj &
  86. szregion.obj &
  87. tobuff.obj &
  88. topage.obj &
  89. txtprnt.obj &
  90. vbuffer.obj &
  91. vclear.obj &
  92. vesa.obj &
  93. vgetpix.obj &
  94. vlbtove.obj &
  95. vputpix.obj &
  96. vscale.obj &
  97. vscltove.obj &
  98. vtobuff.obj &
  99. vtopage.obj &
  100. vtxtprnt.obj &
  101. vvblit.obj &
  102. vvetolb.obj &
  103. vvetoscl.obj
  104. #---------------------------------------------------------------------------
  105. # Path macros: one path for each file type.
  106. # These paths are used to tell make where to find/put each file type.
  107. #---------------------------------------------------------------------------
  108. .asm: $(PROJ_DIR)
  109. .c: $(PROJ_DIR)
  110. .cpp: $(PROJ_DIR)
  111. .h: $(PROJ_DIR)
  112. .obj: $(PROJ_DIR)
  113. .lib: $(%WWFLAT)\lib
  114. .exe: $(PROJ_DIR)
  115. #===========================================================================
  116. # Pre-defined section: there should be little need to modify this section.
  117. #===========================================================================
  118. #---------------------------------------------------------------------------
  119. # Tools/commands
  120. #---------------------------------------------------------------------------
  121. C_CMD = wcc386
  122. CPP_CMD = wpp386
  123. LIB_CMD = wlib
  124. LINK_CMD = wlink
  125. ASM_CMD = tasm32
  126. #---------------------------------------------------------------------------
  127. # Include & library paths
  128. # If LIB & INCLUDE are already defined, they are used in addition to the
  129. # WWLIB32 lib & include; otherwise, they're constructed from
  130. # BCDIR & TNTDIR
  131. #---------------------------------------------------------------------------
  132. LIBPATH = $(%WWFLAT)\LIB;$(%WATCOM)\LIB
  133. INCLUDEPATH = $(%WWFLAT)\INCLUDE;$(%WATCOM)\H
  134. #---------------------------------------------------------------------------
  135. # Implicit rules
  136. # Compiler:
  137. # ($< = full dependent with path)
  138. # Assembler:
  139. # output obj's are constructed from .obj: & the $& macro
  140. # ($< = full dependent with path)
  141. # tasm's cfg file is not invoked as a response file.
  142. #---------------------------------------------------------------------------
  143. .c.obj: $(%WWFLAT)\project.cfg .AUTODEPEND
  144. $(C_CMD) $(CC_CFG) $<
  145. .cpp.obj: $(%WWFLAT)\project.cfg .AUTODEPEND
  146. $(CPP_CMD) $(CC_CFG) $<
  147. .asm.obj: $(%WWFLAT)\project.cfg
  148. $(ASM_CMD) $(ASM_CFG) $<
  149. #---------------------------------------------------------------------------
  150. # Default target: configuration files & library (in that order)
  151. #---------------------------------------------------------------------------
  152. all: $(LIB_DIR)\$(PROJ_NAME).lib .SYMBOLIC
  153. #---------------------------------------------------------------------------
  154. # Build the library
  155. # The original library is deleted by the librarian
  156. # Lib objects & -+ commands are constructed by substituting within the
  157. # $^@ macro (which expands to all target dependents, separated with
  158. # spaces)
  159. # Tlib's cfg file is not invoked as a response file.
  160. # All headers & source files are copied into WWFLAT\SRCDEBUG, for debugging
  161. #---------------------------------------------------------------------------
  162. $(LIB_DIR)\$(PROJ_NAME).lib: $(OBJECTS) objects.lbc
  163. copy *.h $(%WWFLAT)\include
  164. copy *.inc $(%WWFLAT)\include
  165. copy *.cpp $(%WWFLAT)\srcdebug
  166. copy *.asm $(%WWFLAT)\srcdebug
  167. $(LIB_CMD) $(LIB_CFG) $^@ @objects.lbc
  168. #---------------------------------------------------------------------------
  169. # Objects now have a link file which is NOT generated everytime. Instead
  170. # it just has its own dependacy rule.
  171. #---------------------------------------------------------------------------
  172. objects.lbc : $(OBJECTS)
  173. %create $^@
  174. for %index in ($(OBJECTS)) do %append $^@ +%index
  175. #---------------------------------------------------------------------------
  176. # Create the test directory and make it.
  177. #---------------------------------------------------------------------------
  178. test:
  179. mkdir test
  180. cd test
  181. copy $(%WWVCS)\$(PROJ_NAME)\test\vcs.cfg
  182. update
  183. wmake
  184. cd ..
  185. #**************************** End of makefile ******************************
  186.