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
11 KiB

  1. MYNTTREE=$(_NTTREE:\.=)
  2. MYNTTREE_ESC=$(MYNTTREE:\=\\)
  3. MYALTNTTREE_ESC=$(_ALT_NTTREE:\=\\)
  4. BINPLACE_PLACEFILE=$(O)\placefil.txt
  5. IMAGEROOT=$(DXROOT)\DeliveryImages
  6. IMAGEINCROOT=$(IMAGEROOT)\inc
  7. CABROOT=$(IMAGEROOT)\CabPacks
  8. CABROOT_TARGET=$(CABROOT)\Win2K
  9. #Change the line below to determine where the cabs pull their files from
  10. CABCACHEROOT=$(CABROOT)\CabinetFileCache
  11. CABCACHEROOT_ESC=$(CABCACHEROOT:\=\\)
  12. CACHEMGR_SCR=$(CABROOT_TARGET)\CabCacheMgr.pl
  13. DEPENDENCYPATHS_SCR=$(CABROOT_TARGET)\MakeDepPathVar.pl
  14. SEDGEN_SCR=$(CABROOT_TARGET)\MakeSedScr.pl
  15. DEPGEN_SCR=$(CABROOT_TARGET)\MakeDepList.pl
  16. CDFGEN_SCR=$(CABROOT_TARGET)\MakeCDF.pl
  17. CORRECTVER_SCR=$(CABROOT_TARGET)\CorrectVer.pl
  18. DEPENDENCYPATHS_FILE=$(O)\DepPaths.txt
  19. #needs to be the same rvalue in this configuration
  20. DEPENDENCYLIST=$O\DependencyList.txt
  21. DEPENDENCYLIST_FILE=$O\DependencyList.txt
  22. CATNAME=$O\DX8W2K
  23. CATFILE=$(CATNAME).CAT
  24. CDFFILE=$(CATNAME).CDF
  25. CHKCAT=$(CATFILE).Succeeded
  26. PRODUCTTD_FILE=$(IMAGEINCROOT)\ProductTimeDate.txt
  27. BUILDGENMSG=@echo Build_Status Generating -
  28. #PERLLOC=$(BASEDIR)\public\tools\perl.exe
  29. PERLLOC=$(CABROOT)\tools\perl.exe
  30. SEDLOC=$(CABROOT)\tools\sed.exe
  31. IEXPRESSDIR=$(DXROOT)\setup\iexpress
  32. REDISTFILELIST=$(IMAGEINCROOT)\nt50redist.dat
  33. MASTERSEDFILE=$O\$(CABTYPE).sed
  34. VERSIONINFO=$O\version.txt
  35. RSPFILE=$O\Version.rsp
  36. DEFAULTLANGUAGE=eng
  37. !if ("$(PRODUCT)" == "")
  38. PRODUCT=$(__PRODUCT)0
  39. !endif
  40. EXTRATEXT=.\$(LANGUAGE).txt
  41. SETUPAPP=DXSetup.exe
  42. LOCALIZEDROOT=localized
  43. CABCACHEFLAGS_FILE=$(O)\CabCacheFlags.txt
  44. IEXPRESS_CMD=if exist $(MAKEDIR)\$@ del /q $(MAKEDIR)\$@ &
  45. IEXPRESS_CMD=$(BUILDGENMSG) $(MAKEDIR)\$@
  46. !if [dir $(IEXPRESSDIR)\$(LANGUAGE)\iexpress.exe 1>nul 2>&1]
  47. IEXPRESS_CMD=$(IEXPRESS_CMD) & $(IEXPRESSDIR)\iexpress.exe /Q /N /M $?
  48. !else
  49. IEXPRESS_CMD=$(IEXPRESS_CMD) & $(IEXPRESSDIR)\$(LANGUAGE)\iexpress.exe /Q /N /M $?
  50. !endif
  51. IEXPRESS_CMD=$(IEXPRESS_CMD) & if not exist $@ @echo nmake : error IEXPRESS : $@ not generated; find problem run the iexpress cmd line without /Q
  52. !if ([dir $(PRODUCTTD_FILE) 1>nul 2>&1])
  53. THINGSTODO=$(THINGSTODO) GetCurrentTimeDate
  54. !else
  55. !include $(PRODUCTTD_FILE)
  56. !endif
  57. !if (("$(PRODUCTTDSTAMP)"!="$(PRODUCTTD)") && ("$(PRODUCTTD)"!=""))
  58. THINGSTODO=$(THINGSTODO) GetCurrentTimeDate
  59. !endif
  60. !if [dir $(DEPENDENCYLIST) 1>nul 2>&1]
  61. THINGSTODO=$(THINGSTODO) BuildDependencyList
  62. !else
  63. !include $(DEPENDENCYLIST)
  64. !endif
  65. !if [dir $(VERSIONINFO) 1>nul 2>&1]
  66. THINGSTODO=$(THINGSTODO) GetVersionInfo
  67. !else
  68. !include $(VERSIONINFO)
  69. !endif
  70. THINGSTODO=$(THINGSTODO) TouchedTargetSupport
  71. !if ("$(KEEP_CAT)"=="")
  72. THINGSTODO=$(THINGSTODO) $(CHKCAT)
  73. !endif
  74. !if ("$(SEDFILE)"!="")
  75. !include $(CABCACHEFLAGS_FILE)
  76. !include $(DEPENDENCYPATHS_FILE)
  77. !endif
  78. SEDGEN_CMD=$(BUILDGENMSG) $(MAKEDIR)\$@
  79. SEDGEN_CMD=$(SEDGEN_CMD) & $(PERLLOC) $(SEDGEN_SCR) $(LANGUAGE) $(MASTERSEDFILE) $(CATFILE) $O $(DEFAULTLANGUAGE) $(@B) $(LOCALIZEDROOT) $(CABTYPE) $(Opt)
  80. SEDGEN_CMD=$(SEDGEN_CMD) & @if not exist $@ @echo nmake : error GENSED : failed to make $@
  81. DEPGEN_CMD=$(BUILDGENMSG) $(MAKEDIR)\$@
  82. DEPGEN_CMD=$(DEPGEN_CMD) & $(PERLLOC) $(DEPGEN_SCR) $(_NTTREE:\.=) $(LANGUAGE) $(DEPENDENCYLIST) $(LOCALIZEDROOT) $(CABTYPE)
  83. DEPGEN_CMD=$(DEPGEN_CMD) & @if not exist $(DEPENDENCYLIST) @echo nmake : error GENDEP : failed to make $(DEPENDENCYLIST)
  84. CDF_CMD=$(BUILDGENMSG) $(MAKEDIR)\$@
  85. CDF_CMD=$(CDF_CMD) & $(PERLLOC) $(CDFGEN_SCR) $(_NTTREE:\.=) $(LANGUAGE) $(CDFFILE) $(*F) $(@D) $(LOCALIZEDROOT) $(CABTYPE)
  86. CDF_CMD=$(CDF_CMD) & @if not exist $(CDFFILE) @echo nmake : error GENSRC : failed to make $(CDFFILE)
  87. CORRECTVER_CMD=$(BUILDGENMSG) $(MAKEDIR)\$(CDFFILE)
  88. CORRECTVER_CMD=$(CORRECTVER_CMD) & $(PERLLOC) $(CORRECTVER_SCR) $(O)\$(@B).CDF $(VERSIONINFO) $(CDFFILE)
  89. CORRECTVER_CMD=$(CORRECTVER_CMD) & @if not exist $(CDFFILE) @echo nmake : error CORRECTVER : failed to make $(CDFFILE)
  90. !if ("$(SEDFILE)"!="")
  91. !if [dir $(EXTRATEXT) 1>nul 2>&1]
  92. !include $(CABROOT_TARGET)\$(DEFAULTLANGUAGE)\$(DEFAULTLANGUAGE).txt
  93. !else
  94. !include $(EXTRATEXT)
  95. !endif
  96. DisplayLicense=.\web$(LANGUAGE).txt
  97. !if [dir $(DisplayLicense) 1>nul 2>&1]
  98. DisplayLicense=$(CABROOT_TARGET)\$(DEFAULTLANGUAGE)\web$(DEFAULTLANGUAGE).txt
  99. !endif
  100. !if ("$(CABTYPE)" == "wu")
  101. CABNAME=$(PRODUCT)$(CABTYPE)$(LANGUAGE).exe
  102. AppLaunched=$(SETUPAPP) /windowsupdate
  103. FRIENDLYDESCRIPTION=for Windows Update
  104. !else if ("$(CABTYPE)" == "exe")
  105. CABNAME=$(PRODUCT)$(LANGUAGE).exe
  106. AppLaunched=$(SETUPAPP) /packageinstall
  107. FRIENDLYDESCRIPTION=runtime
  108. !else if ("$(CABTYPE)" == "bda")
  109. CABTYPE=exe
  110. CABNAME=$(PRODUCT)bda$(LANGUAGE).exe
  111. AppLaunched=$(SETUPAPP) /packageinstall
  112. FRIENDLYDESCRIPTION=runtime
  113. !else if ("$(CABTYPE)" == "opk")
  114. CABNAME=$(PRODUCT)$(CABTYPE).exe
  115. AppLaunched=$(SETUPAPP) /silent
  116. FRIENDLYDESCRIPTION=OPK
  117. !else if ("$(CABTYPE)" == "core")
  118. CABNAME=dxnt.cab
  119. !else
  120. !error nmake : error CABTYPE : unknown cabtype $(CABTYPE)
  121. !endif //CABTYPE
  122. TargetName=$O\$(CABNAME)
  123. FileVersion=$(ProductVersion)
  124. CompanyName=Microsoft Corporation
  125. FileDescription=DirectX cabpack for $(LANGUAGE)
  126. InternalName=$(SETUPAPP)
  127. OriginalFilename=$(InternalName)
  128. SourceFiles0=$(CABCACHEROOT)
  129. SourceFiles1=$(_NTTREE)
  130. !endif //SEDFILE
  131. DESCRIPTION=DirectX $(PRODUCT) $(FRIENDLYDESCRIPTION)
  132. LISTTXT=$O\list.txt.$(CABTYPE)
  133. #PRIVATEKEY=$(BASEDIR)\public\tools\driver.pvk
  134. #CERTIFICATE=$(BASEDIR)\public\tools\driver.spc
  135. PRIVATEKEY=$(BASEDIR)\tools\driver.pvk
  136. CERTIFICATE=$(BASEDIR)\tools\driver.spc
  137. DXWEBPAGE=http://www.microsoft.com/DirectX
  138. SIGNIT_CMD=@echo Build_Status Test Signing - $@
  139. SIGNIT_CMD=$(SIGNIT_CMD) & signcode -sha1 $(NT_CERTHASH) -n "$(DESCRIPTION)" -i "$(DXWEBPAGE)" $@
  140. !if "$(NTDEBUG)"!="" && "$(NTDEBUG)"!="ntsdnodbg"
  141. wu:
  142. @echo Debug version of cab file for Windows Update is not supported
  143. exe:
  144. @echo Debug version of cab file for the home user is not supported
  145. opk:
  146. @echo Debug version of cab file for OPK is not supported
  147. bda:
  148. @echo Debug version of cab file with BDA is not supported
  149. !else
  150. !if ("$(BUILD_WUCAB)"!="")
  151. wu: $(THINGSTODO)
  152. -$(MAKE) SEDFILE=$O\$(PRODUCT)$@$(LANGUAGE).sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\$(PRODUCT)$@$(LANGUAGE).exe
  153. !else
  154. wu:
  155. @echo Cab File for Windows Update won't be created since the flag is not specified.
  156. !endif
  157. exe: $(THINGSTODO)
  158. -$(MAKE) SEDFILE=$O\$(PRODUCT)$(LANGUAGE).sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\$(PRODUCT)$(LANGUAGE).exe
  159. opk: $(THINGSTODO)
  160. -$(MAKE) SEDFILE=$O\$(PRODUCT)$@.sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\$(PRODUCT)$@.exe
  161. !if "$(BUILD_BDACAB)"!=""
  162. bda: $(THINGSTODO)
  163. -$(MAKE) SEDFILE=$O\$(PRODUCT)$@$(LANGUAGE).sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\$(PRODUCT)$@$(LANGUAGE).exe Opt=W/BDA
  164. !else
  165. bda:
  166. @echo RunTime cab file with BDA won't be created since the flag is not specified.
  167. !endif
  168. !endif
  169. core: $(THINGSTODO)
  170. -$(MAKE) SEDFILE=$O\dxnt.sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\dxnt.cab
  171. !if ("$(LANGUAGE)"=="multi" || "$(LANGUAGE)"=="eng" || "$(NTDEBUG)"=="" || "$(NTDEBUG)"=="ntsdnodbg") && "$(KEEP_CAT)"==""
  172. cat: $(CATFILE)
  173. !else
  174. cat:
  175. !endif
  176. .SUFFIXES: .sed .ddf
  177. {$O}.sed{$O}.exe:
  178. # this set is to support multi-proc machines diamond doesn't do the right thing
  179. set TMP=$O
  180. $(IEXPRESS_CMD)
  181. $(SIGNIT_CMD)
  182. $(BINPLACE_CMD)
  183. {$O}.sed{$O}.cab:
  184. # this set is to support multi-proc machines diamond doesn't do the right thing
  185. set TMP=$O
  186. $(IEXPRESS_CMD)
  187. !if "$(CABTYPE)"=="core" && "$(LANGUAGE)"!="multi"
  188. @echo $(CABNAME) cabpack\$(LANGUAGE)>$(O)\placefil.txt
  189. binplace -R $(_NTTREE) -S $(_NTTREE)\Symbols -n $(_NTTREE)\Symbols.pri -j -P $(O)\placefil.txt -xa $(O)\$(CABNAME)
  190. !else
  191. $(BINPLACE_CMD)
  192. !endif
  193. !if ("$(SEDFILE)"!="")
  194. $(CABCACHEFLAGS):{$(DEPENDENCY_PATHS)}$(@F:.flg=) $(PRODUCTTD_FILE)
  195. set DXROOT=$(DXROOT)
  196. $(PERLLOC) $(CACHEMGR_SCR) $(REDISTFILELIST) $(@:.flg=) $@ "$(PRODUCTTDSTAMP)" $(MYNTTREE) $(LANGUAGE) $(LOCALIZEDROOT)
  197. $(SEDFILE) : $(MASTERSEDFILE) $(SEDGEN_SCR) $(LISTTXT) $(CABCACHEFLAGS)
  198. set DXROOT=$(DXROOT)
  199. $(SEDGEN_CMD)
  200. !endif
  201. TouchedTargetSupport: $(DEPENDENCYPATHS_FILE) $(CABCACHEFLAGS_FILE)
  202. if not exist $(CABCACHEROOT) md $(CABCACHEROOT) 1>nul
  203. @for /f "tokens=1 skip=1" %a in ($(CABCACHEFLAGS_FILE)) do @if not exist %~dpa md %~dpa 1>nul
  204. $(DEPENDENCYPATHS_FILE):$(DEPENDENCYLIST_FILE) $(DEPENDENCYPATHS_SCR)
  205. $(PERLLOC) $(DEPENDENCYPATHS_SCR) $(DEPENDENCYLIST_FILE) $(DEPENDENCYPATHS_FILE)
  206. $(CABCACHEFLAGS_FILE):$(DEPENDENCYLIST_FILE)
  207. @prompt $$S
  208. set DXROOT=$(DXROOT)
  209. echo CABCACHEFLAGS=\>$(CABCACHEFLAGS_FILE)
  210. echo s/$(MYNTTREE_ESC)/$(CABCACHEROOT_ESC)/> $(O)\chnttree.sed
  211. echo s/$(MYALTNTTREE_ESC)/$(CABCACHEROOT_ESC)/>> $(O)\chnttree.sed
  212. # @for /f "skip=1" %a in ($(DEPENDENCYLIST_FILE)) do echo %a.flg \|$(SEDLOC) -e "s/$(MYNTTREE_ESC)/$(CABCACHEROOT_ESC)/">>$(CABCACHEFLAGS_FILE)
  213. @for /f "skip=1" %a in ($(DEPENDENCYLIST_FILE)) do echo %a.flg \|$(SEDLOC) -f $(O)\chnttree.sed >>$(CABCACHEFLAGS_FILE)
  214. GetCurrentTimeDate:
  215. !if ("$(PRODUCTTD)"=="")
  216. for /f "tokens=2-8 delims=/:. " %a in ("%DATE% %TIME%") do echo PRODUCTTDSTAMP=%c %a %b %d %e %f>$(PRODUCTTD_FILE)
  217. !else
  218. echo PRODUCTTDSTAMP=$(PRODUCTTD)>$(PRODUCTTD_FILE)
  219. !endif
  220. BuildDependencyList:
  221. set DXROOT=$(DXROOT)
  222. $(DEPGEN_CMD)
  223. $(CDFFILE): $(REDISTFILELIST)
  224. set DXROOT=$(DXROOT)
  225. $(CDF_CMD)
  226. $(CATFILE): $(CDFFILE)
  227. makecat -n -v $(CDFFILE)
  228. copy $@ $@.unsigned
  229. setreg -q 1 TRUE
  230. !MESSAGE WARNING This is a test signature... Real signature required before release...
  231. signcode -sha1 $(NT_CERTHASH) -n "$(DESCRIPTION)" -i "$(DXWEBPAGE)" -t http://timestamp.verisign.com/scripts/timstamp.dll $@
  232. chktrust -q $@ | ..\..\tools\sed -e "/Succeeded/!d" -e "s/\(.*\): \(.*\)/\.\.\\\.\.\\tools\\touch -c \1.\2/" > $(O)\chkcat.cmd
  233. -del $@.Succeeded > NUL 2>&1
  234. call $(O)\chkcat.cmd
  235. if not exist $@.Succeeded echo nmake : CATALOG SINING ERROR! : failed to sign $@
  236. @echo $(@F) DXCAT\$(LANGUAGE)>$(O)\placefil.txt
  237. $(BINPLACE_CMD)
  238. DelChkCat:
  239. -del $(CHKCAT) > NUL 2>&1
  240. GetVersionInfo: $(VERSIONINFO)
  241. $(LISTTXT): $(CABROOT_TARGET)\makefile.inc
  242. $(BUILDGENMSG) $(MAKEDIR)\$@
  243. echo $(CABNAME), $(DESCRIPTION), $(DXWEBPAGE)>$@
  244. $(MASTERSEDFILE): $(CABROOT_TARGET)\makefile.inc $(VERSIONINFO)
  245. $(BUILDGENMSG) $(MAKEDIR)\$@
  246. !include $(CABROOT_TARGET)\master.sed
  247. @if not exist $@ @echo nmake : error GENSED : failed to make $@s
  248. $(VERSIONINFO): $(DXROOT)\inc\verinfo.h
  249. $(BUILDGENMSG) $(MAKEDIR)\$@
  250. type <<$(O)\version.rc
  251. #define RC_INVOKED
  252. #ifdef WINNT
  253. #include <windows.h>
  254. #include <ntverp.h>
  255. #define VER_FILETYPE VFT_DLL
  256. #define VER_FILESUBTYPE VFT2_UNKNOWN
  257. #define VER_FILEDESCRIPTION_STR "Garbage"
  258. #define VER_INTERNALNAME_STR VER_FILEDESCRIPTION_STR
  259. #define VER_ORIGINALFILENAME_STR "Garbage"
  260. #include "common.ver"
  261. #else // win95
  262. #include "verinfo.h"
  263. #define VERSIONNAME "Garbage\0"
  264. #define VERSIONDESCRIPTION "Garbage\0"
  265. #define VERSIONTYPE VFT_DLL
  266. #define VERSIONSUBTYPE VFT2_UNKNOWN
  267. #include "verinfo.ver"
  268. #endif
  269. <<KEEP
  270. type <<$(RSPFILE)
  271. /nologo /DWINNT /I$(DXROOT)\inc /I$(BASEDIR)\public\sdk\inc /E /Fc /Tc$(O)\version.rc
  272. <<KEEP
  273. -for /f "tokens=2* delims== " %a in ('cl @$(RSPFILE) ^| findstr "ProductVersion LegalCopyright ProductName" ^|$(SEDLOC) -e "s/\"[ ][ ]*\"//g" -e "s/,[ ][ ]*/=/" -e ') do echo %~a=%~b>>$@