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.

450 lines
8.5 KiB

  1. # Clear out any pre-existing suffixes
  2. .SUFFIXES:
  3. # Setup defaults for target directories
  4. PBIN =$(ROOT)\mciavi32\vfw16\$(DEBUG)
  5. PLIB =$(ROOT)\mciavi32\vfw16\$(DEBUG)\lib.16
  6. PINC =$(ROOT)\mciavi32\vfw16\$(DEBUG)\inc.16
  7. PVER =$(ROOT)\verinfo.16
  8. !ifndef OS
  9. OS =i386
  10. !endif
  11. # Ensure that environment variables are present
  12. !if [set PATH=;]
  13. !endif
  14. !if [set INCLUDE=;]
  15. !endif
  16. !if [set LIB=;]
  17. !endif
  18. PATH=;
  19. INCLUDE=;
  20. LIB=;
  21. # Ensure ROOT is defined and set tools directories
  22. !ifndef ROOT
  23. !error "ROOT" environment variable not defined for "$(NAME)".
  24. !endif
  25. DEVROOT =$(ROOT)\bin.16
  26. # Ensure that the project has been defined
  27. !ifndef PROJECT
  28. PROJECT =MTN
  29. !else
  30. !if "$(PROJECT)" == "acm" || "$(PROJECT)" == "ACM"
  31. PROJECT =ACM
  32. !else
  33. !if "$(PROJECT)" == "motown" || "$(PROJECT)" == "MOTOWN" || "$(PROJECT)" == "Motown" || "$(PROJECT)" == "mtn" || "$(PROJECT)" == "MTN" || "$(PROJECT)" == "Mtn"
  34. PROJECT =MTN
  35. !else
  36. !if "$(PROJECT)" == "vfw" || "$(PROJECT)" == "VFW" || "$(PROJECT)" == "VfW"
  37. PROJECT =VFW
  38. !else
  39. !error Unknown project defined by the "PROJECT" variable: $(PROJECT)
  40. !endif
  41. !endif
  42. !endif
  43. !endif
  44. ######## Tool/include paths error checking #######
  45. !ifdef IS_OEM
  46. !ifdef IS_PRIVATE
  47. !error IS_PRIVATE with IS_OEM is redundant
  48. !endif # IS_PRIVATE
  49. !ifdef IS_SDK
  50. !error IS_SDK with IS_OEM is redundant
  51. !endif # IS_SDK
  52. !ifdef IS_DDK
  53. !error IS_DDK with IS_OEM is redundant
  54. !endif # IS_DDK
  55. !endif # IS_OEM
  56. !ifdef IS_16
  57. !ifdef IS_32
  58. !error Can't define IS_16 with IS_32
  59. !endif # IS_32
  60. !ifdef WANT_16
  61. !error WANT_16 with IS_16 is redundant
  62. !endif # WANT_16
  63. !endif # IS_16
  64. !ifdef IS_32
  65. !ifdef IS_16
  66. !error Can't define IS_32 with IS_16
  67. !endif # IS_16
  68. !ifdef WANT_32
  69. !error WANT_32 with IS_32 is redundant
  70. !endif # WANT_32
  71. !ifdef WANT_286
  72. !error Can't define WANT_286 with IS_32
  73. !endif # WANT_286
  74. !endif # IS_32
  75. ############### Tool/include paths ###############
  76. !ifdef IS_OEM
  77. IS_PRIVATE =TRUE
  78. IS_SDK =TRUE
  79. IS_DDK =TRUE
  80. !endif # IS_OEM
  81. PATH =$(DEVROOT)
  82. INCLUDE =$(ROOT)\inc.16
  83. LIB =$(ROOT)\lib.16
  84. # Get rid of the ";;" at the begining of these variables
  85. # just in case one of our tools croaks on it.
  86. PATH =$(PATH:;;=)
  87. LIB =$(LIB:;;=)
  88. INCLUDE =$(INCLUDE:;;=)
  89. ########## Definitions for the Assembler ##########
  90. !ifdef IS_16
  91. AFLAGS =$(AFLAGS) -DIS_16
  92. !else
  93. AFLAGS =$(AFLAGS) -DIS_32
  94. !endif
  95. !ifdef MASM6
  96. ASM =mlx
  97. !ifdef NOLOGO
  98. ASM =$(ASM) -nologo
  99. !endif # ifdef NOLOGO
  100. !ifdef CODE
  101. AFLAGS =$(AFLAGS) -Fl$(@B)
  102. !endif # ifdef CODE
  103. AFLAGS =$(AFLAGS) -W3 -WX -Zd -c -Cx -DMASM6
  104. !else
  105. ASM =masm
  106. !ifdef CODE
  107. AFLAGS =$(AFLAGS) -l
  108. !endif # ifdef CODE
  109. AFLAGS =$(AFLAGS) -t -W2 -Zd -Mx
  110. !endif
  111. ########## Definitions for C compiler #############
  112. CL =cl
  113. !ifdef IS_16
  114. CFLAGS =$(CFLAGS) -W3 -WX -Zdp -Gs -c -DIS_16 -D$(PROJECT)
  115. !ifndef WANT_C816NOT
  116. CFLAGS =$(CFLAGS) -Z7
  117. !endif # WANT_C816NOT
  118. !ifdef WANT_286
  119. CFLAGS =$(CFLAGS) -G2
  120. !else
  121. CFLAGS =$(CFLAGS) -G3
  122. !endif # WANT_286
  123. !else # ifdef IS_16
  124. CFLAGS =$(CFLAGS) -W3 -WX -Zp -Fd$(@B) -Gs -c -DIS_32 -D$(PROJECT)
  125. !if "$(DEBUG)" == "internal"
  126. CFLAGS =$(CFLAGS) -Zi
  127. !endif
  128. !endif # ifdef IS_16 ... else
  129. !ifdef CODE
  130. CFLAGS =$(CFLAGS) -Fc$(@B)
  131. !endif # ifdef CODE
  132. !ifdef NOLOGO
  133. CL =$(CL) -nologo
  134. !endif # ifdef NOLOGO
  135. ########## Definitions for VxD linker #################
  136. !ifndef DEVICEEXT
  137. DEVICEEXT=vxd
  138. !endif
  139. LINK =link386
  140. !ifdef NOLOGO
  141. LINK =$(LINK) /NOLOGO
  142. !endif
  143. LFLAGS =$(LFLAGS) /L /MAP /NOI /NOD /NOPACKCODE /NOE
  144. ########## Definitions for 16 bit linker #################
  145. LINK16 =link
  146. !ifdef NOLOGO
  147. LINK16 =$(LINK16) /NOLOGO
  148. !endif
  149. L16FLAGS=$(L16FLAGS) /MAP /NOPACKCODE /NOE /NOD
  150. !ifndef NOMAPLINES
  151. L16FLAGS=$(L16FLAGS) /L
  152. !endif
  153. ########## Definitions for 32 bit linker #################
  154. #ifdef WANT_C932LINK
  155. LINK32 =$(DEVROOT)\tools\c932\bin\link -link
  156. #else
  157. LINK32 =link -link
  158. #endif
  159. !ifdef NOLOGO
  160. LINK32 =$(LINK32) -nologo
  161. !endif
  162. L32FLAGS=$(L32FLAGS) -nodefaultlib -align:0x1000
  163. !ifdef FIXEDLINK
  164. L32FLAGS=$(L32FLAGS) -fixed
  165. !endif
  166. ########## Definitions for generic linker #################
  167. #!ifdef IS_16
  168. #LINK =$(LINK16)
  169. #!else
  170. #LINK =$(LINK32)
  171. #!endif
  172. ########## Definitions for rc #####################
  173. RC =rc
  174. RCFLAGS =$(RCFLAGS) -r -D$(PROJECT)
  175. !ifdef IS_16
  176. RCFLAGS =$(RCFLAGS) -dIS_16
  177. !else
  178. RCFLAGS =$(RCFLAGS) -dIS_32
  179. !endif
  180. RESFLAGS=$(RESFLAGS) -t
  181. !if "$(PROJECT)" != "MTN"
  182. RESFLAGS=$(RESFLAGS) -31
  183. !endif
  184. RESONEXE=resonexe
  185. ########## Definitions library manager ############
  186. !ifndef LB
  187. !if "$(IS_32)" != "" && "$(IS_DDK)" != ""
  188. LB =$(DEVROOT)\tools\c816\bin\lib
  189. !else
  190. LB =lib
  191. !endif
  192. !endif
  193. !ifdef NOLOGO
  194. LB =$(LB) /nologo
  195. !endif
  196. LBFLAGS =$(LBFLAGS)
  197. ########## Definitions for mapsym #################
  198. MAPSYM =mapsym
  199. !ifdef NOLOGO
  200. MAPSYM =$(MAPSYM) -nologo
  201. !endif
  202. MFLAGS =$(MFLAGS) -s
  203. ########## Goals ###############################
  204. goal: $(GOALS)
  205. @echo ***** Finished making $(DEBUG) $(NAME) *****
  206. ########## Suffixes ###############################
  207. {}.exe{$(PBIN)}.exe:
  208. copy $(@F) $@
  209. {}.vbx{$(PBIN)}.vbx:
  210. copy $(@F) $@
  211. {}.dll{$(PBIN)}.dll:
  212. copy $(@F) $@
  213. {}.mmh {$(PBIN)}.mmh:
  214. copy $(@F) $@
  215. {}.drv{$(PBIN)}.drv:
  216. copy $(@F) $@
  217. {}.386{$(PBIN)}.386:
  218. copy $(@F) $@
  219. {}.vxd{$(PBIN)}.vxd:
  220. copy $(@F) $@
  221. {}.cpl{$(PBIN)}.cpl:
  222. copy $(@F) $@
  223. {..\..}.reg{$(PBIN)}.reg:
  224. copy ..\..\$(@F) $@
  225. {..\..}.h{$(PINC)}.h:
  226. copy ..\..\$(@F) $@
  227. {..\..}.hxx{$(PINC)}.hxx:
  228. copy ..\..\$(@F) $@
  229. {..\..}.inc{$(PINC)}.inc:
  230. copy ..\..\$(@F) $@
  231. {}.lib{$(PLIB)}.lib:
  232. copy $(@F) $@
  233. {}.sym{$(PBIN)}.sym:
  234. copy $(@F) $@
  235. {}.tsk{$(PBIN)}.tsk:
  236. copy $(@F) $@
  237. {}.acm{$(PBIN)}.acm:
  238. copy $(@F) $@
  239. {}.mci{$(PBIN)}.mci:
  240. copy $(@F) $@
  241. {..\..}.rc{$(PINC)}.rc:
  242. copy ..\..\$(@F) $@
  243. {}.res{}.rbj:
  244. @$(CVTRES) $(CRFLAGS) -o $(@B).rbj $(@B).res
  245. {..\..}.idf{$(PBIN)}.idf:
  246. copy ..\..\$(@F) $@
  247. {}.inx{$(PBIN)}.inf:
  248. copy $(@B).inx $@
  249. {..\..}.inf{$(PBIN)}.inf:
  250. copy ..\..\$(@F) $@
  251. {..\..}.pat{$(PBIN)}.pat:
  252. copy ..\..\$(@F) $@
  253. {}.dlg{$(PINC)}.dlg:
  254. copy $(@F) $@
  255. {..\..\}.dlg{$(PINC)}.dlg:
  256. copy ..\..\$(@F) $@
  257. {}.rc{}.rbj:
  258. $(rc) $(INC) $(rcvars) -fo $(@B).res $(@B).rc
  259. cvtres $(@B).res -o $@
  260. {..\..}.asm{}.obj:
  261. $(ASM) $(AFLAGS) ..\..\$(@B),$@;
  262. {..\..}.wav{$(PBIN)}.wav:
  263. copy ..\..\$(@F) $@
  264. {}.wav{$(PBIN)}.wav:
  265. copy $(@F) $@
  266. {..\..}.mid{$(PBIN)}.mid:
  267. copy ..\..\$(@F) $@
  268. {}.mid{$(PBIN)}.mid:
  269. copy $(@F) $@
  270. {..\..}.avi{$(PBIN)}.avi:
  271. copy ..\..\$(@F) $@
  272. {}.avi{$(PBIN)}.avi:
  273. copy $(@F) $@
  274. {..\..}.ini{$(PBIN)}.ini:
  275. copy ..\..\$(@F) $@
  276. {dos}.drv{$(PBIN)}.drv:
  277. copy dos\$(@F) $@
  278. {dos}.dll{$(PBIN)}.dll:
  279. copy dos\$(@F) $@
  280. {i386}.drv{$(PBIN)}.drv:
  281. copy i386\$(@F) $@
  282. {i386}.dll{$(PBIN)}.dll:
  283. copy i386\$(@F) $@
  284. !if "$(OS)" == "Windows_NT"
  285. {..\..}.c{}.obj:
  286. @$(CC) $(CFLAGS) ..\..\$(@B).c
  287. {..\..}.cpp{}.obj:
  288. @$(CC) $(CFLAGS) ..\..\$(@B).cpp
  289. {..\..}.cxx{}.obj:
  290. @$(CC) $(CFLAGS) ..\..\$(@B).cxx
  291. !else
  292. {..\..}.c{}.obj:
  293. @$(CL) @<<
  294. $(CFLAGS)
  295. ..\..\$(@B).c
  296. <<
  297. {..\..}.cpp{}.obj:
  298. @$(CL) @<<
  299. $(CFLAGS)
  300. ..\..\$(@B).cpp
  301. <<
  302. {..\..}.cxx{}.obj:
  303. @$(CL) @<<
  304. $(CFLAGS)
  305. ..\..\$(@B).cxx
  306. <<
  307. !endif # "$(OS)" != "Windows_NT"
  308. .SUFFIXES: .asm .c .cpp .exe .vbx .dll .drv .386 .vxd .cpl .hlp .reg .h .inc .lib .sym .tsk .acm .rc .mci .res .idf .inx .inf .dlg .mmh .pat .wav .mid .avi .ini .cxx .hxx
  309. ########## Library goal ###########################
  310. !ifdef IS_16
  311. !if "$(EXT)" == "dll" || "$(EXT)" == "DLL" || "$(EXT)" == "drv" || "$(EXT)" == "DRV"
  312. $(NAME).lib: $$(@B).$(EXT)
  313. !ifdef DEFFILE
  314. @mkpublic ..\..\$(DEFFILE).def $(NAME)
  315. !else
  316. @mkpublic ..\..\$(NAME).def $(NAME)
  317. !endif
  318. @implib $@ $(NAME)
  319. !else
  320. !if "$(EXT)" == "lib" || "$(EXT)" == "LIB"
  321. $(NAME).lib: $(OBJS)
  322. @if exist $@ del $@ >nul
  323. @$(LB) $(LBFLAGS) @<<
  324. $@
  325. y
  326. $(OBJS);
  327. <<
  328. !endif
  329. !endif
  330. !else # ifdef IS_16
  331. !if "$(EXT)" == "lib" || "$(EXT)" == "LIB"
  332. $(NAME).lib: $(OBJS)
  333. @if exist $@ del $@ >nul
  334. @$(LB) $(LBFLAGS) @<<
  335. -out:$@
  336. $(OBJS)
  337. <<
  338. !endif
  339. !endif
  340. ########## Map goal ###############################
  341. #!if (("$(DEBUG)" == "debug") || ("$(DEBUG)" == "retail")) && exists($(NAME).grp)
  342. #$(NAME).sym: $$(@B).map debug.sym
  343. # @qgrep -f ..\..\$(@B).grp $(@B).map >retail.map
  344. # @$(MAPSYM) $(MFLAGS) -mo $@ retail.map
  345. #
  346. #debug.sym: $(NAME).map
  347. #!else
  348. $(NAME).sym: $$(@B).map
  349. #!endif
  350. @$(MAPSYM) $(MFLAGS) -mo $@ $(NAME).map