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.

297 lines
8.7 KiB

  1. #=------------------------------------------------------------------------=
  2. # MakeCBC.Inc
  3. #=------------------------------------------------------------------------=
  4. # Copyright 1995 Microsoft Corporation. All Rights Reserved.
  5. #
  6. # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. # ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. # PARTICULAR PURPOSE.
  10. #=--------------------------------------------------------------------------=
  11. #
  12. # builds a custom base class. Assumes existence of $(DESIGNERNAME), and $(OBJS)
  13. #
  14. .SUFFIXES: .s
  15. #
  16. # targets
  17. #
  18. VERSIONHDR=dwinvers.h
  19. #
  20. # support for naming your DLL something other than DESIGNERNAME
  21. #
  22. !if "$(_SERVERFILENAME)"==""
  23. _SERVERFILENAME=$(DESIGNERNAME).DLL
  24. !endif
  25. !if "$(RUNMODEDLL)"=="YES"
  26. !if "$(_RUNMODESERVERNAME)"==""
  27. _RUNMODESERVERNAME=$(RUNMODE).DLL
  28. !endif
  29. !endif
  30. # Tools
  31. #
  32. !include "Tools.Inc"
  33. SRCDIR=..
  34. FXDIR=..\..\FrameWrk
  35. INTLPATH=.\.
  36. # build specific flags
  37. #
  38. !if "$(ASDEBUG)"!=""
  39. #
  40. # debug
  41. #
  42. LIBS=$(FXDIR)\Debug\CtlFwD32.Lib $(DEVBIN)\htmlhelp\v6\debug\lib\htmlhelp.lib
  43. CFLAGS=-Zil -DDEBUG -Od -FI..\..\include\vc41warn.h
  44. !if "$(PROCESSOR_ARCHITECTURE)"=="ALPHA"
  45. CFLAGS = $(CFLAGS) /QAieee
  46. !endif
  47. _MTLPREPROCFLAGS = $(_MTLPREPROCFLAGS) /DDEBUG
  48. LINKFLAGS=-debugtype:cv -debug:notmapped,full
  49. RCFLAGS=-dDEBUG
  50. _SERVERDEP=$(_SERVERDEP) ..\..\framewrk\debug\CtlFwD32.Lib ..\..\vblic\debug\vblic.lib
  51. !else if "$(ASICECAP)"!=""
  52. #
  53. # ICECap
  54. #
  55. LIBS=$(FXDIR)\IceCap\CtlFwI32.Lib ICap.Lib msvcrt.lib $(DEVBIN)\htmlhelp\v6\retail\lib\htmlhelp.lib
  56. CFLAGS=-Gh -Zil -Owxsb1 -DICECAP -FI..\..\include\vc41warn.h
  57. LINKFLAGS=-debug:mapped
  58. _MTLPREPROCFLAGS = $(_MTLPREPROCFLAGS) /DICECAP
  59. _SERVERDEP=$(_SERVERDEP) ..\..\framewrk\icecap\CtlFwI32.Lib ..\..\vblic\icecap\vblic.lib
  60. !else
  61. #
  62. # Release
  63. #
  64. LIBS=$(FXDIR)\Release\CtlFwR32.Lib $(DEVBIN)\htmlhelp\v6\retail\lib\htmlhelp.lib
  65. #
  66. CFLAGS=-Zil -Owxsb1 -FI..\..\include\vc41warn.h
  67. !if "$(PROCESSOR_ARCHITECTURE)"=="ALPHA"
  68. CFLAGS = $(CFLAGS) /QAl /QAieee
  69. !endif
  70. LINKFLAGS=-debugtype:fixup,cv -debug:notmapped,full
  71. _SERVERDEP=$(_SERVERDEP) ..\..\framewrk\release\CtlFwR32.Lib ..\..\vblic\release\vblic.lib
  72. !endif
  73. #
  74. # The CTLS_BROWSE environment variable turns on/off the compilation of a
  75. # browse file when the object is compiled. Set CTLS_BROWSE to something
  76. # if you wish a browse file generated.
  77. !if "$(CTLS_BROWSE)"!=""
  78. CFLAGS=$(CFLAGS) /FR
  79. BSCMAKE=bscmake.exe
  80. !endif
  81. #
  82. # default flags
  83. #
  84. INCPATH=-I. -I$(SRCDIR) -I..\..\Include $(_INCPATH)
  85. MLFLAGS=-c -coff $(INCPATH) -nologo
  86. !if "$(PROCESSOR_ARCHITECTURE)"=="ALPHA"
  87. MLFLAGS=$(MLFLAGS) -Gy
  88. !endif
  89. RCFLAGS=-r $(RCFLAGS) $(_RCFLAGS) $(INCPATH)
  90. !ifdef RISC_BLD
  91. LIBS= $(LIBS) $(_LIBS) kernel32.lib user32.lib ole32.lib uuid.lib advapi32.lib oldnames.lib uuid2.lib oleaut32.nt4 comdlg32.lib gdi32.lib
  92. LFLAGS=$(LINKFLAGS) $(_LFLAGS) -nologo -DLL -subsystem:windows,4.00 -nodefaultlib -machine:$(PROCESSOR_ARCHITECTURE)
  93. CFLAGS=-nologo -c $(INCPATH) -Gd -Gy -W3 -WX -Oi $(CFLAGS) $(_CFLAGS) -Tp
  94. !else
  95. LIBS= $(LIBS) $(_LIBS) kernel32.lib user32.lib ole32.lib uuid.lib advapi32.lib oldnames.lib uuid2.lib oleaut32.nt4 comdlg32.lib gdi32.lib
  96. LFLAGS=$(LINKFLAGS) $(_LFLAGS) -nologo -DLL -subsystem:windows,4.00 -nodefaultlib -machine:i386
  97. CFLAGS=-nologo -c $(INCPATH) -QIfdiv- -Gd -Gs -Gy -W3 -WX -Oi $(CFLAGS) $(_CFLAGS) -Tp
  98. !endif
  99. !if "$(ASDEBUG)"!=""
  100. DSGNLFLAGS=-out:$(_SERVERFILENAME) $(LFLAGS) -base:@$(DEVBINC)\vstudio\v6\dllbase.txt,$(DESIGNERNAME)_d -def:$(SRCDIR)\$(DESIGNERNAME).def
  101. !else
  102. DSGNLFLAGS=-out:$(_SERVERFILENAME) $(LFLAGS) -base:@$(DEVBINC)\vstudio\v6\dllbase.txt,$(DESIGNERNAME)_r -def:$(SRCDIR)\$(DESIGNERNAME).def
  103. !endif
  104. DSGNLIBS=$(LIBS) $(_DSGNLIBS)
  105. !if "$(ASDEBUG)"!=""
  106. RUNLFLAGS=-out:$(_RUNMODESERVERNAME) $(LFLAGS) -base:@$(DEVBINC)\vstudio\v6\dllbase.txt,$(DESIGNERNAME)_rt_d -def:$(SRCDIR)\$(RUNMODE).DEF
  107. !else
  108. RUNLFLAGS=-out:$(_RUNMODESERVERNAME) $(LFLAGS) -base:@$(DEVBINC)\vstudio\v6\dllbase.txt,$(DESIGNERNAME)_rt_r -def:$(SRCDIR)\$(RUNMODE).DEF
  109. !endif
  110. RUNLIBS=$(LIBS) $(_RUNLIBS)
  111. !IF "$(ALLTARGETS)"==""
  112. ALLTARGETS= \
  113. !if "$(INTLBLD)"==""
  114. !if "$(RUNMODEDLL)"=="YES"
  115. $(_RUNMODESERVERNAME) \
  116. !endif
  117. $(_SERVERFILENAME) \
  118. !if "$(ASDEBUG)"=="" && "$(ASICECAP)"==""
  119. Lego
  120. !endif
  121. !else
  122. $(INTLPATH)\$(_LOCALEBASENAME)xxx.DLL
  123. !endif
  124. !endif
  125. !if "$(TLBTARGETS)"==""
  126. TLBTARGETS=$(SRCDIR)\$(DESIGNERNAME).TLB
  127. !endif
  128. !if "$(TLBRUNTARGETS)"==""
  129. TLBRUNTARGETS=$(SRCDIR)\$(RUNMODE).ODL
  130. !endif
  131. !if "$(PCHFILE)"!=""
  132. OBJS=$(OBJS) pch.obj
  133. PCHFLAGS=-Yu$(PCHFILE)
  134. !endif
  135. #=--------------------------------------------------------------------------=
  136. # build the designer, and, if appropriate, the run-mode DLL
  137. #
  138. all: $(ALLTARGETS)
  139. $(_SERVERFILENAME): $(VERSIONHDR) $(DESIGNERNAME).TLB $(OBJS) \
  140. $(_SERVERDEP) $(SRCDIR)\Makefile
  141. $(LINK) $(OBJS) $(DSGNLIBS) $(DSGNLFLAGS)
  142. !if "$(CTLS_BROWSE)"!=""
  143. $(BSCMAKE) /o $(_SERVERFILENAME).bsc *.sbr
  144. !endif
  145. !if "$(RUNMODEDLL)"=="YES"
  146. $(_RUNMODESERVERNAME): $(VERSIONHDR) \
  147. !if "$(RUNMODETLB)"=="YES"
  148. $(RUNMODE).TLB \
  149. !endif
  150. $(RUNOBJS)
  151. $(LINK) $(RUNOBJS) $(RUNLFLAGS) $(RUNLIBS)
  152. !endif
  153. !if "$(PCHFILE)"!=""
  154. # pre-compiled header targets.
  155. pch.cpp:
  156. echo #include "$(PCHFILE)" > pch.cpp
  157. pch.pch pch.obj: $(SRCDIR)\$(PCHFILE) pch.cpp
  158. $(CC) -Yc$(PCHFILE) $(CFLAGS) pch.cpp
  159. !endif
  160. {$(SRCDIR)}.cpp.obj:
  161. $(CC) $(PCHFLAGS) $(CFLAGS) $<
  162. {$(SRCDIR)}.c.obj:
  163. $(CC) $(PCHFLAGS) $(CFLAGS) $<
  164. {$(SRCDIR)}.asm.Obj:
  165. $(ML) $(MLFLAGS) $<
  166. # TODO: you should come up with some mechanism to generate this file
  167. # on your own.
  168. #
  169. $(VERSIONHDR) : ..\..\FrameWrk\dwinvers.h
  170. echo Generating Version Information Header File (dwinvers.h)
  171. copy ..\..\FrameWrk\dwinvers.h >nul
  172. $(DESIGNERNAME).TLB : $(TLBTARGETS)
  173. echo Generating $(DESIGNERNAME).TLB and $(DESIGNERNAME)Interfaces.H
  174. $(CC) $(INCPATH) -nologo /C /E /D__MKTYPLIB__ $(_MTLPREPROCFLAGS) /Tc $(SRCDIR)\$(DESIGNERNAME).ODL > preproc.odl
  175. $(MKTYPLIB) $(_MKTYPLIBFLAGS) -nologo -nocpp -h $(DESIGNERNAME)Interfaces.H -o Errors.LOG -tlb $(DESIGNERNAME).TLB preproc.odl
  176. $(RUNMODE).TLB : $(TLBRUNTARGETS)
  177. echo Generating $(RUNMODE).TLB and $(RUNMODE)Interfaces.H
  178. $(CC) $(INCPATH) -nologo /C /E /D__MKTYPLIB__ $(_MTLPREPROCFLAGS) /Tc $(SRCDIR)\$(RUNMODE).ODL > preproc.odl
  179. $(MKTYPLIB) $(_MKTYPLIBFLAGS) -nologo -nocpp -h $(RUNMODE)Interfaces.H -o Errors.LOG -tlb $(RUNMODE).TLB preproc.odl
  180. $(DESIGNERNAME).Rbj : $(DESIGNERNAME).TLB $(SRCDIR)\$(DESIGNERNAME).RC
  181. echo Compiling $(DESIGNERNAME).RC
  182. $(RC) $(RCFLAGS) -fo $(DESIGNERNAME).Res $(SRCDIR)\$(DESIGNERNAME).Rc
  183. !ifdef RISC_BLD
  184. cvtres -machine:$(PROCESSOR_ARCHITECTURE) -nologo -out:$(DESIGNERNAME).Rbj $(DESIGNERNAME).Res
  185. !else
  186. cvtres -machine:ix86 -nologo -out:$(DESIGNERNAME).Rbj $(DESIGNERNAME).Res
  187. !endif
  188. $(RUNMODE).Rbj : \
  189. !if "$(RUNMODETLB)"=="YES"
  190. $(RUNMODE).TLB \
  191. !endif
  192. $(SRCDIR)\$(RUNMODE).RC
  193. echo Compiling $(RUNMODE).RC
  194. $(RC) $(RCFLAGS) -fo $(RUNMODE).Res $(SRCDIR)\$(RUNMODE).Rc
  195. !ifdef RISC_BLD
  196. cvtres -machine:$(PROCESSOR_ARCHITECTURE) -nologo -out:$(RUNMODE).Rbj $(RUNMODE).Res
  197. !else
  198. cvtres -machine:ix86 -nologo -out:$(RUNMODE).Rbj $(RUNMODE).Res
  199. !endif
  200. !if "$(_SERVERBASENAME)"==""
  201. !message _SERVERBASENAME not set
  202. !endif
  203. !if "$(_SERVEREXTENSION)"==""
  204. !message _SERVEREXTENSION not set
  205. !endif
  206. !if "$(RUNMODEDLL)"=="YES"
  207. !if "$(_RUNMODEBASENAME)"==""
  208. !message _RUNMODEBASENAME not set
  209. !endif
  210. !if "$(_RUNMODEEXTENSION)"==""
  211. !message _RUNMODEEXTENSION not set
  212. !endif
  213. !endif
  214. !if "$(INTLBLD)"!=""
  215. !if "$(_LOCALEBASENAME)"==""
  216. !message _LOCALEBASENAME not set
  217. !endif
  218. !endif
  219. Lego:
  220. !if "$(CTLS_LEGO)"=="YES"
  221. nmake -f $(THUNDER55)\common\instr.mak FILE_BASE=$(_SERVERBASENAME) FILE_EXTENSION=$(_SERVEREXTENSION) CMD_SCRIPT= BOOT_SYM=
  222. !if "$(_RUNMODEBASENAME)" != ""
  223. nmake -f $(THUNDER55)\common\instr.mak FILE_BASE=$(_RUNMODEBASENAME) FILE_EXTENSION=$(_RUNMODEEXTENSION) CMD_SCRIPT= BOOT_SYM=
  224. !endif
  225. !endif
  226. Clean:
  227. del *.obj
  228. del *.dll
  229. del *.pdb
  230. del *.vcp
  231. Dep: GenerateDeps \
  232. !if "$(RUNMODETLB)"=="YES"
  233. $(RUNMODE).TLB \
  234. !endif
  235. !if "$(PCHFILE)"!=""
  236. pch.pch \
  237. !endif
  238. $(DESIGNERNAME).TLB
  239. GenerateDeps: $(INTLPATH)\HelpStrs.RC $(DESIGNERNAME).TLB dwinvers.h
  240. echo Generating Dependancies for $(DESIGNERNAME)
  241. !if "$(PCHFILE)"==""
  242. $(INCLUDES) $(INCPATH) -d $(SRCDIR)\*.c* $(SRCDIR)\*.odl > dep.mak
  243. !else
  244. $(INCLUDES) $(INCPATH) -d -r$(PCHFILE)=pch.pch $(SRCDIR)\*.c* $(SRCDIR)\*.odl > dep.mak
  245. !endif
  246. #=----------------------------=
  247. # Include Dependency Makefile
  248. #
  249. !IF EXIST(dep.mak)
  250. !include dep.mak
  251. !ENDIF