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.

345 lines
9.4 KiB

  1. # Perl script for creating and maintaining MsftEdit makefiles
  2. ###
  3. # Main script
  4. ###
  5. &build_makefile();
  6. sub build_makefile {
  7. open(MAKEFILE, ">makefile");
  8. print MAKEFILE <<"EOT"
  9. # NT build environment
  10. # Allow for customization through a decoration file
  11. !IFDEF NTMAKEENV
  12. !include \$(NTMAKEENV)\\makefile.def
  13. !ENDIF
  14. !IF EXIST("makefile.cfg")
  15. !INCLUDE "makefile.cfg"
  16. !ENDIF
  17. # The following builds are supported
  18. !IF "\$(BUILD)" == ""
  19. BUILD=w32_x86_dbg
  20. !MESSAGE No Build specified. Defaulting to w32_x86_dbg
  21. !ENDIF
  22. !IF "\$(ODIR)" == ""
  23. ODIR = .\\
  24. !MESSAGE No output directory specified. Defaulting to current directory
  25. !ENDIF
  26. TOMINC=tom
  27. DLLBASENAME=msftedit
  28. DEFFILENAME=msftedit
  29. !IF "\$(BUILD)" == "w32_x86_dbg"
  30. DEFFILENAME=msfteditd
  31. INCLUDE = \$(INCLUDE)
  32. CFLAGS = -DDEBUG -Od
  33. CFLAGS = \$(CFLAGS) -DWIN32 -D_WINDOWS -D_X86_ -DWINNT
  34. CFLAGS = \$(CFLAGS) -Gz -Gm -Zi
  35. LFLAGS =
  36. LFLAGS = \$(LFLAGS) ..\\lib\\x86\\msls31.lib delayimp.lib -delayload:msls31.dll
  37. LFLAGS = \$(LFLAGS) ..\\lib\\x86\\usp10.lib -delayload:usp10.dll -delay:unload
  38. LFLAGS = \$(LFLAGS) kernel32.lib
  39. LFLAGS = \$(LFLAGS) advapi32.lib
  40. LFLAGS = \$(LFLAGS) gdi32.lib
  41. LFLAGS = \$(LFLAGS) user32.lib
  42. LFLAGS = /entry:DllMain\@12 /debug /base:0x48000000 \$(LFLAGS)
  43. CPP = cl \$(CFLAGS)
  44. CL = cl \$(CFLAGS)
  45. RCFLAGS= \$(USERRCFLAGS) -dINCLUDETLB -dDEBUG
  46. LINKER = link
  47. CHKSTK = ..\\lib\\x86\\chkstk.obj
  48. FTOL = ..\\lib\\x86\\ftol.obj
  49. MEMMOVE = ..\\lib\\x86\\memmove.obj
  50. MEMSET = ..\\lib\\x86\\memset.obj
  51. MEMCMP = ..\\lib\\x86\\memcmp.obj
  52. MEMCPY = ..\\lib\\x86\\memcpy.obj
  53. STRLEN = ..\\lib\\x86\\strlen.obj
  54. !ELSEIF "\$(BUILD)" == "w32_x86_shp"
  55. INCLUDE = \$(INCLUDE)
  56. CFLAGS = -O1 \$(USERDEFS)
  57. CFLAGS = \$(CFLAGS) -DWIN32 -D_WINDOWS -D_X86_ -DWINNT
  58. CFLAGS = \$(CFLAGS) -GFz
  59. LFLAGS =
  60. LFLAGS = \$(LFLAGS) ..\\lib\\x86\\msls31.lib delayimp.lib -delayload:msls31.dll
  61. LFLAGS = \$(LFLAGS) ..\\lib\\x86\\usp10.lib -delayload:usp10.dll -delay:unload
  62. LFLAGS = \$(LFLAGS) kernel32.lib
  63. LFLAGS = \$(LFLAGS) advapi32.lib
  64. LFLAGS = \$(LFLAGS) gdi32.lib
  65. LFLAGS = \$(LFLAGS) user32.lib
  66. LFLAGS = /opt:ref /incremental:no /entry:DllMain\@12 /base:0x48000000 \$(LFLAGS)
  67. CPP = cl \$(CFLAGS)
  68. CL = cl \$(CFLAGS)
  69. LINKER = link
  70. RCFLAGS= \$(USERRCFLAGS) -dINCLUDETLB
  71. CHKSTK = ..\\lib\\x86\\chkstk.obj
  72. FTOL = ..\\lib\\x86\\ftol.obj
  73. MEMMOVE = ..\\lib\\x86\\memmove.obj
  74. MEMSET = ..\\lib\\x86\\memset.obj
  75. MEMCMP = ..\\lib\\x86\\memcmp.obj
  76. MEMCPY = ..\\lib\\x86\\memcpy.obj
  77. STRLEN = ..\\lib\\x86\\strlen.obj
  78. !ELSEIF "\$(BUILD)" == "w64_IA64_dbg"
  79. !MESSAGE Building 64 bit version in debug flavor
  80. CFLAGS = -DDEBUG -Od
  81. CFLAGS = \$(CFLAGS) -DWIN64 -D_WINDOWS -D_IA64_ -DWINNT
  82. CFLAGS = \$(CFLAGS) -Gz -Gm -Zi
  83. LFLAGS =
  84. LFLAGS = \$(LFLAGS) ..\\win64lib\\msls31.lib delayload.lib -delayload:msls31.dll
  85. LFLAGS = \$(LFLAGS) ..\\win64lib\\usp10.lib -delayload:usp10.dll -delay:unload
  86. LFLAGS = \$(LFLAGS) kernel32.lib
  87. LFLAGS = \$(LFLAGS) advapi32.lib
  88. LFLAGS = \$(LFLAGS) gdi32.lib
  89. LFLAGS = \$(LFLAGS) user32.lib
  90. LFLAGS = \$(LFLAGS) libcmt.lib
  91. LFLAGS = /entry:_DllMainCRTStartup -machine:ia64 \$(LFLAGS)
  92. LFLAGS = \$(LFLAGS) /DEBUG
  93. CPP = cl \$(CFLAGS)
  94. CL = cl \$(CFLAGS)
  95. RCFLAGS= \$(USERRCFLAGS) -dINCLUDETLB -dDEBUG -d_WIN64
  96. LINKER = link
  97. !ELSEIF "\$(BUILD)" == "wce_cepc_dbg"
  98. TOMINC=tomce
  99. DLLBASENAME=ebriched
  100. PATH = \\msdev\\wce\\bin;\$(PATH)
  101. PATH = \\Program^ Files\\DevStudio\\wce\\bin;\$(PATH)
  102. INCLUDE = ..\\wceinc
  103. CFLAGS = -DDEBUG -Od -Z7
  104. CFLAGS = \$(CFLAGS) -DWIN32 -D_WINDOWS -DUNDER_CE -DEBOOK_CE
  105. CFLAGS = \$(CFLAGS) -D_X86_ -Dx86
  106. CPP = cl386 \$(CFLAGS)
  107. CL = cl386 \$(CFLAGS)
  108. LIB = ..\\wcelib\\x86
  109. LINKER = link
  110. LFLAGS = \$(LFLAGS) msls31.lib coredll.lib corelibc.lib oleaut32.lib
  111. LFLAGS = -nodefaultlib -subsystem:windowsce,2.12 -entry:_DllMainCRTStartup /debug:full /debugtype:cv -machine:x86 -ignore:4078 \$(LFLAGS)
  112. !ELSEIF "\$(BUILD)" == "wce_cepc_shp"
  113. TOMINC=tomce
  114. DLLBASENAME=ebriched
  115. PATH = \\msdev\\wce\\bin;\$(PATH)
  116. PATH = \\Program^ Files\\DevStudio\\wce\\bin;\$(PATH)
  117. INCLUDE = ..\\wceinc
  118. CFLAGS = -O1 \$(USERDEFS)
  119. CFLAGS = \$(CFLAGS) -DWIN32 -D_WINDOWS -DUNDER_CE -DEBOOK_CE
  120. CFLAGS = \$(CFLAGS) -D_X86_ -Dx86
  121. CFLAGS = \$(CFLAGS) -GFz
  122. CPP = cl386 \$(CFLAGS)
  123. CL = cl386 \$(CFLAGS)
  124. LINKER = link
  125. LIB = ..\\wcelib\\x86
  126. LFLAGS = \$(LFLAGS) msls31.lib coredll.lib corelibc.lib oleaut32.lib
  127. LFLAGS = -opt:ref -nodefaultlib -subsystem:windowsce,2.12 -entry:_DllMainCRTStartup -machine:x86 -ignore:4078 \$(LFLAGS)
  128. !ELSE
  129. !ERROR \$(BUILD) Unknown Build. Need to learn this one.
  130. !ENDIF
  131. INCLUDE = .;..\\inc;..\\lsinc;..\\\$(TOMINC);\$(INCLUDE)
  132. CFLAGS = \$(USERCFLAGS) \$(CFLAGS) -DUNICODE -nologo
  133. CFLAGS = \$(CFLAGS) -Zl -W4 -Ob1 -FR -GX-
  134. CFLAGS = \$(CFLAGS) -YX_common.h
  135. LFLAGS = \$(USERLFLAGS) \$(LFLAGS) /nologo
  136. LFLAGS = /implib:msftedit.lib /def:\$(DEFFILENAME).def /ignore:4078 /map /NODEFAULTLIB:uuid.lib \$(LFLAGS)
  137. LFLAGS = /dll /out:\$(ODIR)\\\$(DLLBASENAME).dll \$(LFLAGS)
  138. .c\{\$(ODIR)\}.obj:
  139. cl \$(CFLAGS) /c -Fo\$\@ \$\<
  140. .cpp\{\$(ODIR)\}.obj:
  141. cl \$(CFLAGS) /c -Fo\$\@ \$\<
  142. all: _version.h all1
  143. all1: \$(ODIR)\\w32sys.obj \\
  144. \$(ODIR)\\utilmem.obj \\
  145. \$(ODIR)\\dxfrobj.obj \\
  146. \$(ODIR)\\tomsel.obj \\
  147. \$(ODIR)\\dispml.obj \\
  148. \$(ODIR)\\doc.obj \\
  149. \$(ODIR)\\rtflex.obj \\
  150. \$(ODIR)\\render.obj \\
  151. \$(ODIR)\\dispprt.obj \\
  152. \$(ODIR)\\measure.obj \\
  153. \$(ODIR)\\util.obj \\
  154. \$(ODIR)\\host.obj \\
  155. \$(ODIR)\\select.obj \\
  156. \$(ODIR)\\callmgr.obj \\
  157. \$(ODIR)\\dfreeze.obj \\
  158. \$(ODIR)\\rtext.obj \\
  159. \$(ODIR)\\rtfwrit.obj \\
  160. \$(ODIR)\\propchg.obj \\
  161. \$(ODIR)\\m_undo.obj \\
  162. \$(ODIR)\\rtfwrit2.obj \\
  163. \$(ODIR)\\clasifyc.obj \\
  164. \$(ODIR)\\cmsgflt.obj \\
  165. \$(ODIR)\\ime.obj \\
  166. \$(ODIR)\\magellan.obj \\
  167. \$(ODIR)\\layout.obj \\
  168. \$(ODIR)\\text.obj \\
  169. \$(ODIR)\\runptr.obj \\
  170. \$(ODIR)\\disp.obj \\
  171. \$(ODIR)\\format.obj \\
  172. \$(ODIR)\\antievt.obj \\
  173. \$(ODIR)\\reinit.obj \\
  174. \$(ODIR)\\objmgr.obj \\
  175. \$(ODIR)\\ldte.obj \\
  176. \$(ODIR)\\rtfread2.obj \\
  177. \$(ODIR)\\dragdrp.obj \\
  178. \$(ODIR)\\urlsup.obj \\
  179. \$(ODIR)\\CFPF.obj \\
  180. \$(ODIR)\\uuid.obj \\
  181. \$(ODIR)\\frunptr.obj \\
  182. \$(ODIR)\\edit.obj \\
  183. \$(ODIR)\\line.obj \\
  184. \$(ODIR)\\TOMFMT.obj \\
  185. \$(ODIR)\\dispsl.obj \\
  186. \$(ODIR)\\coleobj.obj \\
  187. \$(ODIR)\\object.obj \\
  188. \$(ODIR)\\osdc.obj \\
  189. \$(ODIR)\\tomrange.obj \\
  190. \$(ODIR)\\notmgr.obj \\
  191. \$(ODIR)\\font.obj \\
  192. \$(ODIR)\\HASH.obj \\
  193. \$(ODIR)\\hyph.obj \\
  194. \$(ODIR)\\rtfread.obj \\
  195. \$(ODIR)\\lbhost.obj \\
  196. \$(ODIR)\\cbhost.obj \\
  197. \$(ODIR)\\devdsc.obj \\
  198. \$(ODIR)\\debug.obj \\
  199. \$(ODIR)\\range.obj \\
  200. \$(ODIR)\\array.obj \\
  201. \$(ODIR)\\TOMDOC.obj \\
  202. \$(ODIR)\\textserv.obj \\
  203. \$(ODIR)\\kern.obj \\
  204. \$(ODIR)\\ols.obj \\
  205. \$(ODIR)\\olsole.obj \\
  206. \$(ODIR)\\uspi.obj \\
  207. \$(ODIR)\\txtbrk.obj \\
  208. \$(ODIR)\\iaccess.obj \\
  209. \$(ODIR)\\cuim.obj \\
  210. \$(ODIR)\\textnot.obj \\
  211. \$(CHKSTK) \\
  212. \$(FTOL) \\
  213. \$(MEMMOVE) \\
  214. \$(MEMSET) \\
  215. \$(MEMCMP) \\
  216. \$(MEMCPY) \\
  217. \$(STRLEN)
  218. rc \$(RCFLAGS) msftedit.rc
  219. \$(LINKER) \$(LFLAGS) \$\*\* msftedit.res
  220. bscmake /omsftedit.bsc /nologo \*.sbr
  221. _version.h: msftedit.rc
  222. perl version.pl <msftedit.rc >_version.h
  223. clean:
  224. -del msftedit.dll
  225. -del *.lib
  226. -del *.obj
  227. -del *.sbr
  228. -del *.pch
  229. -del *.pdb
  230. -del *.idb
  231. -del *.ilk
  232. EOT
  233. ;
  234. close (MAKEFILE);
  235. $ENV{'include'} = '.;..\inc;..\..\tom';
  236. $cppfiles = "antievt.cpp ";
  237. $cppfiles .= "array.cpp ";
  238. $cppfiles .= "callmgr.cpp ";
  239. $cppfiles .= "cfpf.cpp ";
  240. $cppfiles .= "clasifyc.cpp ";
  241. $cppfiles .= "cmsgflt.cpp ";
  242. $cppfiles .= "coleobj.cpp ";
  243. $cppfiles .= "debug.cpp ";
  244. $cppfiles .= "devdsc.cpp ";
  245. $cppfiles .= "dfreeze.cpp ";
  246. $cppfiles .= "disp.cpp ";
  247. $cppfiles .= "dispml.cpp ";
  248. $cppfiles .= "dispprt.cpp ";
  249. $cppfiles .= "dispsl.cpp ";
  250. $cppfiles .= "doc.cpp ";
  251. $cppfiles .= "dragdrp.cpp ";
  252. $cppfiles .= "dxfrobj.cpp ";
  253. $cppfiles .= "edit.cpp ";
  254. $cppfiles .= "font.cpp ";
  255. $cppfiles .= "format.cpp ";
  256. $cppfiles .= "frunptr.cpp ";
  257. $cppfiles .= "hash.cpp ";
  258. $cppfiles .= "host.cpp ";
  259. $cppfiles .= "ime.cpp ";
  260. $cppfiles .= "ldte.cpp ";
  261. $cppfiles .= "layout.cpp ";
  262. $cppfiles .= "line.cpp ";
  263. $cppfiles .= "m_undo.cpp ";
  264. $cppfiles .= "magellan.cpp ";
  265. $cppfiles .= "measure.cpp ";
  266. $cppfiles .= "notmgr.cpp ";
  267. $cppfiles .= "object.cpp ";
  268. $cppfiles .= "objmgr.cpp ";
  269. $cppfiles .= "osdc.cpp ";
  270. $cppfiles .= "propchg.cpp ";
  271. $cppfiles .= "range.cpp ";
  272. $cppfiles .= "reinit.cpp ";
  273. $cppfiles .= "render.cpp ";
  274. $cppfiles .= "rtext.cpp ";
  275. $cppfiles .= "rtflex.cpp ";
  276. $cppfiles .= "rtflog.cpp ";
  277. $cppfiles .= "rtfread.cpp ";
  278. $cppfiles .= "rtfread2.cpp ";
  279. $cppfiles .= "rtfwrit.cpp ";
  280. $cppfiles .= "rtfwrit2.cpp ";
  281. $cppfiles .= "runptr.cpp ";
  282. $cppfiles .= "select.cpp ";
  283. $cppfiles .= "text.cpp ";
  284. $cppfiles .= "textserv.cpp ";
  285. $cppfiles .= "tokens.cpp ";
  286. $cppfiles .= "tomdoc.cpp ";
  287. $cppfiles .= "tomfmt.cpp ";
  288. $cppfiles .= "tomrange.cpp ";
  289. $cppfiles .= "tomsel.cpp ";
  290. $cppfiles .= "urlsup.cpp ";
  291. $cppfiles .= "util.cpp ";
  292. $cppfiles .= "uuid.cpp ";
  293. $cppfiles .= "ols.cpp ";
  294. $cppfiles .= "olsobj.cpp ";
  295. $cppfiles .= "kern.cpp ";
  296. $cppfiles .= "hyph.cpp ";
  297. $cppfiles .= "lbhost.cpp ";
  298. $cppfiles .= "cbhost.cpp ";
  299. $cppfiles .= "uspi.cpp ";
  300. $cppfiles .= "txtbrk.cpp ";
  301. $cppfiles .= "iaccess.cpp ";
  302. $cppfiles .= "w32sys.cpp ";
  303. $cppfiles .= "w32win32.cpp ";
  304. $cppfiles .= "w32wince.cpp ";
  305. $cppfiles .= "utilmem.cpp ";
  306. $cppfiles .= "cuim.cpp ";
  307. $cppfiles .= "textnot.cpp ";
  308. print $cppfiles;
  309. system ("mkdep -n -s .obj $cppfiles >> makefile");
  310. }