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.

307 lines
9.9 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)\Whistler
  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\DX8NT51
  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)\nt51redist.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)
  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)" == "opk")
  109. CABNAME=$(PRODUCT)$(CABTYPE).exe
  110. AppLaunched=$(SETUPAPP) /silent
  111. FRIENDLYDESCRIPTION=OPK
  112. !else if ("$(CABTYPE)" == "core")
  113. CABNAME=dxnt51.cab
  114. !else
  115. !error nmake : error CABTYPE : unknown cabtype $(CABTYPE)
  116. !endif //CABTYPE
  117. TargetName=$O\$(CABNAME)
  118. FileVersion=$(ProductVersion)
  119. CompanyName=Microsoft Corporation
  120. FileDescription=DirectX cabpack for $(LANGUAGE)
  121. InternalName=$(SETUPAPP)
  122. OriginalFilename=$(InternalName)
  123. SourceFiles0=$(CABCACHEROOT)
  124. !endif //SEDFILE
  125. DESCRIPTION=DirectX $(PRODUCT) $(FRIENDLYDESCRIPTION)
  126. LISTTXT=$O\list.txt.$(CABTYPE)
  127. #PRIVATEKEY=$(BASEDIR)\public\tools\driver.pvk
  128. #CERTIFICATE=$(BASEDIR)\public\tools\driver.spc
  129. PRIVATEKEY=$(BASEDIR)\tools\driver.pvk
  130. CERTIFICATE=$(BASEDIR)\tools\driver.spc
  131. DXWEBPAGE=http://www.microsoft.com/DirectX
  132. SIGNIT_CMD=@echo Build_Status Test Signing - $@
  133. SIGNIT_CMD=$(SIGNIT_CMD) & signcode -sha1 $(NT_CERTHASH) -n "$(DESCRIPTION)" -i "$(DXWEBPAGE)" $@
  134. wu: $(THINGSTODO)
  135. -$(MAKE) SEDFILE=$O\$(PRODUCT)$@$(LANGUAGE).sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\$(PRODUCT)$@$(LANGUAGE).exe
  136. exe: $(THINGSTODO)
  137. -$(MAKE) SEDFILE=$O\$(PRODUCT)$(LANGUAGE).sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\$(PRODUCT)$(LANGUAGE).exe
  138. opk: $(THINGSTODO)
  139. -$(MAKE) SEDFILE=$O\$(PRODUCT)$@.sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\$(PRODUCT)$@.exe
  140. core: $(THINGSTODO)
  141. -$(MAKE) SEDFILE=$O\dxnt51.sed CABTYPE=$@ PRODUCTTD="$(PRODUCTTDSTAMP)" ALT_PROJECT_TARGET=. $O\dxnt51.cab
  142. cat: $(CATFILE)
  143. .SUFFIXES: .sed .ddf
  144. {$O}.sed{$O}.exe:
  145. # this set is to support multi-proc machines diamond doesn't do the right thing
  146. set TMP=$O
  147. $(IEXPRESS_CMD)
  148. $(SIGNIT_CMD)
  149. $(BINPLACE_CMD)
  150. {$O}.sed{$O}.cab:
  151. # this set is to support multi-proc machines diamond doesn't do the right thing
  152. set TMP=$O
  153. $(IEXPRESS_CMD)
  154. $(BINPLACE_CMD)
  155. !if ("$(SEDFILE)"!="")
  156. $(CABCACHEFLAGS):{$(DEPENDENCY_PATHS)}$(@F:.flg=) $(PRODUCTTD_FILE)
  157. set DXROOT=$(DXROOT)
  158. $(PERLLOC) $(CACHEMGR_SCR) $(REDISTFILELIST) $(@:.flg=) $@ "$(PRODUCTTDSTAMP)" $(MYNTTREE) $(LANGUAGE) $(LOCALIZEDROOT)
  159. $(SEDFILE) : $(MASTERSEDFILE) $(SEDGEN_SCR) $(LISTTXT) $(CABCACHEFLAGS)
  160. set DXROOT=$(DXROOT)
  161. $(SEDGEN_CMD)
  162. !endif
  163. TouchedTargetSupport: $(DEPENDENCYPATHS_FILE) $(CABCACHEFLAGS_FILE)
  164. if not exist $(CABCACHEROOT) md $(CABCACHEROOT) 1>nul
  165. @for /f "tokens=1 skip=1" %a in ($(CABCACHEFLAGS_FILE)) do @if not exist %~dpa md %~dpa 1>nul
  166. $(DEPENDENCYPATHS_FILE):$(DEPENDENCYLIST_FILE) $(DEPENDENCYPATHS_SCR)
  167. $(PERLLOC) $(DEPENDENCYPATHS_SCR) $(DEPENDENCYLIST_FILE) $(DEPENDENCYPATHS_FILE)
  168. $(CABCACHEFLAGS_FILE):$(DEPENDENCYLIST_FILE)
  169. @prompt $$S
  170. set DXROOT=$(DXROOT)
  171. echo CABCACHEFLAGS=\>$(CABCACHEFLAGS_FILE)
  172. echo s/$(MYNTTREE_ESC)/$(CABCACHEROOT_ESC)/> $(O)\chnttree.sed
  173. echo s/$(MYALTNTTREE_ESC)/$(CABCACHEROOT_ESC)/>> $(O)\chnttree.sed
  174. # @for /f "skip=1" %a in ($(DEPENDENCYLIST_FILE)) do echo %a.flg \|$(SEDLOC) -e "s/$(MYNTTREE_ESC)/$(CABCACHEROOT_ESC)/">>$(CABCACHEFLAGS_FILE)
  175. @for /f "skip=1" %a in ($(DEPENDENCYLIST_FILE)) do echo %a.flg \|$(SEDLOC) -f $(O)\chnttree.sed >>$(CABCACHEFLAGS_FILE)
  176. GetCurrentTimeDate:
  177. !if ("$(PRODUCTTD)"=="")
  178. for /f "tokens=2-8 delims=/:. " %a in ("%DATE% %TIME%") do echo PRODUCTTDSTAMP=%c %a %b %d %e %f>$(PRODUCTTD_FILE)
  179. !else
  180. echo PRODUCTTDSTAMP=$(PRODUCTTD)>$(PRODUCTTD_FILE)
  181. !endif
  182. BuildDependencyList:
  183. set DXROOT=$(DXROOT)
  184. $(DEPGEN_CMD)
  185. $(CDFFILE): $(REDISTFILELIST)
  186. set DXROOT=$(DXROOT)
  187. $(CDF_CMD)
  188. $(CATFILE): $(CDFFILE)
  189. makecat -n -v $(CDFFILE)
  190. copy $@ $@.unsigned
  191. setreg -q 1 TRUE
  192. !MESSAGE WARNING This is a test signature... Real signature required before release...
  193. signcode -sha1 $(NT_CERTHASH) -n "$(DESCRIPTION)" -i "$(DXWEBPAGE)" -t http://timestamp.verisign.com/scripts/timstamp.dll $@
  194. chktrust -q $@ | ..\..\tools\sed -e "/Succeeded/!d" -e "s/\(.*\): \(.*\)/\.\.\\\.\.\\tools\\touch -c \1.\2/" > $(O)\chkcat.cmd
  195. -del $@.Succeeded > NUL 2>&1
  196. call $(O)\chkcat.cmd
  197. if not exist $@.Succeeded echo nmake : CATALOG SINING ERROR! : failed to sign $@
  198. @echo $(@F) DXCAT>$(O)\placefil.txt
  199. $(BINPLACE_CMD)
  200. DelChkCat:
  201. -del $(CHKCAT) > NUL 2>&1
  202. GetVersionInfo: $(VERSIONINFO)
  203. $(LISTTXT): $(CABROOT_TARGET)\makefile.inc
  204. $(BUILDGENMSG) $(MAKEDIR)\$@
  205. echo $(CABNAME), $(DESCRIPTION), $(DXWEBPAGE)>$@
  206. $(MASTERSEDFILE): $(CABROOT_TARGET)\makefile.inc $(VERSIONINFO)
  207. $(BUILDGENMSG) $(MAKEDIR)\$@
  208. !include $(CABROOT_TARGET)\master.sed
  209. @if not exist $@ @echo nmake : error GENSED : failed to make $@s
  210. $(VERSIONINFO): $(DXROOT)\inc\verinfo.h
  211. $(BUILDGENMSG) $(MAKEDIR)\$@
  212. type <<$(O)\version.rc
  213. #define RC_INVOKED
  214. #ifdef WINNT
  215. #include <windows.h>
  216. #include <ntverp.h>
  217. #define VER_FILETYPE VFT_DLL
  218. #define VER_FILESUBTYPE VFT2_UNKNOWN
  219. #define VER_FILEDESCRIPTION_STR "Garbage"
  220. #define VER_INTERNALNAME_STR VER_FILEDESCRIPTION_STR
  221. #define VER_ORIGINALFILENAME_STR "Garbage"
  222. #include "common.ver"
  223. #else // win95
  224. #include "verinfo.h"
  225. #define VERSIONNAME "Garbage\0"
  226. #define VERSIONDESCRIPTION "Garbage\0"
  227. #define VERSIONTYPE VFT_DLL
  228. #define VERSIONSUBTYPE VFT2_UNKNOWN
  229. #include "verinfo.ver"
  230. #endif
  231. <<KEEP
  232. type <<$(RSPFILE)
  233. /nologo /DWINNT /I$(DXROOT)\inc /I$(BASEDIR)\public\sdk\inc /E /Fc /Tc$(O)\version.rc
  234. <<KEEP
  235. -for /f "tokens=2* delims== " %a in ('cl @$(RSPFILE) ^| findstr "ProductVersion LegalCopyright ProductName" ^|$(SEDLOC) -e "s/\"[ ][ ]*\"//g" -e "s/,[ ][ ]*/=/" -e ') do echo %~a=%~b>>$@