Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

291 lines
6.4 KiB

  1. #===========================================================================;
  2. #
  3. # MAKEFILE.ZYZ -- Common Makefile for Win 16 and Win 32 Environments
  4. #
  5. #############################################################################
  6. #
  7. # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  8. # KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  9. # IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  10. # PURPOSE.
  11. #
  12. # Copyright (c) 1993-1995 Microsoft Corporation. All Rights Reserved.
  13. #
  14. #############################################################################
  15. #
  16. #---------------------------------------------------------------------------;
  17. #
  18. # CPU Support:
  19. # i386 - Intel 80386, i486, P5
  20. # MIPS - MIPS R4000
  21. #
  22. #===========================================================================;
  23. !if ("$(WIN16)" == "YES") || ("$(OS)" != "Windows_NT")
  24. #===========================================================================;
  25. #
  26. # Common Makefile for Win 16 Environment
  27. #
  28. #
  29. #===========================================================================;
  30. !if ("$(TARGETMODEL)" != "SMALL") && ("$(TARGETMODEL)" != "MEDIUM")
  31. !error Invalid TARGETMODEL environment variable: specify SMALL or MEDIUM!
  32. !endif
  33. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  34. #
  35. # Default executable and flag declarations
  36. #
  37. #
  38. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  39. CVARS = -DWIN16 -DSTRICT $(TARGETAPI)
  40. CC = cl
  41. CFLAGS = -c -Zp $(TARGETOPTZ)
  42. RC = rc
  43. RFLAGS =
  44. LN = link
  45. LFLAGS = /NOPACKC/NOD/NOE/MAP/AL:16
  46. LB = lib
  47. LBFLAGS =
  48. CVTRES = rem !!! CVTRES is for Win 32 only !!!
  49. CRFLAGS =
  50. !if "$(DEBUG)" != "NO"
  51. CVARS = $(CVARS) -DDEBUG
  52. CFLAGS = $(CFLAGS) -Zid
  53. LFLAGS = $(LFLAGS) /CO/LI
  54. !endif
  55. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  56. #
  57. # Standard library stuff
  58. #
  59. # CONLFLAGS and WINLFLAGS:
  60. #
  61. #
  62. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  63. CONLFLAGS =
  64. CONLIBSBASE =
  65. CONLIBSST =
  66. CONLIBSMT =
  67. CONLIBSDLL =
  68. WINLIBSBASE = libw commdlg shell mmsystem
  69. !if "$(TARGETMODEL)" == "SMALL"
  70. WINLIBSST = slibcew.lib $(WINLIBSBASE)
  71. WINLIBSMT =
  72. WINLIBSDLL = sdllcew.lib $(WINLIBSBASE)
  73. !endif
  74. !if "$(TARGETMODEL)" == "MEDIUM"
  75. WINLIBSST = mlibcew.lib $(WINLIBSBASE)
  76. WINLIBSMT =
  77. WINLIBSDLL = mdllcew.lib $(WINLIBSBASE)
  78. !endif
  79. #
  80. #
  81. #
  82. #
  83. !if ("$(TARGETTYPE)" == "CONAPPST") || ("$(TARGETTYPE)" == "CONAPP")
  84. !error TARGETTYPE: CONAPP[ST] is not supported in Win 16!
  85. !endif
  86. !if "$(TARGETTYPE)" == "CONAPPMT"
  87. !error TARGETTYPE: CONAPPMT is not supported in Win 16!
  88. !endif
  89. !if "$(TARGETTYPE)" == "CONDLL"
  90. !error TARGETTYPE: CONDLL is not supported in Win 16!
  91. !endif
  92. !if ("$(TARGETTYPE)" == "WINAPPST") || ("$(TARGETTYPE)" == "WINAPP")
  93. !if "$(TARGETMODEL)" == "SMALL"
  94. CFLAGS = $(CFLAGS) -AS
  95. !endif
  96. !if "$(TARGETMODEL)" == "MEDIUM"
  97. CFLAGS = $(CFLAGS) -AM
  98. !endif
  99. CVARS = $(CVARS)
  100. WINLIBS = $(WINLIBSST)
  101. !endif
  102. !if "$(TARGETTYPE)" == "WINAPPMT"
  103. !error TARGETTYPE: WINAPPMT is not supported in Win 16!
  104. !endif
  105. !if "$(TARGETTYPE)" == "WINDLL"
  106. !if "$(TARGETMODEL)" == "SMALL"
  107. CFLAGS = $(CFLAGS) -Asnw
  108. !endif
  109. !if "$(TARGETMODEL)" == "MEDIUM"
  110. CFLAGS = $(CFLAGS) -Alnw
  111. !endif
  112. CVARS = $(CVARS) -D_DLL -D_WINDLL
  113. WINLIBS = $(WINLIBSDLL)
  114. !endif
  115. !else
  116. #===========================================================================;
  117. #
  118. # Common Makefile for Win 32 Environment
  119. #
  120. #
  121. #===========================================================================;
  122. !if ("$(CPU)" != "i386") && ("$(CPU)" != "MIPS")
  123. !error Invalid CPU environment variable: CPU=i386 or MIPS
  124. !endif
  125. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  126. #
  127. # Default executable and flag declarations
  128. #
  129. #
  130. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  131. CVARS = -DWIN32 -DSTRICT $(TARGETAPI)
  132. CC = cc
  133. CFLAGS = -c -Zp4 $(TARGETOPTZ)
  134. RC = rc
  135. RFLAGS =
  136. LN = link32
  137. LFLAGS = -undecorate
  138. LB = lib32
  139. LBFLAGS =
  140. CVTRES = cvtres
  141. CRFLAGS = -$(CPU)
  142. !if "$(DEBUG)" != "NO"
  143. CVARS = $(CVARS) -DDEBUG
  144. CFLAGS = $(CFLAGS) -Zi
  145. LFLAGS = $(LFLAGS) -debug:full -debugtype:cv
  146. !endif
  147. !if "$(UNICODE)" == "YES"
  148. CVARS = $(CVARS) -DUNICODE
  149. !endif
  150. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  151. #
  152. # Standard library stuff
  153. #
  154. # CONLFLAGS and WINLFLAGS:
  155. #
  156. # NOTE! Any executable which accesses a DLL linked with CRTDLL.LIB must
  157. # also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
  158. #
  159. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  160. CONLFLAGS = -subsystem:console -entry:mainCRTStartup
  161. CONLIBSBASE = ntdll.lib kernel32.lib
  162. CONLIBSST = libc.lib $(CONLIBSBASE)
  163. CONLIBSMT = libcmt.lib $(CONLIBSBASE)
  164. CONLIBSDLL = crtdll.lib $(CONLIBSBASE)
  165. WINLFLAGS = -subsystem:windows -entry:WinMainCRTStartup
  166. WINLIBSBASE = ntdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
  167. comdlg32.lib shell32.lib winmm.lib
  168. WINLIBSST = libc.lib $(WINLIBSBASE)
  169. WINLIBSMT = libcmt.lib $(WINLIBSBASE)
  170. WINLIBSDLL = crtdll.lib $(WINLIBSBASE)
  171. #
  172. #
  173. #
  174. #
  175. !if ("$(TARGETTYPE)" == "CONAPPST") || ("$(TARGETTYPE)" == "CONAPP")
  176. CVARS = $(CVARS)
  177. CONLIBS = $(CONLIBSST)
  178. !endif
  179. !if "$(TARGETTYPE)" == "CONAPPMT"
  180. CVARS = $(CVARS) -D_MT
  181. CONLIBS = $(CONLIBSMT)
  182. !endif
  183. !if "$(TARGETTYPE)" == "CONDLL"
  184. CVARS = $(CVARS) -D_DLL
  185. CONLIBS = $(CONLIBSDLL)
  186. !endif
  187. !if ("$(TARGETTYPE)" == "WINAPPST") || ("$(TARGETTYPE)" == "WINAPP")
  188. CVARS = $(CVARS)
  189. WINLIBS = $(WINLIBSST)
  190. !endif
  191. !if "$(TARGETTYPE)" == "WINAPPMT"
  192. CVARS = $(CVARS) -D_MT
  193. WINLIBS = $(WINLIBSMT)
  194. !endif
  195. !if "$(TARGETTYPE)" == "WINDLL"
  196. CVARS = $(CVARS) -D_DLL -D_WINDLL
  197. WINLIBS = $(WINLIBSDLL)
  198. !endif
  199. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  200. #
  201. # PLATFORM DEPENDENT DECLARATIONS
  202. #
  203. #
  204. # NOTE! $(DLLENTRY) should be appended to each -entry: flag on the
  205. # link line.
  206. #
  207. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -;
  208. !if "$(CPU)" == "i386"
  209. CC = cl386
  210. CVARS = $(CVARS) -D_X86_
  211. DLLENTRY= @12
  212. LFLAGS = -align:0x1000 -ignore:505
  213. !if "$(DEBUG)" != "NO"
  214. CFLAGS = $(CFLAGS) -Z7
  215. !endif
  216. !endif
  217. !if "$(CPU)" == "MIPS"
  218. CC = mcl
  219. CVARS = $(CVARS) -D_MIPS_
  220. LFLAGS = -align:0x1000 -ignore:505
  221. DLLENTRY=
  222. !endif
  223. !endif