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.

643 lines
26 KiB

  1. {
  2. if (NR == 1)
  3. homedir = $0
  4. if (NR == 2)
  5. exename = $0
  6. if (NR == 3)
  7. exetype = $0
  8. if (NR == 4)
  9. maketgt = $0
  10. if (NR == 5)
  11. makeflags = $0
  12. if (NR == 6)
  13. cleantgt = $0
  14. if (NR == 7)
  15. objdir = $0
  16. if (NR == 8)
  17. owner = $0
  18. if (NR == 9)
  19. depdirN = split($0,depdirs," ")
  20. if (NR == 10)
  21. makedep = $0
  22. if (NR == 11)
  23. {
  24. desc = $0
  25. depth = split(homedir,tmp,"\\")-2
  26. printf " @echo on\n"
  27. printf " @for %%%%x in (Y y) do if (%%bldQuiet%%) == (%%%%x) echo off\n"
  28. printf "\nREM\n"
  29. printf "REM _tgtType_ _objType_ Build Batch File\n"
  30. printf "REM\n"
  31. printf "REM Target component: %s.%s\n",exename,exetype
  32. printf "REM Description: %s\n",desc
  33. printf "REM Home directory: %s\n",homedir
  34. printf "REM Object directory: %s\n",objdir
  35. printf "REM Dependent directories: %s\n",depdirs[1]
  36. for (i=2 ; i<=depdirN ; i++)
  37. printf "REM %s\n",depdirs[i]
  38. printf "REM Nmake target(s): %s\n",maketgt
  39. printf "REM Nmake flag(s): %s\n",makeflags
  40. printf "REM Depends.mak flag: %s\n",makedep
  41. printf "REM Nmake clean target(s): %s\n",cleantgt
  42. printf "REM Owner: %s\n",owner
  43. printf "REM\n\n"
  44. printf "\nREM\n"
  45. printf "REM Set some local environment strings\n"
  46. printf "REM\n\n"
  47. printf " cd | sed \"s/^../set tgtHomeDir=/\" > homedir.bat\n"
  48. printf " call homedir.bat\n"
  49. printf " del homedir.bat\n"
  50. printf " set tgtObjDir=%s\n",objdir
  51. printf " set tgtTarget=%s.%s\n",exename,exetype
  52. printf " set tgtComponent=%%tgtObjDir%%\\%%tgtTarget%%\n"
  53. printf " set tgtFullname=%%tgtHomeDir%%\\%%tgtObjDir%%\\%%tgtTarget%%\n"
  54. printf " set tgtDesc=%s\n",desc
  55. printf " set tgtOwner=%s\n",owner
  56. printf " set tgtClean=\n"
  57. printf " set tgtCmdLine=\n"
  58. printf " set tgtN=1\n"
  59. printf " set passedTarget=\n"
  60. printf "\n:parse\n"
  61. printf " if (%%1) == () goto parseX\n"
  62. printf " set tgtCmdLine=%%tgtCmdLine%% %%1\n"
  63. printf " for %%%%x in (CLEAN Clean clean) do if (%%1) == (%%%%x) goto prsClean\n"
  64. printf " if (%%1) == (1) goto prs1\n"
  65. printf " if (%%1) == (2) goto prs2\n"
  66. printf " if (%%1) == (3) goto prs3\n"
  67. printf " if (%%1) == (4) goto prs4\n"
  68. printf " if (%%1) == (5) goto prs5\n"
  69. printf " if (%%1) == (6) goto prs6\n"
  70. printf " if (%%1) == (7) goto prs7\n"
  71. printf " if (%%1) == (8) goto prs8\n"
  72. printf " if (%%1) == (9) goto prs9\n"
  73. printf " set passedTarget=%1\n"
  74. printf " goto prsShift\n"
  75. printf "\n:prs1\n"
  76. printf " set tgtN=1\n"
  77. printf " goto prsShift\n"
  78. printf ":prs2\n"
  79. printf " set tgtN=2\n"
  80. printf " goto prsShift\n"
  81. printf ":prs3\n"
  82. printf " set tgtN=3\n"
  83. printf " goto prsShift\n"
  84. printf ":prs4\n"
  85. printf " set tgtN=4\n"
  86. printf " goto prsShift\n"
  87. printf ":prs5\n"
  88. printf " set tgtN=5\n"
  89. printf " goto prsShift\n"
  90. printf ":prs6\n"
  91. printf " set tgtN=6\n"
  92. printf " goto prsShift\n"
  93. printf ":prs7\n"
  94. printf " set tgtN=7\n"
  95. printf " goto prsShift\n"
  96. printf ":prs8\n"
  97. printf " set tgtN=8\n"
  98. printf " goto prsShift\n"
  99. printf ":prs9\n"
  100. printf " set tgtN=9\n"
  101. printf " goto prsShift\n"
  102. printf ":prsClean\n"
  103. printf " set tgtClean=clean\n"
  104. printf " goto prsShift\n"
  105. printf "\n:prsShift\n"
  106. printf " shift\n"
  107. printf " goto parse\n"
  108. printf ":parseX\n"
  109. printf "\n echo.\n"
  110. printf " echo (_tgtType__objType_%%tgtN%%) *** Building %%tgtFullname%% \n"
  111. printf " echo.\n"
  112. printf "\nREM\n"
  113. printf "REM Check our target with the passed target (if any)\n"
  114. printf "REM\n\n"
  115. printf " if (%%passedTarget%%) == () goto continue\n"
  116. printf " if (%%passedTarget%%) == (%%tgtTarget%%) goto continue\n"
  117. printf " goto exit\n"
  118. printf "\n:continue\n"
  119. printf "\nREM\n"
  120. printf "REM Show the BLD environment variables if desired\n"
  121. printf "REM\n\n"
  122. printf " for %%%%x in (Y y) do if (%%bldShow%%) == (%%%%x) goto BLDenv\n"
  123. printf " goto BLDenvX\n"
  124. printf "\n:BLDenv\n"
  125. printf " echo (_tgtType__objType_%%tgtN%%) *** Global BLD environment variables: \n"
  126. printf " set | %%myGrep%% -y \"^bld\" | sort\n"
  127. printf " echo.\n"
  128. printf ":BLDenvX\n"
  129. printf "\nREM\n"
  130. printf "REM Show the TGT environment variables if desired\n"
  131. printf "REM\n\n"
  132. printf " for %%%%x in (Y y) do if (%%tgtShow%%) == (%%%%x) goto TGTenv\n"
  133. printf " goto TGTenvX\n"
  134. printf "\n:TGTenv\n"
  135. printf " echo (_tgtType__objType_%%tgtN%%) *** Local TGT environment variables: \n"
  136. printf " set | %%myGrep%% -y \"^tgt\" | sort\n"
  137. printf " echo.\n"
  138. printf ":TGTenvX\n"
  139. printf "\nREM\n"
  140. printf "REM Time stamp the build log out file\n"
  141. printf "REM\n\n"
  142. printf " echotime /t \"*** Build of this component started ***\" > _tgtType__objType_%%tgtN%%.log\n"
  143. printf " echo.>> _tgtType__objType_%%tgtN%%.log\n"
  144. printf " echo Target component: %s.%s >> _tgtType__objType_%%tgtN%%.log\n",exename,exetype
  145. printf " echo Description: %s >> _tgtType__objType_%%tgtN%%.log\n",desc
  146. printf " echo Home directory: %%tgtHomeDir%% >> _tgtType__objType_%%tgtN%%.log\n"
  147. printf " echo Object directory: %%tgtObjDir%% >> _tgtType__objType_%%tgtN%%.log\n"
  148. printf " echo Dependent directories: %s >> _tgtType__objType_%%tgtN%%.log\n",depdirs[1]
  149. for (i=2 ; i<=depdirN ; i++)
  150. printf " echo %s >> _tgtType__objType_%%tgtN%%.log\n",depdirs[i]
  151. printf " echo Nmake target(s): %s >> _tgtType__objType_%%tgtN%%.log\n",maketgt
  152. printf " echo Nmake flag(s): %s >> _tgtType__objType_%%tgtN%%.log\n",makeflags
  153. printf " echo Depends.mak flag: %s >> _tgtType__objType_%%tgtN%%.log\n",makedep
  154. printf " echo Nmake clean target(s): %s >> _tgtType__objType_%%tgtN%%.log\n",cleantgt
  155. printf " echo Owner: %s >> _tgtType__objType_%%tgtN%%.log\n",owner
  156. printf " echo.>> _tgtType__objType_%%tgtN%%.log\n"
  157. printf "\n if (%%bldLogFile%%) == () goto log1X\n"
  158. printf " for %%%%x in (Y y) do if (%%bldLogging%%) == (%%%%x) goto log1\n"
  159. printf " goto log1X\n"
  160. printf "\n:log1\n"
  161. printf " echotime /t \"%%tgtFullName%% - Started\" >> %%bldLogFile%%\n"
  162. printf ":log1X\n"
  163. printf "\nREM\n"
  164. printf "REM Call any pre-nmake batch file\n"
  165. printf "REM\n\n"
  166. printf " cd %%tgtHomedir%%\n"
  167. printf " if exist _tgtType__objType_%%tgtN%%1.bat goto preBat\n"
  168. printf " goto preBatX\n"
  169. printf "\n:preBat\n"
  170. printf " echo (_tgtType__objType_%%tgtN%%) *** Calling _tgtType__objType_%%tgtN%%1.bat... \n"
  171. printf " if exist _tgtType__objType_%%tgtN%%1.out del _tgtType__objType_%%tgtN%%1.out\n"
  172. printf " call _tgtType__objType_%%tgtN%%1.bat %%tgtClean%%\n"
  173. printf " echo (_tgtType__objType_%%tgtN%%) *** Back from _tgtType__objType_%%tgtN%%1.bat \n"
  174. printf ":preBatX\n"
  175. if (makedep ~ /[Yy]/ || makedep ~ /[Zz]/)
  176. {
  177. printf "\nREM\n"
  178. printf "REM Create depends.mak if flag is on\n"
  179. printf "REM\n\n"
  180. printf " for %%%%x in (Y y) do if (%%bldMakeDep%%) == (%%%%x) goto makeDep\n"
  181. printf " for %%%%x in (Z z) do if (%%bldMakeDep%%) == (%%%%x) goto zeroDep\n"
  182. printf " goto makeDepX\n"
  183. printf "\n:zeroDep\n"
  184. printf " attrib -r depends.mak\n"
  185. printf " echo.>depends.mak\n"
  186. printf " attrib +r depends.mak\n"
  187. printf " goto makeDepX\n"
  188. printf "\n:makeDep\n"
  189. printf " if exist makefile goto makeDep1\n"
  190. printf " if exist makefile.dos goto makeDep2\n"
  191. printf " goto makeDepX\n"
  192. printf ":makeDep1\n"
  193. printf " %%myGrep%% -y depends.mak makefile > nul\n"
  194. printf " if errorlevel 1 goto makeDepX\n"
  195. printf " goto makeDep3\n"
  196. printf ":makeDep2\n"
  197. printf " %%myGrep%% -y depends.mak makefile.dos > nul\n"
  198. printf " if errorlevel 1 goto makeDepX\n"
  199. printf " goto makeDep3\n"
  200. printf ":makeDep3\n"
  201. printf " echo (_tgtType__objType_%%tgtN%%) *** Creating depends.mak ... \n"
  202. printf " if exist depends.mak attrib -r depends.mak\n"
  203. printf " echo.> depends.mak\n"
  204. if (maketgt == "")
  205. printf " nmake /NOLOGO depends\n"
  206. else if (maketgt == ".")
  207. printf "REM nmake /NOLOGO %s depends\n",makeflags
  208. else
  209. printf " nmake /NOLOGO %s depends\n",makeflags
  210. printf " attrib +r depends.mak\n"
  211. printf ":makeDepX\n"
  212. }
  213. printf "\nREM\n"
  214. printf "REM Make sure the object dir exists\n"
  215. printf "REM\n\n"
  216. printf " md %%tgtObjDir%%\n"
  217. printf "\nREM\n"
  218. printf "REM Clean up any previous error or warning files\n"
  219. printf "REM\n\n"
  220. printf " if exist _tgtType__objType_%%tgtN%%.err del _tgtType__objType_%%tgtN%%.err > nul\n"
  221. printf " if exist _tgtType__objType_%%tgtN%%.wrn del _tgtType__objType_%%tgtN%%.wrn > nul\n"
  222. printf " if exist dirs.out del dirs.out > nul\n"
  223. printf " if exist _tgtType__objType_%%tgtN%%.out del _tgtType__objType_%%tgtN%%.out > nul\n"
  224. printf " if exist status.out del status.out > nul\n"
  225. if (exename != "." && exename != "")
  226. {
  227. printf " if exist %%bldDir%%\\errwrn\\_tgtType__objType_.wrn\\%s.%s del %%bldDir%%\\errwrn\\_tgtType__objType_.wrn\\%s.%s\n",exename,exetype,exename,exetype
  228. printf " if exist %%bldDir%%\\errwrn\\_tgtType__objType_.wrn\\%s.txt del %%bldDir%%\\errwrn\\_tgtType__objType_.wrn\\%s.txt\n",exename,exename
  229. printf " if exist %%bldDir%%\\errwrn\\_tgtType__objType_.err\\%s.%s del %%bldDir%%\\errwrn\\_tgtType__objType_.err\\%s.%s\n",exename,exetype,exename,exetype
  230. printf " if exist %%bldDir%%\\errwrn\\_tgtType__objType_.err\\%s.txt del %%bldDir%%\\errwrn\\_tgtType__objType_.err\\%s.txt\n",exename,exename
  231. }
  232. printf "\nREM\n"
  233. printf "REM Delete RES file(s) if we are forcing version stamping\n"
  234. printf "REM\n\n"
  235. printf " for %%%%x in (Y y) do if (%%bldMark%%) == (%%%%x) goto markIt\n"
  236. printf " goto markItX\n"
  237. printf "\n:markIt\n"
  238. if (exename != "." && exename != "")
  239. printf " if exist %%tgtObjDir%%\\%s.res del %%tgtObjDir%%\\%s.res > nul\n", exename,exename
  240. printf " if exist %%tgtObjDir%%\\*.res del %%tgtObjDir%%\\*.res > nul\n"
  241. if (exename != "." && exename != "")
  242. printf " if exist %s.res del %s.res > nul\n", \
  243. exename,exename
  244. printf ":markItX\n"
  245. printf "\nREM\n"
  246. printf "REM Always restore the approprate version.h for this environment (_tgtType_)\n"
  247. printf "REM\n\n"
  248. printf " if exist "
  249. for (i=1 ; i<=depth ; i++) printf "..\\"
  250. printf "ifaxdev\\h\\_tgtType_.ver "
  251. printf "copy /v "
  252. for (i=1 ; i<=depth ; i++) printf "..\\"
  253. printf "ifaxdev\\h\\_tgtType_.ver "
  254. for (i=1 ; i<=depth ; i++) printf "..\\"
  255. printf "ifaxdev\\h\\version.h > nul\n"
  256. printf "\nREM\n"
  257. printf "REM Determine if we should build from clean\n"
  258. printf "REM\n\n"
  259. printf " for %%%%x in (Y y) do if (%%bldClean%%) == (%%%%x) goto clean\n"
  260. printf " for %%%%x in (CLEAN Clean clean) do if (%%tgtClean%%) == (%%%%x) goto clean\n"
  261. printf " goto cleanX\n"
  262. printf "\n:clean\n"
  263. printf " echo (_tgtType__objType_%%tgtN%%) *** Cleaning...\n"
  264. printf " if exist *.cod del *.cod\n"
  265. printf " if exist *.pch del *.pch\n"
  266. printf " for %%%%x in (Y y) do if (%%bldMakeOut%%) == (%%%%x) goto cleanOut\n"
  267. if (cleantgt ~ /[Dd][ee][Ll][Oo][Bb][Jj][Dd][Ii][Rr]/)
  268. {
  269. if (objdir != "." && objdir != "")
  270. {
  271. printf " deltree /y %s\n",objdir
  272. printf " if exist %s\\*.* goto chkERR\n", objdir
  273. printf " md %s\n",objdir
  274. }
  275. else
  276. printf " del %s.%s\n",exename,exetype
  277. }
  278. else if (cleantgt != "" && cleantgt != ".")
  279. printf " nmake /X - /NOLOGO %s %s\n",makeflags,cleantgt
  280. else
  281. printf "REM nmake /X - /NOLOGO %s %s\n",makeflags,cleantgt
  282. printf " goto cleanX\n"
  283. printf ":cleanOut\n"
  284. printf " echotime /t \"*** nmake clean Output ***\" >> _tgtType__objType_%%tgtN%%.out\n"
  285. if (cleantgt ~ /[Dd][ee][Ll][Oo][Bb][Jj][Dd][Ii][Rr]/)
  286. {
  287. if (objdir != "." && objdir != "")
  288. {
  289. printf " echo Deleting directory: %s >> _tgtType__objType_%%tgtN%%.out\n",objdir
  290. printf " deltree /y %s\n",objdir
  291. printf " if exist %s\\*.* goto chkERR\n", objdir
  292. printf " md %s\n",objdir
  293. }
  294. else
  295. {
  296. printf " echo Deleting: %s.%s >> _tgtType__objType_%%tgtN%%.out\n",exename,exetype
  297. printf " del %s.%s\n",exename,exetype
  298. }
  299. }
  300. else if (cleantgt != "" && cleantgt != ".")
  301. printf " nmake /X - /NOLOGO %s %s >> _tgtType__objType_%%tgtN%%.out\n",makeflags,cleantgt
  302. else
  303. printf "REM nmake /X - /NOLOGO %s %s >> _tgtType__objType_%%tgtN%%.out\n",makeflags,cleantgt
  304. printf ":cleanX\n"
  305. printf "\nREM\n"
  306. printf "REM Main Nmake routine\n"
  307. printf "REM\n\n"
  308. printf " cd %%tgtHomedir%%\n"
  309. printf "\n:make\n"
  310. printf " echo (_tgtType__objType_%%tgtN%%) *** Making...\n"
  311. printf " for %%%%x in (Y y) do if (%%bldMakeOut%%) == (%%%%x) goto makeOut\n"
  312. if (maketgt == "")
  313. printf " nmake /X - /NOLOGO %s\n",makeflags
  314. else if (maketgt == ".")
  315. printf "REM nmake /X - /NOLOGO %s %s\n",makeflags,maketgt
  316. else
  317. printf " nmake /X - /NOLOGO %s %s\n",makeflags,maketgt
  318. printf " REM bell 50 200 300 400\n"
  319. printf " %%bldComponentDoneSound%%\n"
  320. printf " cd %%tgtHomedir%%\n"
  321. printf " goto makeX\n"
  322. printf ":makeOut\n"
  323. printf " echotime /t \"*** nmake build Output ***\" >> _tgtType__objType_%%tgtN%%.out\n"
  324. if (maketgt == "")
  325. printf " nmake /X - /NOLOGO %s >> _tgtType__objType_%%tgtN%%.out\n", makeflags
  326. else if (maketgt == ".")
  327. printf "REM nmake /X - /NOLOGO %s %s >> _tgtType__objType_%%tgtN%%.out\n", makeflags,maketgt
  328. else
  329. printf " nmake /X - /NOLOGO %s %s >> _tgtType__objType_%%tgtN%%.out\n", makeflags,maketgt
  330. printf " REM bell 50 200 300 400\n"
  331. printf " %%bldComponentDoneSound%%\n"
  332. printf " cd %%tgtHomedir%%\n"
  333. printf " if exist _tgtType__objType_%%tgtN%%1.out type _tgtType__objType_%%tgtN%%1.out >> _tgtType__objType_%%tgtN%%.out\n"
  334. printf " type _tgtType__objType_%%tgtN%%.out\n"
  335. printf ":makeX\n"
  336. printf "\nREM\n"
  337. printf "REM Save a snapshot of SLM status, source and obj dirs\n"
  338. printf "REM\n\n"
  339. printf " echo.> status.out\n"
  340. printf " for %%%%x in (Y y) do if (%%bldSlmStatus%%) == (%%%%x) goto slmStat\n"
  341. printf " goto slmStatX\n"
  342. printf "\n:slmStat\n"
  343. printf " if not exist slm.ini goto slmStatX\n"
  344. printf " echo (_tgtType__objType_%%tgtN%%) *** Generating SLM Status output... \n"
  345. printf " echotime /t \"*** SLM status -xrv ***\" > status.out\n"
  346. printf " status -xrvf >> status.out\n"
  347. printf ":slmStatX\n"
  348. printf "\n echotime /t \"*** Source directory snapshot ***\" > dirs.out\n"
  349. printf " dir /oen >> dirs.out\n"
  350. printf "\n echotime /t \"*** Object directory snapshot ***\" >> dirs.out\n"
  351. printf " dir /oen %%tgtObjDir%% >> dirs.out\n"
  352. printf "\nREM\n"
  353. printf "REM Check for and mail warnings if desired\n"
  354. printf "REM\n\n"
  355. printf " for %%%%x in (Y y) do if (%%bldMailWrn%%) == (%%%%x) goto chkWrn\n"
  356. printf " goto chkWrnX\n"
  357. printf "\n:chkWrn\n"
  358. printf " echo (_tgtType__objType_%%tgtN%%) *** Checking for warnings... \n"
  359. printf " echo .\n"
  360. printf " call checkwrn.bat _tgtType__objType_%%tgtN%%.out\n"
  361. printf " echo \n"
  362. printf " if not exist wrn.out goto chkWrnX\n"
  363. printf " ren wrn.out _tgtType__objType_%%tgtN%%.wrn\n"
  364. if (exename != "." && exename != "")
  365. printf " copy /v _tgtType__objType_%%tgtN%%.wrn %%bldDir%%\\errwrn\\_tgtType__objType_.wrn\\%s.txt\n",exename
  366. printf ":chkWrnX\n"
  367. printf "\nREM\n"
  368. printf "REM Check for and mail errors if desired\n"
  369. printf "REM (Always check the make out file)\n"
  370. printf "REM\n\n"
  371. printf " set tgtErrStatus=\n"
  372. printf " for %%%%x in (Y y) do if (%%bldMailErr%%) == (%%%%x) goto chkErr\n"
  373. printf " for %%%%x in (Y y) do if (%%bldMakeOut%%) == (%%%%x) goto chkErr\n"
  374. printf " goto chkErrX\n"
  375. printf "\n:chkErr\n"
  376. printf " echo (_tgtType__objType_%%tgtN%%) *** Checking for errors... \n"
  377. if (exename != "." && exename != "")
  378. {
  379. printf " if not exist %%tgtObjDir%%\\%s.%s echo ERROR: cannot find %%tgtObjDir%%\\%s.%s >> _tgtType__objType_%%tgtN%%.out\n",exename,exetype,exename,exetype
  380. }
  381. printf " set tgtErrStatus=Clean\n"
  382. printf " echo .\n"
  383. printf " call checkerr.bat _tgtType__objType_%%tgtN%%.out\n"
  384. printf " echo \n"
  385. printf " if not exist err.out goto chkErrX\n"
  386. printf " set tgtErrStatus=Errors\n"
  387. printf " ren err.out _tgtType__objType_%%tgtN%%.err\n"
  388. if (exename != "." && exename != "")
  389. {
  390. printf " copy /v _tgtType__objType_%%tgtN%%.err %%bldDir%%\\errwrn\\_tgtType__objType_.err\\%s.txt\n",exename
  391. n = split(owner,a," ")
  392. for (i=1 ; i<=n ; i++)
  393. printf " echotime /t \"_tgtType__objType_ %%tgtFullName%%\" >> %%bldDir%%\\errwrn\\bldbreak\\%s\n",a[i]
  394. }
  395. printf ":chkErrX\n"
  396. printf "\nREM\n"
  397. printf "REM Consolidate .out files and log them\n"
  398. printf "REM\n\n"
  399. printf " if exist _tgtType__objType_%%tgtN%%.out type _tgtType__objType_%%tgtN%%.out >> _tgtType__objType_%%tgtN%%.log\n"
  400. printf " type status.out >> _tgtType__objType_%%tgtN%%.log\n"
  401. printf " type dirs.out >> _tgtType__objType_%%tgtN%%.log\n"
  402. printf " if exist _tgtType__objType_%%tgtN%%.err type _tgtType__objType_%%tgtN%%.err >> _tgtType__objType_%%tgtN%%.log\n"
  403. printf " if exist _tgtType__objType_%%tgtN%%.wrn type _tgtType__objType_%%tgtN%%.wrn >> _tgtType__objType_%%tgtN%%.log\n"
  404. printf "\nREM\n"
  405. printf "REM Archive log file\n"
  406. printf "REM\n\n"
  407. printf " for %%%%x in (Y y) do if (%%bldLogArchive%%) == (%%%%x) goto logArc\n"
  408. printf " for %%%%x in (Y y) do if (%%tgtLogArchive%%) == (%%%%x) goto logArc\n"
  409. printf " goto logArcX\n"
  410. printf "\n:logArc\n"
  411. printf " if exist _tgtType__objType_%%tgtN%%.log type _tgtType__objType_%%tgtN%%.log >> _tgtType__objType_%%tgtN%%.arc\n"
  412. printf ":logArcX\n"
  413. printf "\nREM\n"
  414. printf "REM Copy objs to release point if desired and if no errors\n"
  415. printf "REM\n\n"
  416. printf " for %%%%x in (N n) do if (%%tgtRelease%%) == (%%%%x) goto releaseX\n"
  417. printf " for %%%%x in (Y y) do if (%%bldRelease%%) == (%%%%x) goto release\n"
  418. printf " goto releaseX\n"
  419. printf "\n:release\n"
  420. printf " if exist _tgtType__objType_%%tgtN%%.err goto releaseX\n"
  421. printf " if (%%_objType_RelDir%%) == () goto releaseX\n"
  422. if (exename != "." && exename != "")
  423. {
  424. printf " echo (_tgtType__objType_%%tgtN%%) *** Releasing %%tgtObjDir%%\\%s.%s to %%_objType_RelDir%% \n",\
  425. exename,exetype
  426. printf " if exist %%tgtObjDir%%\\%s.%s echo %%tgtObjDir%%\\%s.%s\n",exename,exetype,exename,exetype
  427. printf " if exist %%tgtObjDir%%\\%s.%s copy /v %%tgtObjDir%%\\%s.%s %%_objType_RelDir%% \n", exename,exetype,exename,exetype
  428. printf " if errorlevel 0 goto rel1OK\n"
  429. printf " goto release\n"
  430. printf ":rel1OK\n"
  431. printf " if exist %%tgtObjDir%%\\%s.map echo %%tgtObjDir%%\\%s.map\n", exename,exename
  432. printf " if exist %%tgtObjDir%%\\%s.map copy /v %%tgtObjDir%%\\%s.map %%_objType_RelDir%%\n ", exename,exename
  433. printf " if errorlevel 0 goto rel2OK\n"
  434. printf " goto release\n"
  435. printf ":rel2OK\n"
  436. printf " if exist %%tgtObjDir%%\\%s.sym echo %%tgtObjDir%%\\%s.sym\n", exename,exename
  437. printf " if exist %%tgtObjDir%%\\%s.sym copy /v %%tgtObjDir%%\\%s.sym %%_objType_RelDir%%\n", exename,exename
  438. printf " if errorlevel 0 goto rel3OK\n"
  439. printf " goto release\n"
  440. printf ":rel3OK\n"
  441. printf " if exist _tgtType__objType_%%tgtN%%.log echo _tgtType__objType_%%tgtN%%.log\n"
  442. printf " if exist _tgtType__objType_%%tgtN%%.log copy /v _tgtType__objType_%%tgtN%%.log %%_objType_RelDir%%\\%s.log\n", exename
  443. printf " if errorlevel 0 goto rel4OK\n"
  444. printf " goto release\n"
  445. printf ":rel4OK\n"
  446. }
  447. printf " if exist %%tgtObjDir%%\\*.hlp echo %%tgtObjDir%%\\*.hlp\n"
  448. printf " if exist %%tgtObjDir%%\\*.hlp copy /v %%tgtObjDir%%\\*.hlp %%_objType_RelDir%%\n"
  449. printf " if errorlevel 0 goto rel5OK\n"
  450. printf " goto release\n"
  451. printf ":rel5OK\n"
  452. printf " if exist help\\*.hlp echo help\\*.hlp\n"
  453. printf " if exist help\\*.hlp copy /v help\\*.hlp %%_objType_RelDir%%\n"
  454. printf " if errorlevel 0 goto rel6OK\n"
  455. printf " goto release\n"
  456. printf ":rel6OK\n"
  457. printf " if exist *.hlp echo *.hlp\n"
  458. printf " if exist *.hlp copy /v *.hlp %%_objType_RelDir%%\n"
  459. printf " if errorlevel 0 goto rel7OK\n"
  460. printf " goto release\n"
  461. printf ":rel7OK\n"
  462. printf ":releaseX\n"
  463. printf "\nREM\n"
  464. printf "REM We're done.\n"
  465. printf "REM\n"
  466. printf "REM Clean up by expunging deleted files\n"
  467. printf "REM and unsetting environment strings.\n"
  468. printf "REM\n\n"
  469. printf ":done\n"
  470. printf " exp /r > nul\n"
  471. printf " REM if not (%%setrel%%) == () call unsetrel.bat\n"
  472. printf "\nREM\n"
  473. printf "REM Call any post-nmake batch file\n"
  474. printf "REM\n\n"
  475. printf " cd %%tgtHomedir%%\n"
  476. printf " if exist _tgtType__objType_%%tgtN%%2.bat goto postBat\n"
  477. printf " goto postBatX\n"
  478. printf "\n:postBat\n"
  479. printf " echo (_tgtType__objType_%%tgtN%%) *** Calling _tgtType__objType_%%tgtN%%2.bat... \n"
  480. printf " if exist _tgtType__objType_%%tgtN%%2.out del _tgtType__objType_%%tgtN%%2.out\n"
  481. printf " call _tgtType__objType_%%tgtN%%2.bat %%tgtClean%%\n"
  482. printf " echo (_tgtType__objType_%%tgtN%%) *** Back from _tgtType__objType_%%tgtN%%2.bat \n"
  483. printf " if exist _tgtType__objType_%%tgtN%%2.out type _tgtType__objType_%%tgtN%%2.out\n"
  484. printf " if exist _tgtType__objType_%%tgtN%%2.out type _tgtType__objType_%%tgtN%%2.out >> _tgtType__objType_%%tgtN%%.out\n"
  485. printf ":postBatX\n"
  486. printf "\n echo.\n"
  487. printf " echo (_tgtType__objType_%%tgtN%%) *** Done Building %%tgtFullname%% \n"
  488. printf " echo.\n"
  489. printf "\n if (%%bldLogFile%%) == () goto log2X\n"
  490. printf " for %%%%x in (Y y) do if (%%bldLogging%%) == (%%%%x) goto log2\n"
  491. printf " goto log2X\n"
  492. printf "\n:log2\n"
  493. printf " echotime /t \"%%tgtFullName%% - Done (%%tgtErrStatus%%)\" >> %%bldLogFile%%\n"
  494. printf ":log2X\n"
  495. printf "\nREM\n"
  496. printf "REM Clean up left-over .out files\n"
  497. printf "REM\n\n"
  498. printf " if (%%tgtObjDir%%) == () goto codCopyX\n"
  499. printf " if exist *.cod goto codCopy\n"
  500. printf " goto codCopyX\n"
  501. printf ":codCopy\n"
  502. printf " copy /v *.cod %%tgtObjDir%%\n"
  503. printf " del *.cod\n"
  504. printf ":codCopyX\n"
  505. printf "\n if exist dirs.out del dirs.out\n"
  506. printf " if exist err.out del err.out\n"
  507. printf " if exist nmake.out del nmake.out\n"
  508. printf " if exist status.out del status.out\n"
  509. printf " if exist wrn.out del wrn.out\n"
  510. printf "\n:exit\n"
  511. printf "\nREM\n"
  512. printf "REM Clean up environment\n"
  513. printf "REM\n\n"
  514. printf " set passedTarget=\n"
  515. printf " set tgtComponent=\n"
  516. printf " set tgtTarget=\n"
  517. printf " set tgtErrStatus=\n"
  518. printf " set tgtFullname=\n"
  519. printf " set tgtHomeDir=\n"
  520. printf " set tgtObjDir=\n"
  521. printf " set tgtOwner=\n"
  522. printf " set tgtClean=\n"
  523. printf " set tgtCmdLine=\n"
  524. printf " set tgtDesc=\n"
  525. printf " set tgtN=\n"
  526. printf " set tgtRelease=\n"
  527. }
  528. }