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.

442 lines
10 KiB

  1. ############################################################################
  2. #
  3. # Copyright (C) 1995-1996 Microsoft Corporation. All Rights Reserved.
  4. #
  5. # File: proj.mk
  6. # Content: makefile for building the components of a project.
  7. # The rules for how to build all file types are here.
  8. #
  9. #@@BEGIN_MSINTERNAL
  10. # History:
  11. # Date By Reason
  12. # ==== == ======
  13. # 06-jan-95 craige initial implementation
  14. # 06-feb-95 craige made it easier to use other tools
  15. # 21-feb-96 colinmc forced WIN95 on rc line to ensure we pick up the
  16. # correct version info stuff
  17. # 14-jun-96 craige added MISC variable for misc dir.
  18. # 08-jul-96 a-marcan added CPL suffix and target
  19. # 18-dec-96 ketand added NEEDMMX for assembling MMX. changed default to
  20. # to optimize for Pentiums instead of 486.
  21. #@@END_MSINTERNAL
  22. ############################################################################
  23. !if "$(DXROOT)" == ""
  24. !error Environment variable DXROOT must be set to point at DirectX source
  25. !endif
  26. !ifdef IS_16
  27. !ifdef IS_32
  28. !error Must define one of IS_16 or IS_32, not both
  29. !endif
  30. !endif
  31. !ifndef IS_16
  32. !ifndef IS_32
  33. !error Must define IS_16 or IS_32
  34. !endif
  35. !endif
  36. !if [set PATH=;]
  37. !endif
  38. !if [set INCLUDE=;]
  39. !endif
  40. !if [set LIB=;]
  41. !endif
  42. !ifdef logo
  43. LOGO = 1
  44. !endif
  45. C8PATH = $(DXROOT)\public\tools\c816
  46. C9PATH = $(DXROOT)\public\tools\c932
  47. C10PATH = $(DXROOT)\public\tools\c1032
  48. #############################################################################
  49. #
  50. # Set up default variables. You can customize the build environment
  51. # by setting the following variables in your DEFAULT.MK file. Note that
  52. # these must be set to something; if they are not, default values will
  53. # kick in here.
  54. #
  55. # C16INC - 16-bit include path for C compiler
  56. # C16LIB - 16-bit libraries path for C compiler
  57. # C16BIN - 16-bit binaries path for C compiler
  58. #
  59. # C32INC - 32-bit include path for C compiler
  60. # C32LIB - 32-bit libraries path for C compiler
  61. # C32BIN - 32-bit binaries path for C compiler
  62. #
  63. # SDK16INC - Win16 SDK include path
  64. # SDK16LIB - Win16 SDK libraries path
  65. # SDK16BIN - Win16 SDK binaries path
  66. #
  67. # SDK32INC - Win32 SDK include path
  68. # SDK32LIB - Win32 SDK libraries path
  69. # SDK32BIN - Win32 SDK binaries path
  70. #
  71. # MASMBIN - MASM binaries path
  72. #
  73. #############################################################################
  74. !ifndef C16INC
  75. C16INC = $(C8PATH)\inc
  76. !endif
  77. !ifndef C16LIB
  78. C16LIB = $(C8PATH)\LIB
  79. !endif
  80. !ifndef C16BIN
  81. C16BIN = $(C8PATH)\BIN
  82. !endif
  83. !ifndef C32INC
  84. C32INC = $(C10PATH)\inc
  85. !endif
  86. !ifndef C32LIB
  87. C32LIB = $(C10PATH)\LIB
  88. !endif
  89. !ifndef C32BIN
  90. C32BIN = $(C10PATH)\BIN
  91. !endif
  92. !ifndef SDK16LIB
  93. SDK16LIB=$(DXROOT)\public\sdk\lib16;$(DXROOT)\public\sdk\lib16
  94. !endif
  95. !ifndef SDK16INC
  96. SDK16INC=$(DXROOT)\public\inc16;$(DXROOT)\public\sdk\inc16;$(DXROOT)\public\ddk\inc16;$(DXROOT)\public\ddk\inc
  97. !endif
  98. !ifndef SDK16BIN
  99. SDK16BIN=$(DXROOT)\public\tools\win9x\common;$(DXROOT)\public\tools\binr;$(DXROOT)\public\sdk\bin
  100. !endif
  101. !ifndef SDK32LIB
  102. SDK32LIB=$(DXROOT)\public\sdk\lib;$(DXROOT)\public\sdk\lib
  103. !endif
  104. !ifndef SDK32INC
  105. SDK32INC=$(DXROOT)\public\inc;$(DXROOT)\public\sdk\inc
  106. !endif
  107. !ifndef SDK32BIN
  108. SDK32BIN=$(DXROOT)\public\tools\win9x\common;$(DXROOT)\public\tools\binr;$(DXROOT)\public\sdk\bin
  109. !endif
  110. !ifndef MASMBIN
  111. MASMBIN=$(DXROOT)\public\tools\masm611c;$(DXROOT)\public\tools\masm61
  112. !ifdef NEEDMMX
  113. MASMBIN=$(DXROOT)\public\tools\masm611d;$(DXROOT)\public\tools\masm611c;$(DXROOT)\public\tools\masm61
  114. !endif
  115. !endif
  116. !ifndef MISC
  117. MISC=dxg\misc
  118. !endif
  119. #############################################################################
  120. #
  121. # Set up path, include, libs
  122. #
  123. #############################################################################
  124. INCLUDE=$(DXROOT)\inc;$(DXROOT)\$(MISC);$(DXROOT)\ddhelp;$(DXROOT)\$(DEBUG)\inc
  125. !ifdef IS_16
  126. INCLUDE=$(INCLUDE);$(SDK16INC);$(C16INC)
  127. PATH=$(SDK16BIN);$(MASMBIN);$(C16BIN)
  128. LIB=$(DXROOT)\$(DEBUG)\lib16;$(SDK16LIB);$(C16LIB)
  129. !else
  130. INCLUDE=$(INCLUDE);$(SDK32INC);$(DXROOT)\public\inc;$(C32INC)
  131. PATH=$(C32BIN);$(SDK32BIN);$(MASMBIN)
  132. LIB=$(DXROOT)\$(DEBUG)\lib;$(SDK32LIB);$(C32LIB)
  133. !endif
  134. !ifdef PATHEXTRA
  135. PATH=$(PATHEXTRA);$(PATH)
  136. !endif
  137. PATH=$(PATH);$(DXROOT)\bin
  138. !ifdef LINKNEW
  139. PATH=$(DXROOT)\linknew;$(PATH)
  140. !endif
  141. !ifdef USEDDK16
  142. INCLUDE=$(INCLUDE);$(DXROOT)\public\ddk\inc16
  143. !endif
  144. !ifdef USEDDK32
  145. INCLUDE=$(INCLUDE);$(DXROOT)\public\ddk\inc
  146. !endif
  147. #############################################################################
  148. #
  149. # new suffixes
  150. #
  151. #############################################################################
  152. .SUFFIXES:
  153. .SUFFIXES: .lbc .c .asm .cxx .cpp .vxd .exe .dll .drv .h .inc .lbw .lib .sym .rc .res .m4 .cpl .ovl .inl
  154. #############################################################################
  155. #
  156. # C compiler definitions
  157. #
  158. #############################################################################
  159. CC =cl
  160. CFLAGS = $(CFLAGS) -W3 -c -Zp -DMSBUILD
  161. !ifndef NOWX
  162. CFLAGS = $(CFLAGS) -WX
  163. !endif
  164. !ifdef IS_16
  165. !ifdef WANT_286
  166. CFLAGS =$(CFLAGS) -G2s -DIS_16
  167. !else
  168. CFLAGS =$(CFLAGS) -Gf3s -DIS_16
  169. !endif
  170. !else
  171. OPT_FLAGS = -Gf5ys
  172. CFLAGS =$(CFLAGS) $(OPT_FLAGS) -DIS_32 -DWIN32
  173. !endif
  174. !ifndef LOGO
  175. CFLAGS =$(CFLAGS) -nologo
  176. !endif
  177. !ifdef WANTASM
  178. CFLAGS = $(CFLAGS) -Fa$(PBIN)\$(@B).cod -FAsc
  179. !endif
  180. #############################################################################
  181. #
  182. # Linker definitions
  183. #
  184. #############################################################################
  185. !ifdef IS_16
  186. LINK =link
  187. LFLAGS =$(LFLAGS) /MAP /NOPACKCODE /NOE /NOD /L /ALIGN:16
  188. !ifndef LOGO
  189. LFLAGS =$(LFLAGS) /NOLOGO
  190. !endif
  191. !else
  192. LINK =link -link
  193. LFLAGS =$(LFLAGS) -nodefaultlib -align:0x1000
  194. !ifndef LOGO
  195. LFLAGS =$(LFLAGS) -nologo
  196. !endif
  197. !endif
  198. #############################################################################
  199. #
  200. # resource compiler definitions
  201. #
  202. #############################################################################
  203. RCFLAGS =$(RCFLAGS) -I..
  204. !ifdef IS_16
  205. RCFLAGS =$(RCFLAGS) -DIS_16
  206. RC = rc
  207. !else
  208. RCFLAGS =$(RCFLAGS) -DWIN32 -DIS_32 -DWIN95
  209. RC = rc
  210. !endif
  211. #############################################################################
  212. #
  213. # assembler definitions
  214. #
  215. #############################################################################
  216. ASM = mlx
  217. !ifndef NOAWX
  218. AFLAGS = $(AFLAGS) -WX
  219. !endif
  220. !ifdef IS_16
  221. AFLAGS =$(AFLAGS) -DIS_16
  222. !else
  223. AFLAGS =$(AFLAGS) -DIS_32 -DWIN32
  224. !ifdef ASMNOCOFF
  225. !else
  226. AFLAGS =$(AFLAGS) -DSTD_CALL -DBLD_COFF -coff
  227. !endif
  228. !endif
  229. AFLAGS =$(AFLAGS) -W3 -Zd -c -Cx -DMASM6
  230. #############################################################################
  231. #
  232. # librarian definitions
  233. #
  234. #############################################################################
  235. LIBEXE = lib
  236. #############################################################################
  237. #
  238. # M4 pre-proccessor definitions
  239. #
  240. #############################################################################
  241. !if "$(OS)" == "Windows_NT"
  242. M4 = $(DXROOT)\bin\$(PROCESSOR_ARCHITECTURE)\m4.exe
  243. !else
  244. M4 = $(DXROOT)\bin\m4.exe
  245. !endif
  246. M4FLAGS = -I..
  247. !ifdef IS_16
  248. M4FLAGS = $(M4FLAGS) -DIS_16
  249. !else
  250. M4FLAGS = $(M4FLAGS) -DIS_32 -DWIN32
  251. !endif
  252. #############################################################################
  253. #
  254. # target directories
  255. #
  256. #############################################################################
  257. PINC =$(DXROOT)\inc
  258. PLIB =$(_NTDRIVE)$(_NTROOT)\public\sdk\lib\win9x\i386
  259. #!ifdef IS_16
  260. #PLIB =$(DXROOT)\$(DEBUG)\lib16
  261. #!else
  262. #PLIB =$(DXROOT)\$(DEBUG)\lib
  263. #!endif
  264. #############################################################################
  265. #
  266. # targets
  267. #
  268. #############################################################################
  269. goal: $(GOALS)
  270. {}.c{$(PBIN)}.obj:
  271. @$(CC) @<<
  272. $(CFLAGS) -Fo$@ $(@B).c
  273. <<
  274. {..}.c{}.obj:
  275. @$(CC) @<<
  276. $(CFLAGS) -Fo$(@B).obj ..\$(@B).c
  277. <<
  278. {..\..\$(MISC)}.c{}.obj:
  279. @$(CC) @<<
  280. $(CFLAGS) -Fo$(@B).obj ..\..\$(MISC)\$(@B).c
  281. <<
  282. {..\..\..\$(MISC)}.c{}.obj:
  283. @$(CC) @<<
  284. $(CFLAGS) -Fo$(@B).obj ..\..\..\$(MISC)\$(@B).c
  285. <<
  286. {..\..\$(MISC)}.cpp{}.obj:
  287. @$(CC) @<<
  288. $(CFLAGS) -Fo$(@B).obj ..\..\$(MISC)\$(@B).cpp
  289. <<
  290. {..\..\..\$(MISC)}.cpp{}.obj:
  291. @$(CC) @<<
  292. $(CFLAGS) -Fo$(@B).obj ..\..\..\$(MISC)\$(@B).cpp
  293. <<
  294. {..}.cpp{}.obj:
  295. @$(CC) @<<
  296. $(CFLAGS) -Fo$(@B).obj ..\$(@B).cpp
  297. <<
  298. {..}.cxx{}.obj:
  299. @$(CC) @<<
  300. $(CFLAGS) -Fo$(@B).obj ..\$(@B).cxx
  301. <<
  302. {$(PINC)}.asm{$(PBIN)}.obj:
  303. $(ASM) @<<
  304. $(AFLAGS) -Fo$@ $?
  305. <<
  306. {}.asm{$(PBIN)}.obj:
  307. $(ASM) @<<
  308. $(AFLAGS) -Fo$@ $(@B).asm
  309. <<
  310. {..}.asm{}.obj:
  311. $(ASM) @<<
  312. $(AFLAGS) -Fo$(@B).obj ..\$(@B).asm
  313. <<
  314. {$(PINC)}.asm{}.obj:
  315. $(ASM) @<<
  316. $(AFLAGS) -Fo$(@B).obj $(PINC)\$(@B).asm
  317. <<
  318. {}.rc{$(PBIN)}.res:
  319. $(RC) $(RCFLAGS) -r -Fo$@ $(@B).rc
  320. {..}.rc{}.res:
  321. $(RC) $(RCFLAGS) -r -Fo$(@B).res ..\$(@B).rc
  322. {}.exe{$(PBIN)}.exe:
  323. @copy $(@F) $@
  324. @copy $(@B).map $(PBIN) > NUL
  325. {}.dll{$(PBIN)}.dll:
  326. @copy $(@F) $@
  327. @copy $(@B).map $(PBIN) > NUL
  328. {}.drv{$(PBIN)}.drv:
  329. @copy $(@F) $@
  330. @copy $(@B).map $(PBIN) > NUL
  331. {}.vxd{$(PBIN)}.vxd:
  332. @copy $(@F) $@
  333. @copy $(@B).map $(PBIN) > NUL
  334. {}.cpl{$(PBIN)}.cpl:
  335. @copy $(@F) $@
  336. @copy $(@B).map $(PBIN) > NUL
  337. {}.ovl{$(PBIN)}.ovl:
  338. @copy $(@F) $@
  339. @copy $(@B).map $(PBIN) > NUL
  340. {}.lib{$(PLIB)}.lib:
  341. @copy $(@F) $@
  342. {}.lbw{$(PLIB)}.lbw:
  343. @copy $(@F) $@
  344. {}.sym{$(PBIN)}.sym:
  345. @copy $(@F) $@
  346. {}.asm{$(PINC)}.asm:
  347. @copy $? $@
  348. {}.h{$(PINC)}.h:
  349. @copy $(@F) $@
  350. {..}.h{$(PINC)}.h:
  351. @copy ..\$(@F) $@
  352. {}.inc{$(PINC)}.inc:
  353. @copy $(@F) $@
  354. {..}.inc{$(PINC)}.inc:
  355. @copy ..\$(@F) $@
  356. {..\..}.inc{$(PINC)}.inc:
  357. @copy ..\..\$(@F) $@
  358. {..}.h{}.inc:
  359. @h2inc -c ..\$(@B).h -o $@
  360. {..}.m4{}.c:
  361. @echo ..\$*.m4
  362. @$(M4) $(M4FLAGS) ..\$(@B).m4 > $(@B).c
  363. {..}.m4{}.cpp:
  364. @echo ..\$*.m4
  365. @$(M4) $(M4FLAGS) ..\$(@B).m4 > $(@B).cpp
  366. {.}.c{}.obj:
  367. @$(CC) @<<
  368. $(CFLAGS) -Fo$(@B).obj -I.. $(@B).c
  369. <<
  370. !ifdef IS_16
  371. !if "$(EXT)" == "dll" || "$(EXT)" == "DLL" || "$(EXT)" == "drv" || "$(EXT)" == "DRV"
  372. $(NAME).lib: $(PBIN)\$$(@B).$(EXT)
  373. @mkpublic $(NAME).def $(NAME)
  374. @implib $@ $(NAME)
  375. !endif
  376. !endif