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.

281 lines
6.5 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. DBFLAGS = -Zi
  38. !if "$(BLD_DLL)" == "1"
  39. !ifndef DISABLE_MP_BUILD
  40. DBFLAGS = -Z7
  41. !ifdef NUMBER_OF_PROCESSORS
  42. !if $(NUMBER_OF_PROCESSORS) > 1
  43. CFLAGS = $(CFLAGS) -MP$(NUMBER_OF_PROCESSORS)
  44. !endif
  45. !endif
  46. !endif
  47. !endif
  48. !if "$(BLD_DBG)" == "1"
  49. CFLAGS=$(CFLAGS) $(DBFLAGS) -D_DEBUG -Od
  50. !if "$(TARGET_CPU)"=="IA64"
  51. AFLAGS=$(AFLAGS) -d debug
  52. !else
  53. AFLAGS=$(AFLAGS) -Zi -D_DEBUG
  54. !endif
  55. !else
  56. CFLAGS=$(CFLAGS) -O1
  57. # STRIPLIN=2
  58. #!if "$(BLD_REL_NO_DBINFO)" != "1"
  59. # STRIPLIN=0
  60. !if "$(BLD_BBT)" == "1" || "$(BLD_REL_NO_DBINFO)" != "1"
  61. # STRIPLIN=1
  62. CFLAGS=$(CFLAGS) $(DBFLAGS)
  63. !if "$(TARGET_CPU)"=="IA64"
  64. AFLAGS=$(AFLAGS) -d debug
  65. !else
  66. AFLAGS=$(AFLAGS) -Zi
  67. !endif
  68. !endif
  69. !endif
  70. !if "$(BLD_BROWSE)" == "1"
  71. CFLAGS=-FR$(OBJDIR)\ $(CFLAGS)
  72. !if "$(TARGET_CPU)"!="IA64"
  73. AFLAGS=-FR$(OBJDIR)\ $(AFLAGS)
  74. !endif
  75. !endif
  76. # Tool definitions:
  77. CC=cl
  78. LIB=link -lib -nologo
  79. !if "$(TARGET_CPU)"=="i386"
  80. AS=ml
  81. CFLAGS=$(CFLAGS) -Wp64
  82. !elseif "$(TARGET_CPU)"=="IA64"
  83. AS=ias
  84. ACFLAGS= -D__assembler
  85. CFLAGS=$(CFLAGS) -Wp64
  86. AFLAGS=$(AFLAGS) -N so -X explicit
  87. # ******** STRIPLIN=0 ********
  88. !elseif "$(TARGET_CPU)"=="ALPHA"
  89. AS=asaxp -Ialpha $(ML)
  90. !elseif "$(TARGET_CPU)"=="ALPHA64"
  91. AS=asaxp -Iaxp64 -Ialpha $(ML) -Ap64 -D_AXP64_
  92. CFLAGS=$(CFLAGS) -Ap64 -Wp64
  93. # ******** STRIPLIN=1 ********
  94. !else
  95. AS=cl
  96. !endif
  97. # ******** STRIPLIN=0 ********
  98. LIB=$(LIB) -ignore:4006
  99. !if "$(BLD_CRT_LTCG)"=="1"
  100. CFLAGS=$(CFLAGS) -GL
  101. LIB=$(LIB) -ltcg:nostatus
  102. !endif
  103. # ******** STRIPLIN=1 ********
  104. #
  105. # Source file definitions:
  106. #
  107. ###############################################################################
  108. A_INCLUDES=-I../h -I.
  109. C_INCLUDES=-I../h
  110. #
  111. # Inference rules:
  112. #
  113. # (Due to the kind of dependencies used below, we must explicitly define
  114. # inference rules to effect construction of the object files.)
  115. #
  116. ###############################################################################
  117. CXXFLAGS=$(CFLAGS) -GR -GX -d1Binl
  118. !if "$(POST_BLD)"!="1"
  119. !if "$(TARGET_CPU)"=="IA64"
  120. CXXFLAGS=$(CXXFLAGS) -I../stdhpp64
  121. # ******** STRIPLIN=0 ********
  122. !elseif "$(TARGET_CPU)"=="ALPHA64"
  123. CXXFLAGS=$(CXXFLAGS) -I../stdhpp64
  124. # ******** STRIPLIN=1 ********
  125. !else
  126. CXXFLAGS=$(CXXFLAGS) -I../stdhpp
  127. !endif
  128. !endif
  129. #
  130. # Rules for end-user source build
  131. #
  132. #
  133. # LSOURCES will override A_INCLUDES and C_INCLUDES for conv/ and tran/ subdirs.
  134. #
  135. ###############################################################################
  136. !if "$(POST_BLD)"=="1"
  137. !INCLUDE makefile.inc
  138. !else
  139. !INCLUDE lsources.
  140. !endif
  141. .c{$(OBJDIR)}.obj::
  142. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  143. !if "$(TARGET_CPU)"=="i386"
  144. {i386}.c{$(OBJDIR)}.obj::
  145. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  146. !elseif "$(TARGET_CPU)"=="IA64"
  147. {ia64}.c{$(OBJDIR)}.obj::
  148. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  149. # ******** STRIPLIN=0 ********
  150. !elseif "$(TARGET_CPU)"=="ALPHA"
  151. {alpha}.c{$(OBJDIR)}.obj::
  152. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  153. !elseif "$(TARGET_CPU)"=="ALPHA64"
  154. {alpha}.c{$(OBJDIR)}.obj::
  155. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  156. {axp64}.c{$(OBJDIR)}.obj::
  157. $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  158. # ******** STRIPLIN=1 ********
  159. !endif
  160. .cpp{$(OBJDIR)}.obj::
  161. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  162. !if "$(TARGET_CPU)"=="i386"
  163. {i386}.cpp{$(OBJDIR)}.obj::
  164. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  165. !IF $(BLD_ASM)==1
  166. {i386}.asm{$(OBJDIR)}.obj:
  167. !if "$(POST_BLD)"=="1" # STRIPLIN!
  168. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $<
  169. # STRIPLIN=0
  170. !else
  171. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $(MAKEDIR)\$<
  172. !endif
  173. # STRIPLIN=1
  174. !ENDIF
  175. !elseif "$(TARGET_CPU)"=="IA64"
  176. {ia64}.cpp{$(OBJDIR)}.obj::
  177. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  178. {ia64}.s{$(OBJDIR)}.obj:
  179. $(CC) -E $(CFLAGS) $(ACFLAGS) $(A_INCLUDES) $< > $*.i
  180. $(AS) $(AFLAGS) -o$(OBJDIR)\$(@F) $*.i
  181. del $*.i
  182. # ******** STRIPLIN=0 ********
  183. !elseif "$(TARGET_CPU)"=="ALPHA"
  184. {alpha}.cpp{$(OBJDIR)}.obj::
  185. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  186. {alpha}.s{$(OBJDIR)}.obj:
  187. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo $@ $<
  188. !elseif "$(TARGET_CPU)"=="ALPHA64"
  189. {alpha}.cpp{$(OBJDIR)}.obj::
  190. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  191. {axp64}.cpp{$(OBJDIR)}.obj::
  192. $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  193. {alpha}.s{$(OBJDIR)}.obj:
  194. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo $@ $<
  195. {axp64}.s{$(OBJDIR)}.obj:
  196. $(AS) $(AFLAGS) $(A_INCLUDES) -Fo $@ $<
  197. # ******** STRIPLIN=1 ********
  198. !endif
  199. # ******** STRIPLIN=0 ********
  200. #
  201. # Dependencies:
  202. #
  203. # NOTE: The inference rules cause the targets to actually be built; no
  204. # commands are necessary below.
  205. #
  206. ###############################################################################
  207. $(OBJDIR)\$(CURDIR).lib: $(OBJS) $(OBJS_NOT_IN_LIB) $(OBJDIR)\$(CURDIR).rsp
  208. !if "$(PRE_BLD)"=="1" && "$(DEVBUILD)"!="1"
  209. 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
  210. for /F %i in (temp.lst) do @%CRT_BUILDDIR%\crt\prebuild\libw32\tools\$(HOST_CPU)\whackline %i
  211. del temp.lst
  212. !endif
  213. $(LIB) -out:$@ @$(OBJDIR)\$(CURDIR).rsp
  214. $(OBJDIR)\$(CURDIR).rsp: lsources
  215. @echo Creating response file: <<$(OBJDIR)\$(CURDIR).rsp
  216. $(OBJS)
  217. <<keep
  218. # ******** STRIPLIN=1 ********
  219. !IF EXIST(special.mak)
  220. ! INCLUDE special.mak # Include special makefile additions, if any
  221. !ENDIF
  222. !IF EXIST(depend.def)
  223. ! INCLUDE depend.def # Include dependencies on .h files
  224. !ENDIF
  225. #<eof>