MAKEFILE.WAT 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. .AUTODEPEND
  51. #---------------------------------------------------------------------------
  52. # Verify user's environment
  53. #---------------------------------------------------------------------------
  54. !ifndef WIN32LIB
  55. !error WIN32LIB Environment var not configured.
  56. !endif
  57. !ifndef WIN32VCS
  58. !error WIN32VCS Environment var not configured.
  59. !endif
  60. !ifndef COMPILER
  61. !error COMPILER Environment var not configured.
  62. !endif
  63. #===========================================================================
  64. # User-defined section: the user should tailor this section for each project
  65. #===========================================================================
  66. #---------------------------------------------------------------------------
  67. # PROJ_NAME = library name
  68. # PROJ_DIR = directory containing source & objects
  69. #---------------------------------------------------------------------------
  70. PROJ_NAME = test
  71. PROJ_DIR = $(WIN32LIB)\keyboard\$(PROJ_NAME)
  72. LIB_DIR = $(WIN32LIB)\lib
  73. #---------------------------------------------------------------------------
  74. # Project-dependent variables
  75. #---------------------------------------------------------------------------
  76. OBJECTS = \
  77. $(PROJ_NAME).obj
  78. !if 0
  79. PROJ_LIBS = \
  80. drawbuff.lib \
  81. win32lib.lib
  82. !else
  83. PROJ_LIBS = \
  84. drawbuff.lib \
  85. mem.lib \
  86. misc.lib \
  87. iff.lib \
  88. rawfile.lib \
  89. tile.lib \
  90. font.lib
  91. !endif
  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. .path.asm = $(PROJ_DIR)
  97. .path.c = $(PROJ_DIR)
  98. .path.cpp = $(PROJ_DIR)
  99. .path.h = $(PROJ_DIR)
  100. .path.obj = $(PROJ_DIR)
  101. .path.lib = $(WIN32LIB)\lib
  102. .path.exe = $(PROJ_DIR)
  103. #---------------------------------------------------------------------------
  104. # Tools/commands
  105. #---------------------------------------------------------------------------
  106. C_CMD = bcc32
  107. CPP_CMD = bcc32
  108. LIB_CMD = tlib
  109. LINK_CMD = tlink32
  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;$(COMPILER)\LIB
  118. INCLUDEPATH = $(WIN32LIB)\INCLUDE;$(COMPILER)\INCLUDE
  119. !include $(WIN32LIB)\\project.cfg
  120. #---------------------------------------------------------------------------
  121. # Implicit rules
  122. # Compiler:
  123. # ($< = full dependent with path)
  124. # Assembler:
  125. # output obj's are constructed from .obj: & the $& macro
  126. # ($< = full dependent with path)
  127. # tasm's cfg file is not invoked as a response file.
  128. #---------------------------------------------------------------------------
  129. .c.obj:
  130. $(C_CMD) $(CC_CFG) $<
  131. .cpp.obj:
  132. $(CPP_CMD) $(CC_CFG) $<
  133. .asm.obj:
  134. $(ASM_CMD) $(ASM_CFG) $<
  135. .lbm.cps:
  136. $(WIN32LIB)\\TOOLS\WWCOMP $*.lbm $*.cps
  137. #---------------------------------------------------------------------------
  138. # Default target
  139. #---------------------------------------------------------------------------
  140. all: $(PROJ_NAME).exe
  141. #---------------------------------------------------------------------------
  142. # Build the EXE
  143. #---------------------------------------------------------------------------
  144. $(PROJ_NAME).exe: $(OBJECTS) $(PROJ_LIBS)
  145. $(LINK_CMD) @&&|
  146. $(LINK_CFG) +
  147. $(COMPILER)\\LIB\\c0w32.obj+
  148. $(OBJECTS)
  149. $<,$*
  150. $(PROJ_LIBS) +
  151. import32.lib +
  152. cw32i.lib
  153. $*.def
  154. |
  155. $(PROJ_LIBS):
  156. echo updating base library $^@
  157. cd ..
  158. make
  159. cd $(PROJ_DIR)
  160. #**************************** End of makefile ******************************