Leaked source code of windows server 2003
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.

271 lines
6.2 KiB

  1. ####
  2. # makefile.sub - Subdirectory-specific makefile for new VCRT build process
  3. #
  4. # Copyright (c) 1993-2001, Microsoft Corporation. All rights reserved.
  5. #
  6. # Purpose:
  7. # This makefile builds the C++ runtimes for Multi-thread, Single-Thread
  8. # and DLL.
  9. #
  10. # This is a general-purpose makefile. It is !INCLUDEd by the makefile
  11. # in each subdirectory (hence the .SUB extension). All subdirectory-
  12. # specific make information should be embedded in the SOURCES file in
  13. # that subdirectory, not in this file.
  14. #
  15. # Change to the appropriate subdirectory and type NMAKE DEPEND to
  16. # rebuild the dependencies. These are stored in DEPEND.DEF in each
  17. # subdirectory.
  18. #
  19. ###############################################################################
  20. # STRIPLIN=2
  21. ## Change this to BLD_ASM=1 if you have MASM 6.11a or later and wish
  22. ## to re-build the assembler sources provided in this release.
  23. #
  24. #BLD_ASM=0
  25. # STRIPLIN=0
  26. BLD_ASM=1
  27. # STRIPLIN=1
  28. #
  29. # Macro definitions:
  30. #
  31. ###############################################################################
  32. #
  33. # Add .S and .I suffixes for assembler files on platforms other than x86
  34. #
  35. .SUFFIXES:
  36. .SUFFIXES: .exe .obj .asm .s .i .c .cpp .cxx .res .rc
  37. !if "$(PRE_BLD)"=="1"
  38. DBFLAGS = -Z7
  39. !else
  40. DBFLAGS = -Zi
  41. !endif
  42. !if "$(BLD_DLL)" == "1"
  43. !ifndef DISABLE_MP_BUILD
  44. DBFLAGS = -Z7
  45. !ifdef NUMBER_OF_PROCESSORS
  46. !if $(NUMBER_OF_PROCESSORS) > 1
  47. CFLAGS = $(CFLAGS) -MP$(NUMBER_OF_PROCESSORS)
  48. !endif
  49. !endif
  50. !endif
  51. !endif
  52. !if "$(BLD_DBG)" == "1"
  53. CFLAGS=$(CFLAGS) $(DBFLAGS) -D_DEBUG -Od
  54. !if "$(TARGET_CPU)"=="IA64"
  55. AFLAGS=$(AFLAGS) -d debug
  56. !else
  57. AFLAGS=$(AFLAGS) -Zi -D_DEBUG
  58. !endif
  59. !else
  60. !if "$(TARGET_CPU)"=="AMD64"
  61. CFLAGS=$(CFLAGS) -Ox
  62. !else
  63. CFLAGS=$(CFLAGS) -O1
  64. !endif
  65. # STRIPLIN=2
  66. #!if "$(BLD_REL_NO_DBINFO)" != "1"
  67. # STRIPLIN=0
  68. !if "$(BLD_BBT)" == "1" || "$(BLD_REL_NO_DBINFO)" != "1"
  69. # STRIPLIN=1
  70. CFLAGS=$(CFLAGS) $(DBFLAGS)
  71. !if "$(TARGET_CPU)"=="IA64"
  72. AFLAGS=$(AFLAGS) -d debug
  73. !else
  74. AFLAGS=$(AFLAGS) -Zi
  75. !endif
  76. !endif
  77. !endif
  78. !if "$(BLD_BROWSE)" == "1"
  79. CFLAGS=-FR$(OBJDIR)\ $(CFLAGS)
  80. !if "$(TARGET_CPU)"!="IA64"
  81. AFLAGS=-FR$(OBJDIR)\ $(AFLAGS)
  82. !endif
  83. !endif
  84. # Tool definitions:
  85. CC=cl
  86. LIB=link -lib -nologo
  87. !if "$(TARGET_CPU)"=="i386"
  88. AS=ml
  89. CFLAGS=$(CFLAGS) -Wp64
  90. AFLAGS=$(AFLAGS) -safeseh -safeseh
  91. !elseif "$(TARGET_CPU)"=="IA64"
  92. AS=ias
  93. ACFLAGS= -D__assembler
  94. CFLAGS=$(CFLAGS) -Wp64
  95. AFLAGS=$(AFLAGS) -N so -X explicit
  96. !elseif "$(TARGET_CPU)"=="AMD64"
  97. AS=ml64
  98. AFLAGS=$(AFLAGS) -c
  99. CFLAGS=$(CFLAGS) -Wp64 -D_AMD64_
  100. !else
  101. AS=cl
  102. !endif
  103. # ******** STRIPLIN=0 ********
  104. LIB=$(LIB) -ignore:4006
  105. !if "$(BLD_CRT_LTCG)"=="1"
  106. CFLAGS=$(CFLAGS) -GL
  107. LIB=$(LIB) -ltcg:nostatus
  108. !endif
  109. !if "$(TARGET_CPU)"=="i386"
  110. SXGEN=sxgen /verbose
  111. !endif
  112. # ******** STRIPLIN=1 ********
  113. #
  114. # Source file definitions:
  115. #
  116. ###############################################################################
  117. A_INCLUDES=-I../h -I.
  118. C_INCLUDES=-I../h
  119. #
  120. # Inference rules:
  121. #
  122. # (Due to the kind of dependencies used below, we must explicitly define
  123. # inference rules to effect construction of the object files.)
  124. #
  125. ###############################################################################
  126. CXXFLAGS=$(CFLAGS) -d1Binl -GX -GR
  127. !if "$(POST_BLD)"!="1"
  128. !if "$(TARGET_CPU)"=="IA64" || "$(TARGET_CPU)"=="AMD64"
  129. CXXFLAGS=$(CXXFLAGS) -I../stdhpp64
  130. !else
  131. CXXFLAGS=$(CXXFLAGS) -I../stdhpp
  132. !endif
  133. !endif
  134. #
  135. # Rules for end-user source build
  136. #
  137. #
  138. # LSOURCES will override A_INCLUDES and C_INCLUDES for conv/ and tran/ subdirs.
  139. #
  140. ###############################################################################
  141. !if "$(POST_BLD)"=="1"
  142. !INCLUDE makefile.inc
  143. !else
  144. !INCLUDE lsources.
  145. !endif
  146. .c{$(OBJDIR)}.obj::
  147. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  148. !if "$(TARGET_CPU)"=="i386"
  149. {i386}.c{$(OBJDIR)}.obj::
  150. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  151. !elseif "$(TARGET_CPU)"=="IA64"
  152. {ia64}.c{$(OBJDIR)}.obj::
  153. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  154. !elseif "$(TARGET_CPU)"=="AMD64"
  155. {amd64}.c{$(OBJDIR)}.obj::
  156. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  157. !endif
  158. .cpp{$(OBJDIR)}.obj::
  159. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  160. !if "$(TARGET_CPU)"=="i386"
  161. {i386}.cpp{$(OBJDIR)}.obj::
  162. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  163. !IF $(BLD_ASM)==1
  164. {i386}.asm{$(OBJDIR)}.obj:
  165. !if "$(POST_BLD)"=="1" # STRIPLIN!
  166. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $<
  167. # STRIPLIN=0
  168. !else
  169. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $(MAKEDIR)\$<
  170. !endif
  171. # STRIPLIN=1
  172. !ENDIF
  173. !elseif "$(TARGET_CPU)"=="AMD64"
  174. {AMD64}.cpp{$(OBJDIR)}.obj::
  175. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  176. !IF $(BLD_ASM)==1
  177. {AMD64}.asm{$(OBJDIR)}.obj:
  178. !if "$(POST_BLD)"=="1" # STRIPLIN!
  179. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $<
  180. # STRIPLIN=0
  181. !else
  182. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $(MAKEDIR)\$<
  183. !endif
  184. # STRIPLIN=1
  185. !ENDIF
  186. !elseif "$(TARGET_CPU)"=="IA64"
  187. {ia64}.cpp{$(OBJDIR)}.obj::
  188. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  189. {ia64}.s{$(OBJDIR)}.obj:
  190. $(CC) -E $(CFLAGS) $(ACFLAGS) $(A_INCLUDES) $< > $*.i
  191. $(AS) $(AFLAGS) -o$(OBJDIR)\$(@F) $*.i
  192. del $*.i
  193. !endif
  194. # ******** STRIPLIN=0 ********
  195. #
  196. # Dependencies:
  197. #
  198. # NOTE: The inference rules cause the targets to actually be built; no
  199. # commands are necessary below.
  200. #
  201. ###############################################################################
  202. $(OBJDIR)\$(CURDIR).lib: $(OBJS) $(OBJS_NOT_IN_LIB) $(OBJDIR)\$(CURDIR).rsp
  203. !if "$(PRE_BLD)"=="1" && "$(DEVBUILD)"!="1"
  204. sed -f %CRT_BUILDDIR%\crt\prebuild\tools\win32\newline.sed $(OBJDIR)\$(CURDIR).rsp | sed -f %CRT_BUILDDIR%\crt\prebuild\tools\win32\delblank.sed >> temp.lst
  205. for /F %i in (temp.lst) do @%CRT_BUILDDIR%\crt\prebuild\libw32\tools\$(HOST_CPU)\whackline %i
  206. del temp.lst
  207. !endif
  208. $(LIB) -out:$@ @$(OBJDIR)\$(CURDIR).rsp
  209. $(OBJDIR)\$(CURDIR).rsp: lsources
  210. @echo Creating response file: <<$(OBJDIR)\$(CURDIR).rsp
  211. $(OBJS)
  212. <<keep
  213. # ******** STRIPLIN=1 ********
  214. !IF EXIST(special.mak)
  215. ! INCLUDE special.mak # Include special makefile additions, if any
  216. !ENDIF
  217. !IF EXIST(depend.def)
  218. ! INCLUDE depend.def # Include dependencies on .h files
  219. !ENDIF
  220. #<eof>