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.

346 lines
7.2 KiB

  1. !include common.mkf
  2. CS = $(CRT_BUILDDIR)\srcrel\$(CPUDIR)
  3. !if "$(LLP64)" == "0" || "$(PA)" == "IA64" || "$(PA)" == "ALPHA64"
  4. CC = cl
  5. !else
  6. # Doing a cross-compiler build. Make sure we use the native tools. Clear
  7. # _CL_ just in case it includes -B1/-Bx/-B2 pointing to cross-compiling passes.
  8. CC = $(DEVTOOLSBIN)\cl
  9. _CL_=
  10. !endif
  11. DEF_NAME=msvcrt
  12. DEFCPP_NAME=msvcprt
  13. DEFIOS_NAME=msvcirt
  14. D=$(CRT_BUILDDIR)\crt\src
  15. E=$D\$(CPUDIR)
  16. S=$(CRT_BUILDDIR)\crt\src
  17. T=$S\build\$(CPUDIR)
  18. !if "$(PA)"=="ALPHA" || "$(PA)"=="ALPHA64"
  19. FILES_CPU =
  20. !elseif "$(PA)"=="MIPS"
  21. FILES_CPU =
  22. !elseif "$(PA)"=="PPC"
  23. FILES_CPU =
  24. !elseif "$(PA)"=="IA64" || ("$(PA)"=="x86" && "$(LLP64)"=="1")
  25. FILES_CPU =
  26. !elseif "$(PA)"=="x86"
  27. FILES_CPU_DLL = \
  28. $E\*\dllsupp.obj
  29. FILES_CPU = \
  30. $E\*\chkstk.obj \
  31. $E\*\enable.obj \
  32. $E\*\inp.obj \
  33. $E\*\lldiv.obj \
  34. $E\*\lldvrm.obj \
  35. $E\*\llmul.obj \
  36. $E\*\llrem.obj \
  37. $E\*\llshl.obj \
  38. $E\*\llshr.obj \
  39. $E\*\memccpy.obj \
  40. $E\*\memchr.obj \
  41. $E\*\memcmp.obj \
  42. $E\*\memcpy.obj \
  43. $E\*\_memicmp.obj \
  44. $E\*\memmove.obj \
  45. $E\*\memset.obj \
  46. $E\*\outp.obj \
  47. $E\*\strcat.obj \
  48. $E\*\strchr.obj \
  49. $E\*\strcmp.obj \
  50. $E\*\strcspn.obj \
  51. $E\*\strdup.obj \
  52. $E\*\_stricmp.obj \
  53. $E\*\strlen.obj \
  54. $E\*\strncat.obj \
  55. $E\*\strncmp.obj \
  56. $E\*\strncpy.obj \
  57. $E\*\_strnicm.obj \
  58. $E\*\strnset.obj \
  59. $E\*\strpbrk.obj \
  60. $E\*\strrchr.obj \
  61. $E\*\strrev.obj \
  62. $E\*\strset.obj \
  63. $E\*\strspn.obj \
  64. $E\*\strstr.obj \
  65. $E\*\ulldiv.obj \
  66. $E\*\ulldvrm.obj \
  67. $E\*\ullrem.obj \
  68. $E\*\ullshr.obj
  69. !endif
  70. FILES_LIBCST = $(FILES_CPU:*=*st_lib)
  71. FILES_LIBCMT = $(FILES_CPU:*=*mt_lib)
  72. FILES_DLL = $(FILES_CPU:*=*dll_lib) $(FILES_CPU_DLL:*=*dll_lib)
  73. FILES_ALL = \
  74. $D\ext_mkf \
  75. $D\ext_mkf.inc \
  76. $D\ext_mkf.sub \
  77. $D\bldnt.cmd \
  78. $D\bldwin9x.bat \
  79. $D\nmktobat.c
  80. FILES_DLL_ALL = \
  81. !if "$(PA)"=="x86" && "$(LLP64)"=="0"
  82. $D\sample_i.rc \
  83. $D\sample_p.rc \
  84. $D\_sample_.rc
  85. !endif
  86. FILES_DLL_RELEASE = \
  87. $(FILES_DLL_ALL) \
  88. $D\sample_i.def \
  89. $D\sample_p.def \
  90. $E\_sample_.def
  91. FILES_DLL_DEBUG = \
  92. $(FILES_DLL_ALL) \
  93. $D\sampld_i.def \
  94. $D\sampld_p.def \
  95. $E\_sampld_.def
  96. FILES_BSKU = $E\*\bsku.obj
  97. FILES_BST = $(FILES_BSKU:*=*st_lib)
  98. FILES_BMT = $(FILES_BSKU:*=*mt_lib)
  99. .SUFFIXES:
  100. .SUFFIXES: .lib .obj
  101. {$T\st_obj}.obj{$E\st_lib}.obj:
  102. @echo Copying $< to $@
  103. @copy $< $@
  104. {$T\st_obj}.lib{$E\st_lib}.lib:
  105. @echo Copying $< to $@
  106. @copy $< $@
  107. {$T\st_obj}.lib{$E}.lib:
  108. @echo Copying $< to $@
  109. @copy $< $@
  110. {$T\xst_obj}.obj{$E\xst_lib}.obj:
  111. @echo Copying $< to $@
  112. @copy $< $@
  113. {$T\xst_obj}.lib{$E\xst_lib}.lib:
  114. @echo Copying $< to $@
  115. @copy $< $@
  116. {$T\zst_obj}.obj{$E\zst_lib}.obj:
  117. @echo Copying $< to $@
  118. @copy $< $@
  119. {$T\zst_obj}.lib{$E\zst_lib}.lib:
  120. @echo Copying $< to $@
  121. @copy $< $@
  122. {$T\mt_obj}.obj{$E\mt_lib}.obj:
  123. @echo Copying $< to $@
  124. @copy $< $@
  125. {$T\mt_obj}.lib{$E\mt_lib}.lib:
  126. @echo Copying $< to $@
  127. @copy $< $@
  128. {$T\xmt_obj}.obj{$E\xmt_lib}.obj:
  129. @echo Copying $< to $@
  130. @copy $< $@
  131. {$T\xmt_obj}.lib{$E\xmt_lib}.lib:
  132. @echo Copying $< to $@
  133. @copy $< $@
  134. {$T\zmt_obj}.obj{$E\zmt_lib}.obj:
  135. @echo Copying $< to $@
  136. @copy $< $@
  137. {$T\zmt_obj}.lib{$E\zmt_lib}.lib:
  138. @echo Copying $< to $@
  139. @copy $< $@
  140. {$T\dll_obj}.obj{$E\dll_lib}.obj:
  141. @echo Copying $< to $@
  142. @copy $< $@
  143. {$T\dll_obj}.lib{$E\dll_lib}.lib:
  144. @echo Copying $< to $@
  145. @copy $< $@
  146. {$T\dll_obj}.lib{$E}.lib:
  147. @echo Copying $< to $@
  148. @copy $< $@
  149. {$T\zdll_obj}.obj{$E\zdll_lib}.obj:
  150. @echo Copying $< to $@
  151. @copy $< $@
  152. {$T\zdll_obj}.lib{$E\zdll_lib}.lib:
  153. @echo Copying $< to $@
  154. @copy $< $@
  155. {$T\xdll_obj}.obj{$E\xdll_lib}.obj:
  156. @echo Copying $< to $@
  157. @copy $< $@
  158. {$T\xdll_obj}.lib{$E\xdll_lib}.lib:
  159. @echo Copying $< to $@
  160. @copy $< $@
  161. {$T\bst_obj}.obj{$E\bst_lib}.obj:
  162. @echo Copying $< to $@
  163. @copy $< $@
  164. {$T\bst_obj}.lib{$E\bst_lib}.lib:
  165. @echo Copying $< to $@
  166. @copy $< $@
  167. {$T\bmt_obj}.obj{$E\bmt_lib}.obj:
  168. @echo Copying $< to $@
  169. @copy $< $@
  170. {$T\bmt_obj}.lib{$E\bmt_lib}.lib:
  171. @echo Copying $< to $@
  172. @copy $< $@
  173. {$T\xbst_obj}.obj{$E\xbst_lib}.obj:
  174. @echo Copying $< to $@
  175. @copy $< $@
  176. {$T\xbst_obj}.lib{$E\xbst_lib}.lib:
  177. @echo Copying $< to $@
  178. @copy $< $@
  179. {$T\xbmt_obj}.obj{$E\xbmt_lib}.obj:
  180. @echo Copying $< to $@
  181. @copy $< $@
  182. {$T\xbmt_obj}.lib{$E\xbmt_lib}.lib:
  183. @echo Copying $< to $@
  184. @copy $< $@
  185. all: release debug
  186. release: st mt dll $(FILES_ALL)
  187. debug: xst xmt xdll $(FILES_ALL)
  188. bbt: zst zmt zdll $(FILES_ALL)
  189. book: bst bmt xbst xbmt $(FILES_ALL)
  190. lego: bbt
  191. st: $(FILES_LIBCST:*=)
  192. mt: $(FILES_LIBCMT:*=)
  193. dll: $(FILES_DLL:*=) $(FILES_DLL_RELEASE)
  194. xst: $(FILES_LIBCST:*=x)
  195. xmt: $(FILES_LIBCMT:*=x)
  196. xdll: $(FILES_DLL:*=x) $(FILES_DLL_DEBUG)
  197. zst: $(FILES_LIBCST:*=z)
  198. zmt: $(FILES_LIBCMT:*=z)
  199. zdll: $(FILES_DLL:*=z) $(FILES_DLL_RELEASE)
  200. bst: $(FILES_LIBCST:*=b) $(FILES_BST:*=b)
  201. bmt: $(FILES_LIBCMT:*=b) $(FILES_BMT:*=b)
  202. xbst: $(FILES_LIBCST:*=xb) $(FILES_BST:*=xb)
  203. xbmt: $(FILES_LIBCMT:*=xb) $(FILES_BMT:*=xb)
  204. $D\nmktobat.c: nmktobat.c
  205. @echo Copying $** to $@
  206. @copy $** $@
  207. $D\bldnt.cmd: bldnt.cmd
  208. @echo Copying $** to $@
  209. @copy $** $@
  210. $D\bldwin9x.bat: bldwin9x.bat
  211. @echo Copying $** to $@
  212. @copy $** $@
  213. $D\ext_mkf: $D\makefile $(CS)\striplin.exe
  214. @echo Translating $D\makefile into $@
  215. @$(CS)\striplin < $D\makefile > $@
  216. $D\ext_mkf.inc: $D\makefile.inc $(CS)\striplin.exe
  217. @echo Translating $D\makefile.inc into $@
  218. @$(CS)\striplin < $D\makefile.inc > $@
  219. $D\ext_mkf.sub: $D\makefile.sub $(CS)\striplin.exe
  220. @echo Translating $D\makefile.sub into $@
  221. @$(CS)\striplin < $D\makefile.sub > $@
  222. $D\_sample_.rc: _sample_.rc
  223. @echo Copying $** to $@
  224. @copy $** $@
  225. $D\sample_i.rc: _sample_.rc
  226. @echo Translating $** into $@
  227. @sed -e "s/_SAMPLD_/SAMPLD_I/" -e "s/_SAMPLE_/SAMPLE_I/" $** > $@
  228. $D\sample_p.rc: _sample_.rc
  229. @echo Translating $** into $@
  230. @sed -e "s/_SAMPLD_/SAMPLD_P/" -e "s/_SAMPLE_/SAMPLE_P/" $** > $@
  231. $E\_sample_.def: $E\$(DEF_NAME).def $(CS)\striplin.exe
  232. @echo Translating $E\$(DEF_NAME).def into $@
  233. @$(CS)\striplin < $E\$(DEF_NAME).def | sed -e "s/MSVCR[0-9][0-9]D/_SAMPLD_/" -e "s/MSVCR[0-9][0-9]/_SAMPLE_/" > $@
  234. $E\_sampld_.def: $E\$(DEF_NAME)d.def $(CS)\striplin.exe
  235. @echo Translating $E\$(DEF_NAME)d.def into $@
  236. @$(CS)\striplin < $E\$(DEF_NAME)d.def | sed -e "s/MSVCR[0-9][0-9]D/_SAMPLD_/" -e "s/MSVCR[0-9][0-9]/_SAMPLE_/" > $@
  237. $D\sample_i.def: $D\$(DEFIOS_NAME).def $(CS)\striplin.exe
  238. @echo Translating $D\$(DEFIOS_NAME).def into $@
  239. @$(CS)\striplin < $D\$(DEFIOS_NAME).def | sed -e "s/MSVCI[0-9][0-9]D/SAMPLD_I/" -e "s/MSVCI[0-9][0-9]/SAMPLE_I/" > $@
  240. $D\sampld_i.def: $D\$(DEFIOS_NAME)d.def $(CS)\striplin.exe
  241. @echo Translating $D\$(DEFIOS_NAME)d.def into $@
  242. @$(CS)\striplin < $D\$(DEFIOS_NAME)d.def | sed -e "s/MSVCI[0-9][0-9]D/SAMPLD_I/" -e "s/MSVCI[0-9][0-9]/SAMPLE_I/" > $@
  243. $D\sample_p.def: $D\$(DEFCPP_NAME).def $(CS)\striplin.exe
  244. @echo Translating $D\$(DEFCPP_NAME).def into $@
  245. @$(CS)\striplin < $D\$(DEFCPP_NAME).def | sed -e "s/MSVCP[0-9][0-9]D/SAMPLD_P/" -e "s/MSVCP[0-9][0-9]/SAMPLE_P/" > $@
  246. $D\sampld_p.def: $D\$(DEFCPP_NAME)d.def $(CS)\striplin.exe
  247. @echo Translating $D\$(DEFCPP_NAME)d.def into $@
  248. @$(CS)\striplin < $D\$(DEFCPP_NAME)d.def | sed -e "s/MSVCP[0-9][0-9]D/SAMPLD_P/" -e "s/MSVCP[0-9][0-9]/SAMPLE_P/" > $@
  249. $(CS)\striplin.exe: striplin.c
  250. $(CC) -nologo -Gi- -W3 -WX -Za -X -I$(DEVTOOLSINC) \
  251. -Fo$(CS)\ -Fe$(CS)\ striplin.c \
  252. -link -nod:libc.lib -nod:kernel32.lib \
  253. $(DEVTOOLSLIB)\libc.lib $(DEVTOOLSSDKLIB)\kernel32.lib