MAKEFILE.WAT 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 .EXE makefile *
  23. #* *
  24. #* File Name : MAKEFILE *
  25. #* *
  26. #* Programmer : Julio R. Jerez *
  27. #* *
  28. #* Start Date : Jan 20, 1995 *
  29. #* *
  30. #* Last Update : *
  31. #* *
  32. #*-------------------------------------------------------------------------*
  33. #* *
  34. #* Required environment variables: *
  35. #* WIN32LIB = your root WWFLAT path *
  36. #* WIN32VCS = root directory for wwlib version control archive *
  37. #* COMPILER = your Watcom installation path *
  38. #* *
  39. #* *
  40. #* Required changes to makefile: *
  41. #* PROJ_NAME = name of the executable program you're building *
  42. #* PROJ_LIBS = Westwood libraries to link your EXE to *
  43. #* OBJECTS = list of objects in your current working directory *
  44. #* *
  45. #* Optional changes to makefile: *
  46. #* PROJ_DIR = full pathname of your working directory *
  47. #* .xxx: = full pathname where various file types live *
  48. #* *
  49. #***************************************************************************
  50. #---------------------------------------------------------------------------
  51. # Verify user's environment
  52. #---------------------------------------------------------------------------
  53. !ifndef %WIN32LIB
  54. !error WIN32LIB Environment var not configured.
  55. !endif
  56. !ifndef %WIN32VCS
  57. !error WIN32VCS Environment var not configured.
  58. !endif
  59. !ifndef %WATCOM
  60. !error WATCOM Environment var not configured.
  61. !endif
  62. #===========================================================================
  63. # User-defined section: the user should tailor this section for each project
  64. #===========================================================================
  65. #---------------------------------------------------------------------------
  66. # PROJ_NAME = library name
  67. # PROJ_DIR = directory containing source & objects
  68. #---------------------------------------------------------------------------
  69. PROJ_NAME = TEST
  70. PROJ_DIR = $(%WIN32LIB)\drawbuff\TEST
  71. LIB_DIR = $(%WIN32LIB)\lib
  72. !include $(%WIN32LIB)\project.cfg
  73. #---------------------------------------------------------------------------
  74. # Project-dependent variables
  75. #---------------------------------------------------------------------------
  76. OBJECTS = &
  77. $(PROJ_NAME).obj
  78. CPS_FILES = &
  79. test1.cps &
  80. test2.cps
  81. PROJ_LIBS = &
  82. drawbuff.lib &
  83. mem.lib &
  84. misc.lib &
  85. iff.lib &
  86. rawfile.lib &
  87. tile.lib &
  88. font.lib
  89. #PROJ_LIBS = &
  90. # drawbuff.lib &
  91. # win32lib.lib
  92. #---------------------------------------------------------------------------
  93. # Path macros: one path for each file type.
  94. # These paths are used to tell make where to find/put each file type.
  95. #---------------------------------------------------------------------------
  96. .asm: $(PROJ_DIR)
  97. .c: $(PROJ_DIR)
  98. .cpp: $(PROJ_DIR)
  99. .h: $(PROJ_DIR)
  100. .obj: $(PROJ_DIR)
  101. .lib: $(%WIN32LIB)\lib
  102. .exe: $(PROJ_DIR)
  103. #---------------------------------------------------------------------------
  104. # Tools/commands
  105. #---------------------------------------------------------------------------
  106. C_CMD = wcc386
  107. CPP_CMD = wpp386
  108. LIB_CMD = wlib
  109. LINK_CMD = wlink
  110. ASM_CMD = tasm32
  111. #---------------------------------------------------------------------------
  112. # Include & library paths
  113. # If LIB & INCLUDE are already defined, they are used in addition to the
  114. # WWLIB32 lib & include; otherwise, they're constructed from
  115. # BCDIR
  116. #---------------------------------------------------------------------------
  117. LIBPATH = $(%WIN32LIB)\LIB;$(%WATCOM)\LIB386\NT
  118. INCLUDEPATH = $(%WIN32LIB)\INCLUDE;$(%WATCOM)\H
  119. #---------------------------------------------------------------------------
  120. # Implicit rules
  121. # Compiler:
  122. # ($< = full dependent with path)
  123. # Assembler:
  124. # output obj's are constructed from .obj: & the $& macro
  125. # ($< = full dependent with path)
  126. # tasm's cfg file is not invoked as a response file.
  127. #---------------------------------------------------------------------------
  128. .c.obj: $(%WIN32LIB)\project.cfg .AUTODEPEND
  129. $(C_CMD) $(CC_CFG) $<
  130. .cpp.obj: $(%WIN32LIB)\project.cfg .AUTODEPEND
  131. $(CPP_CMD) $(CC_CFG) $<
  132. .asm.obj: $(%WIN32LIB)\project.cfg
  133. $(ASM_CMD) $(ASM_CFG) $<
  134. #---------------------------------------------------------------------------
  135. # Default target
  136. #---------------------------------------------------------------------------
  137. all: $(PROJ_NAME).exe
  138. #---------------------------------------------------------------------------
  139. # Build the EXE
  140. #---------------------------------------------------------------------------
  141. $(PROJ_NAME).exe: $(OBJECTS) $(PROJ_NAME).lnk $(PROJ_LIBS) $(CPS_FILES)
  142. $(LINK_CMD) $(LINK_CFG) name $^@ @$(PROJ_NAME).lnk
  143. $(PROJ_LIBS):
  144. echo updating base library $^@
  145. cd ..
  146. wmake
  147. cd $(PROJ_DIR)
  148. $(PROJ_NAME).lnk : $(OBJECTS)
  149. %create $^@
  150. for %index in ($(OBJECTS)) do %append $^@ file %index
  151. for %index in ($(PROJ_LIBS)) do %append $^@ library $(LIB_DIR)\%index
  152. %append $^@ library $(LIB_DIR)\ddraw.lib
  153. #**************************** End of makefile ******************************