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.

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