hw.mak 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. #
  2. # Homeworld Windows interface layer makefile
  3. #
  4. #
  5. # Targets and directories
  6. #
  7. Name = Homeworld
  8. Target = glHomeworld
  9. Link_file = $(Name).lnk
  10. SrcDir = .
  11. SrcDir2 = $(%HW_Root)\src\game
  12. SrcDir3 = $(%HW_Root)\src\Ships
  13. SrcDir4 = $(%HW_Root)\src\Sigs
  14. SrcDir5 = $(%HW_Root)\src\Titan\inc
  15. SrcDir6 = $(%HW_Root)\src\Generated
  16. SrcDir7 = $(%HW_Root)\src\jpg
  17. LibDir = $(%HW_Root)\Lib
  18. TitanLibDir = $(%HW_Root)\src\Titan\bin
  19. Data = $(%HW_Root)\Data
  20. KASDirs = $(%HW_Root)\src\SinglePlayer;$(%HW_Root)\src\Tutorials
  21. #KASSPRoot = $(DataSrc)\SinglePlayer
  22. #KASDirs = $(KASSPRoot)\Mission01;$(KASSPRoot)\Mission02;$(KASSPRoot)\Mission03; &
  23. # $(KASSPRoot)\Mission04;$(KASSPRoot)\Mission05;$(KASSPRoot)\Mission06; &
  24. # $(KASSPRoot)\Mission07;$(KASSPRoot)\Mission08;$(KASSPRoot)\Mission09; &
  25. # $(KASSPRoot)\Mission10;$(KASSPRoot)\Mission11;$(KASSPRoot)\Mission12; &
  26. # $(KASSPRoot)\Mission13;$(KASSPRoot)\Mission14;$(KASSPRoot)\Mission15; &
  27. # $(KASSPRoot)\Mission16;$(KASSPRoot)\Mission17;$(KASSPRoot)\Mission18
  28. #SWDefine = -DSW_Render=1 -D_WINSOCK_VERSION=1
  29. SWDefine = -D_WINSOCK_VERSION=1
  30. #
  31. # C compiler and Assembler options (Pentium in our case)
  32. #
  33. Processor = -G5
  34. #
  35. # Default compile and link flags
  36. #
  37. Link = link
  38. LinkFlags0 = /MAP /SUBSYSTEM:WINDOWS,4.0 /NOLOGO /DEBUG /DEBUGTYPE:CV /PDB:NONE
  39. LinkFlags1 = /MAP /SUBSYSTEM:WINDOWS,4.0 /NOLOGO /DEBUG:NONE /PDB:NONE
  40. LinkFlags2 = /MAP /SUBSYSTEM:WINDOWS,4.0 /NOLOGO /DEBUG /DEBUGTYPE:CV
  41. LinkFlags3 = /MAP /SUBSYSTEM:WINDOWS,4.0 /NOLOGO /DEBUG:NONE
  42. CCMD = @cl -c -Zp4 -Zi -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\JPG $(SWDefine) $(Processor) -D$(%HW_Level) -D$(%USERNAME)
  43. CCMDI = @icl -c -Zp4 -Zi -nologo -W2 -DWIN32 -Zl -I$(%HW_Root)\src\win32 -I$(%HW_Root)\src\game -I$(%HW_Root)\src\Ships -I$(%HW_Root)\src\Sigs -I$(%HW_Root)\src\rgl -I$(%HW_Root)\src\Titan\inc -I$(%HW_Root)\src\JPG $(SWDefine) $(Processor) -D$(%HW_Level) -D$(%USERNAME) -Qwr137
  44. # preprocessor used for KAS files
  45. CCPRE = @cl /E -nologo
  46. Libs = &
  47. comdlg32.lib user32.lib gdi32.lib advapi32.lib winmm.lib &
  48. kernel32.lib libcp.lib vfw32.lib dsound.lib libcmt.lib &
  49. opengl32.lib glu32.lib glaux.lib winmm.lib &
  50. $(TitanLibDir)\common_w95.lib $(TitanLibDir)\messages_w95.lib &
  51. $(TitanLibDir)\SocketEngine_ws11_w95.lib &
  52. wsock32.lib
  53. RC = rc /i$(%HW_Root)\src\Game -r
  54. RES = $(Name).res
  55. KAS2C = KAS2C
  56. #
  57. # Set suffix order
  58. #
  59. .EXTENSIONS:
  60. .EXTENSIONS: . .exe .lib .obj .pch .c .kas .res .rc .sym .map .lnk .cpp
  61. #
  62. # C compiler and Assembler options (Pentium in our case)
  63. #
  64. Processor = -G5
  65. #
  66. # Set debugging/optimization options
  67. # There are now 3 different build:
  68. # HW_Debug - uses VC compiler, full debug, no optimizations
  69. # HW_Interim - uses Intel compiler, full debug, no optimizations
  70. # HW_anythingelse - uses Intel Compiler, no debug info, optimizations
  71. # which CCMD<n> to use is determined in the dependency creation script
  72. #
  73. CCMD0 = $(CCMD) -Od
  74. CCMD1 = $(CCMDI) -Od
  75. CCMD2 = $(CCMDI) -Ot
  76. CCMD0CPP = $(CCMD) -Od /GX /GR
  77. CCMD1CPP = $(CCMDI) -Od
  78. CCMD2CPP = $(CCMDI) -Ot
  79. !ifeq %HW_Level HW_Debug
  80. #debug build - VC compiler, debug info
  81. !ifeq %HW_PDB HW_YESPDB
  82. LinkFlags = $(LinkFlags2)
  83. !else
  84. LinkFlags = $(LinkFlags0)
  85. !endif
  86. DestDir = $(%HW_Root)\obj\glDebug
  87. !else # %HW_Level != HW_Debug
  88. !ifeq %HW_Level HW_Interim
  89. #interim build - Intel compiler, debug info
  90. !ifeq %HW_PDB HW_YESPDB
  91. LinkFlags = $(LinkFlags2)
  92. !else
  93. LinkFlags = $(LinkFlags0)
  94. !endif
  95. DestDir = $(%HW_Root)\obj\glInterim
  96. !else # %HW_Level != HW_Interim
  97. #Release build - Intel compiler, no debug info, optimizations for most files.
  98. !ifeq %HW_PDB HW_YESPDB
  99. LinkFlags = $(LinkFlags3)
  100. !else
  101. LinkFlags = $(LinkFlags1)
  102. !endif
  103. DestDir = $(%HW_Root)\obj\glRelease
  104. !endif
  105. !endif
  106. #
  107. # List of object files
  108. #
  109. Objs =
  110. !include $(Name).mif
  111. StatLibs =
  112. #
  113. # Implicit make rules
  114. #
  115. #.kas: $(KASDirs)
  116. #.kas: $(Data)\Missions\SinglePlayer\Mission01
  117. #.kas.c:
  118. # @$(KAS2C) $? $(SrcDir6)\$^&.c $(SrcDir6)\$^&.h
  119. #.kas.obj:
  120. # @$(KAS2C) $? $(SrcDir6)\$^&.c $(SrcDir6)\$^&.h
  121. # @$(CCMD) -Fo$(DestDir)\$^&.obj $?
  122. .obj: $(DestDir)
  123. .c: $(SrcDir);$(SrcDir2);$(SrcDir3);$(SrcDir4);$(SrcDir5);$(SrcDir6);$(SrcDir7)
  124. .cpp: $(SrcDir);$(SrcDir2);$(SrcDir3);$(SrcDir4);$(SrcDir5);$(SrcDir6);$(SrcDir7)
  125. .c.obj:
  126. @$(CCMD) -Fo$(DestDir)\$^&.obj $?
  127. .cpp.obj:
  128. @$(CCMD) /GX /GR -Fo$(DestDir)\$^&.obj $?
  129. .res: $(DestDir)
  130. .rc: $(SrcDir)
  131. .rc.res:
  132. @echo $?
  133. @$(RC) -fo$(DestDir)\$^&.res $?
  134. #
  135. # Convert .map files to .sym files...only useful if using kernel debugger
  136. #
  137. #.map: $(DestDir)
  138. #.sym: $(DestDir)
  139. #.map.sym:
  140. # mapsym32 -o $*.sym $?
  141. #
  142. # Explicit make rules
  143. #
  144. $(DestDir)\$(Target).exe: $(OBJS) $(DestDir)\$(RES) $(StatLibs) $(DestDir)\$(Link_file)
  145. # @type $(DestDir)\$(Link_file)
  146. @echo Linking...
  147. @$(Link) $(LinkFlags) @$(DestDir)\$(Link_file)
  148. @copy $(DestDir)\$(Target).exe $(%HW_Root)\exe\$(Target).exe > NUL:
  149. @echo $(DestDir)\$(Target).exe built successfully.
  150. $(DestDir)\$(RES): $(Name).rc resource.h
  151. hw: .SYMBOLIC
  152. @echo Making OpenGL Homeworld ...
  153. @wmake /h /z /f hw.mak
  154. #
  155. # Explicit make rule for link file
  156. # Note: we don't include the .DEF or .RES because there are none yet
  157. #
  158. $(DestDir)\$(Link_file): hw.mak $(Name).mif
  159. @echo Reconstructing link file
  160. @del $(DestDir)\$(Link_file) > NUL:
  161. @echo $(LinkFlags) > $(DestDir)\$(Link_file)
  162. @for %i in ($(Objs)) do @echo $(DestDir)\%i >> $(DestDir)\$(Link_file)
  163. @for %i in ($(StatLibs)) do @echo Library %i >> $(DestDir)\$(Link_file)
  164. @for %i in ($(Libs)) do @echo %i >> $(DestDir)\$(Link_file)
  165. @echo $(DestDir)\$(RES) >> $(DestDir)\$(Link_file)
  166. @echo -Out:$(DestDir)\$(Target).exe >> $(DestDir)\$(Link_file)
  167. copy: .SYMBOLIC
  168. @copy $(DestDir)\$(Target).exe $(%HW_Root)\exe\$(Target).exe > NUL:
  169. !include $(Name).depend