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.

304 lines
6.9 KiB

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