vc32.mk 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. #############################################################################
  2. #
  3. # SciTech Multi-platform Graphics Library
  4. #
  5. # ========================================================================
  6. #
  7. # The contents of this file are subject to the SciTech MGL Public
  8. # License Version 1.0 (the "License"); you may not use this file
  9. # except in compliance with the License. You may obtain a copy of
  10. # the License at http://www.scitechsoft.com/mgl-license.txt
  11. #
  12. # Software distributed under the License is distributed on an
  13. # "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  14. # implied. See the License for the specific language governing
  15. # rights and limitations under the License.
  16. #
  17. # The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
  18. #
  19. # The Initial Developer of the Original Code is SciTech Software, Inc.
  20. # All Rights Reserved.
  21. #
  22. # ========================================================================
  23. #
  24. # Descripton: Generic DMAKE startup makefile definitions file. Assumes
  25. # that the SCITECH environment variable has been set to point
  26. # to where all our stuff is installed. You should not need
  27. # to change anything in this file.
  28. #
  29. # Microsoft Visual C++ 2.x 32 bit version. Supports Phar Lap
  30. # TNT DOS Extender and 32 bit Windows development.
  31. #
  32. #############################################################################
  33. # Include standard startup script definitions
  34. .IMPORT: SCITECH
  35. .INCLUDE: "$(SCITECH)\makedefs\startup.mk"
  36. # Import enivornment variables that we use
  37. .IMPORT .IGNORE : TNT_PATH VC_LIBBASE DOSSTYLE USE_TNT USE_RTTARGET MSVCDIR
  38. .IMPORT .IGNORE : USE_VXD USE_NTDRV USE_W2KDRV NT_DDKROOT USE_RTTI USE_CPPEXCEPT
  39. # We are compiling for a 32 bit envionment
  40. _32BIT_ := 1
  41. # Default commands for compiling, assembling linking and archiving
  42. CC := cl # C-compiler and flags
  43. CFLAGS :=
  44. .IF $(USE_NASM)
  45. AS := nasm
  46. ASFLAGS := -t -f win32 -F null -d__FLAT__ -dSTDCALL_MANGLE -iINCLUDE -i$(SCITECH)\INCLUDE
  47. .ELSE
  48. .IF $(USE_TASM32)
  49. AS := tasm32
  50. .ELIF $(USE_TASMX)
  51. AS := tasmx # Assembler and flags
  52. .ELSE
  53. AS := tasm # Assembler and flags
  54. .ENDIF
  55. ASFLAGS := /t /mx /m /D__FLAT__ /DSTDCALL_MANGLE /iINCLUDE /i$(SCITECH)\INCLUDE
  56. .ENDIF
  57. LD := cl
  58. .IF $(USE_WIN32)
  59. LDFLAGS = $(CFLAGS)
  60. .IF $(USE_NTDRV)
  61. LDENDFLAGS = -link /INCREMENTAL:NO /DRIVER /SUBSYSTEM:NATIVE,4.00 /VERSION:4.00 /MACHINE:I386 /NODEFAULTLIB /DEBUGTYPE:CV /PDB:NONE /ALIGN:0x20 /BASE:0x10000 /ENTRY:DriverEntry@8
  62. #/MERGE:_page=page /MERGE:_text=.text /MERGE:.rdata=.text
  63. .ELIF $(WIN32_GUI)
  64. LDENDFLAGS = -link /INCREMENTAL:NO /DEF:$(@:b).def /SUBSYSTEM:WINDOWS /MACHINE:I386 /DEBUGTYPE:CV /PDB:NONE
  65. .ELSE
  66. LDENDFLAGS = -link /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MACHINE:I386 /DEBUGTYPE:CV /PDB:NONE
  67. .ENDIF
  68. .ELSE
  69. LDFLAGS = $(CFLAGS)
  70. LDENDFLAGS := -link -stub:$(TNT_PATH:s/\/\\)\\bin\\gotnt.exe /PDB:NONE
  71. .ENDIF
  72. RC := rc # Watcom resource compiler
  73. RCFLAGS := # Mark as Win32 compatible resources
  74. LIB := lib # Librarian
  75. LIBFLAGS :=
  76. ILIB := lib # Import librarian
  77. ILIBFLAGS := /MACHINE:IX86
  78. INTEL_X86 := 1
  79. NMSYM := $(SOFTICE_PATH)\nmsym.exe
  80. .IF $(USE_NTDRV)
  81. NMSYMFLAGS := /TRANSLATE:source,package,always /PROMPT /SOURCE:$(MSVCDIR)\crt\src\intel;$(SCITECH)\src\pm;$(SCITECH)\src\pm\common;$(SCITECH)\src\pm\ntdrv
  82. .ELSE
  83. NMSYMFLAGS := /TRANSLATE:source,package,always /PROMPT /SOURCE:$(SCITECH)\src\pm;$(SCITECH)\src\pm\common;$(SCITECH)\src\pm\win32
  84. .ENDIF
  85. # Set the compiler warning level
  86. .IF $(MAX_WARN)
  87. CFLAGS += -W3
  88. .ELSE
  89. CFLAGS += -W1
  90. .ENDIF
  91. # Optionally turn on debugging information
  92. .IF $(DBG)
  93. CFLAGS += /Yd /Zi # Turn on debugging for C compiler
  94. .IF $(USE_TASM)
  95. ASFLAGS += /zi # Turn on debugging for assembler
  96. .ENDIF
  97. .ELSE
  98. .IF $(USE_TASM)
  99. ASFLAGS += /q # Suppress object records not needed for linking
  100. .ENDIF
  101. .END
  102. # Optionally turn on optimisations
  103. .IF $(VC_LIBBASE) == vc5
  104. .IF $(OPT)
  105. CFLAGS += /G6 /O2 /Ox /Oi-
  106. .ELIF $(OPT_SIZE)
  107. CFLAGS += /G6 /O1
  108. .END
  109. .ELSE
  110. .IF $(OPT)
  111. CFLAGS += /G5 /O2 /Ox
  112. .ELIF $(OPT_SIZE)
  113. CFLAGS += /G5 /O1
  114. .END
  115. .ENDIF
  116. # Optionally turn on direct i387 FPU instructions
  117. .IF $(FPU)
  118. CFLAGS += /DFPU387
  119. ASFLAGS += -dFPU387
  120. .END
  121. # Optionally compile a beta release version of a product
  122. .IF $(BETA)
  123. CFLAGS += /DBETA
  124. ASFLAGS += -dBETA
  125. .END
  126. # Use a larger stack during linking if requested, or use a default stack
  127. # of 50k. The usual default stack provided by Visual C++ is *way* to small
  128. # for real 32 bit code development.
  129. .IF $(USE_WIN32)
  130. # Not necessary for Win32 code.
  131. .ELSE
  132. .IF $(STKSIZE)
  133. LDENDFLAGS += /STACK:$(STKSIZE)
  134. .ELSE
  135. LDENDFLAGS += /STACK:51200
  136. .ENDIF
  137. .ENDIF
  138. # DOS extender dependant flags
  139. .IF $(USE_NTDRV) # Build 32 bit Windows NT driver
  140. CFLAGS += /LD /Zl /Gy /Gz /GF /D__NT_DRIVER__ /D_X86_=1 /Di386=1
  141. .IF $(DBG)
  142. CFLAGS += /QIf
  143. .ENDIF
  144. ASFLAGS +=
  145. DEF_LIBS := int64.lib ntoskrnl.lib hal.lib
  146. DX_ASFLAGS += -d__NT_DRIVER__
  147. .IF $(USE_W2KDRV) # Build 32 bit Windows 2000 driver
  148. LIB_OS = W2KDRV
  149. .ELSE
  150. LIB_OS = NTDRV
  151. .ENDIF
  152. .ELIF $(USE_WIN32) # Build 32 bit Windows NT app
  153. .IF $(WIN32_GUI)
  154. .ELSE
  155. CFLAGS += -D__CONSOLE__
  156. .ENDIF
  157. .IF $(BUILD_DLL)
  158. CFLAGS += /MT /LD /DBUILD_DLL
  159. ASFLAGS += -dBUILD_DLL
  160. .IF $(NO_RUNTIME)
  161. LDENDFLAGS += /NODEFAULTLIB
  162. CFLAGS += /Zl
  163. DEF_LIBS :=
  164. .ELSE
  165. DEF_LIBS := kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib winmm.lib comdlg32.lib comctl32.lib ole32.lib oleaut32.lib version.lib winspool.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib rpcrt4.lib
  166. .ENDIF
  167. .ELSE
  168. CFLAGS += /MT
  169. DEF_LIBS := kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib winmm.lib comdlg32.lib comctl32.lib ole32.lib oleaut32.lib version.lib winspool.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib rpcrt4.lib
  170. .ENDIF
  171. DX_ASFLAGS += -d__WINDOWS32__
  172. LIB_OS = WIN32
  173. .ELIF $(USE_RTTARGET)
  174. CFLAGS += -D__RTTARGET__
  175. DX_CFLAGS +=
  176. DX_ASFLAGS += -d__RTTARGET__
  177. USE_REALDOS :=
  178. LIB_OS = RTT32
  179. DEF_LIBS := cw32mt.lib
  180. .ELSE
  181. USE_TNT := 1
  182. USE_REALDOS := 1
  183. CFLAGS += /MT /D__MSDOS32__
  184. DX_CFLAGS += -DTNT
  185. DX_ASFLAGS += -dTNT
  186. LIB_OS = DOS32
  187. DEF_LIBS := dosx32.lib tntapi.lib
  188. .ENDIF
  189. # Define the base directory for library files
  190. .IF $(CHECKED)
  191. LIB_BASE_DIR := $(SCITECH_LIB)\lib\debug
  192. CFLAGS += /DCHECKED=1
  193. .ELSE
  194. LIB_BASE_DIR := $(SCITECH_LIB)\lib\release
  195. .ENDIF
  196. # Define where to install library files
  197. LIB_BASE := $(LIB_BASE_DIR)\$(LIB_OS)\$(VC_LIBBASE)
  198. LIB_DEST := $(LIB_BASE)
  199. # Place to look for PMODE library files
  200. .IF $(USE_TNT)
  201. PMLIB := $(LIB_BASE:s/\/\\)\\tnt\\pm.lib
  202. .ELSE
  203. PMLIB := $(LIB_BASE:s/\/\\)\\pm.lib
  204. .ENDIF
  205. # Define which file contains our rules
  206. RULES_MAK := vc32.mk