MAKE_EXE.MAK 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. #* WWFLAT = your root WWFLAT path *
  36. #* WWVCS = root directory for wwlib version control archive *
  37. #* WATCOM = 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 %WWFLAT
  54. !error WWFLAT Environment var not configured.
  55. !endif
  56. !ifndef %WWVCS
  57. !error WWVCS 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 = $(%WWFLAT)\MEM\TEST
  71. LIB_DIR = $(%WWFLAT)\lib
  72. !include $(%WWFLAT)\project.cfg
  73. #---------------------------------------------------------------------------
  74. # Project-dependent variables
  75. #---------------------------------------------------------------------------
  76. OBJECTS = &
  77. $(PROJ_NAME).obj &
  78. object0.obj &
  79. object1.obj
  80. PROJ_LIBS = &
  81. lib1.lib &
  82. lib2.lib &
  83. wwflat32.lib
  84. #---------------------------------------------------------------------------
  85. # Path macros: one path for each file type.
  86. # These paths are used to tell make where to find/put each file type.
  87. #---------------------------------------------------------------------------
  88. .asm: $(PROJ_DIR)
  89. .c: $(PROJ_DIR)
  90. .cpp: $(PROJ_DIR)
  91. .h: $(PROJ_DIR)
  92. .obj: $(PROJ_DIR)
  93. .lib: $(%WWFLAT)\lib
  94. .exe: $(PROJ_DIR)
  95. #---------------------------------------------------------------------------
  96. # Tools/commands
  97. #---------------------------------------------------------------------------
  98. C_CMD = wcc386
  99. CPP_CMD = wpp386
  100. LIB_CMD = wlib
  101. LINK_CMD = wlink
  102. ASM_CMD = tasm32
  103. #---------------------------------------------------------------------------
  104. # Include & library paths
  105. # If LIB & INCLUDE are already defined, they are used in addition to the
  106. # WWLIB32 lib & include; otherwise, they're constructed from
  107. # BCDIR
  108. #---------------------------------------------------------------------------
  109. LIBPATH = $(%WWFLAT)\LIB;$(%WATCOM)\LIB
  110. INCLUDEPATH = $(%WWFLAT)\INCLUDE;$(%WATCOM)\H
  111. #---------------------------------------------------------------------------
  112. # Implicit rules
  113. # Compiler:
  114. # ($< = full dependent with path)
  115. # Assembler:
  116. # output obj's are constructed from .obj: & the $& macro
  117. # ($< = full dependent with path)
  118. # tasm's cfg file is not invoked as a response file.
  119. #---------------------------------------------------------------------------
  120. .c.obj: $(%WWFLAT)\project.cfg .AUTODEPEND
  121. $(C_CMD) $(CC_CFG) $<
  122. .cpp.obj: $(%WWFLAT)\project.cfg .AUTODEPEND
  123. $(CPP_CMD) $(CC_CFG) $<
  124. .asm.obj: $(%WWFLAT)\project.cfg
  125. $(ASM_CMD) $(ASM_CFG) $<
  126. #---------------------------------------------------------------------------
  127. # Default target
  128. #---------------------------------------------------------------------------
  129. all: $(PROJ_NAME).exe
  130. #---------------------------------------------------------------------------
  131. # Build the EXE
  132. #---------------------------------------------------------------------------
  133. $(PROJ_NAME).exe: $(OBJECTS) $(PROJ_NAME).lnk $(PROJ_LIBS)
  134. $(LINK_CMD) $(LINK_CFG) system dos4g name $^@ @$(PROJ_NAME).lnk
  135. $(PROJ_LIBS):
  136. echo updating base library $^@
  137. cd ..
  138. wmake
  139. cd $(PROJ_DIR)
  140. $(PROJ_NAME).lnk : $(OBJECTS)
  141. %create $^@
  142. for %index in ($(OBJECTS)) do %append $^@ file %index
  143. for %index in ($(PROJ_LIBS)) do %append $^@ library $(LIB_DIR)\%index
  144. #**************************** End of makefile ******************************