MAKEFILE 7.7 KB

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