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.

379 lines
12 KiB

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