Source code of Windows XP (NT5)
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.

276 lines
7.8 KiB

  1. #=------------------------------------------------------------------------=
  2. # MakeAuto.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 an automation server. Assumes existence of $(SERVERNAME) and $(OBJS)
  13. #
  14. #
  15. # targets
  16. #
  17. !if "$(FRAMEWRKDIR)" == ""
  18. FRAMEWRKDIR=..\..
  19. !endif
  20. VERSIONHDR=$(FRAMEWRKDIR)\dwinvers.h
  21. !if "$(_SERVERFILENAME)"==""
  22. _SERVERFILENAME=$(SERVERNAME).DLL
  23. !endif
  24. !if "$(INTLBLD)"!=""
  25. !if "$(_LOCALEBASENAME)"==""
  26. !message _LOCALEBASENAME not set
  27. !endif
  28. !endif
  29. # Special for msrdo20 build - allows output of ODL.H (or some other alternate)
  30. !if "$(ALTERNATEODLHFILE)"==""
  31. _ALTERNATEODLHFILE=-h $(SERVERNAME)Interfaces.H
  32. !else
  33. _ALTERNATEODLHFILE=$(ALTERNATEODLHFILE)
  34. !endif
  35. # Tools
  36. #
  37. !include "Tools.Inc"
  38. SRCDIR=..
  39. FXDIR=$(FRAMEWRKDIR)\FrameWrk
  40. INTLPATH=.\.
  41. # Relative path to the INTL, satellite DLL build, directory
  42. #
  43. !if "$(TOOLS)"==""
  44. TOOLS=TOOLS
  45. !endif
  46. !if "$(C32)"==""
  47. C32=C32
  48. !endif
  49. IDHEADER=..\..\tools\idheader.bat
  50. # build specific flags
  51. #
  52. !if "$(ASDEBUG)"!=""
  53. #
  54. # debug
  55. #
  56. # Special for msrdo20 build - this is a non-mfc server NOT built in the framework
  57. #
  58. !if "$(NONFRAMEWRKMAKE)"==""
  59. LIBS=$(FXDIR)\Debug\CtlFwD32.Lib $(DEVBIN)\htmlhelp\v6\debug\lib\htmlhelp.lib
  60. !endif
  61. CFLAGS=-Zil -DDEBUG -Od -FI$(FRAMEWRKDIR)\include\vc41warn.h
  62. !if "$(PROCESSOR_ARCHITECTURE)"=="ALPHA"
  63. CFLAGS=$(CFLAGS) -QAieee
  64. !endif
  65. LFLAGS=-debugtype:cv -debug:notmapped,full -pdb:none
  66. RCFLAGS=-dDEBUG
  67. _SERVERDEP=$(_SERVERDEP) ..\..\framewrk\debug\CtlFwD32.Lib ..\..\vblic\debug\vblic.lib
  68. !else if "$(ASICECAP)"!=""
  69. #
  70. # ICECap
  71. #
  72. # Special for msrdo20 build - this is a non-mfc server NOT built in the framework
  73. !if "$(NONFRAMEWRKMAKE)"==""
  74. LIBS=$(FXDIR)\IceCap\CtlFwI32.Lib ICap.Lib msvcrt.lib $(DEVBIN)\htmlhelp\v6\retail\lib\htmlhelp.lib
  75. !endif
  76. #
  77. CFLAGS=-Gh -Zil -Owxsb1 -DICECAP -FI$(FRAMEWRKDIR)\include\vc41warn.h
  78. LFLAGS=-debug:mapped
  79. _SERVERDEP=$(_SERVERDEP) ..\..\framewrk\icecap\CtlFwI32.Lib ..\..\vblic\icecap\vblic.lib
  80. !else
  81. #
  82. # Release
  83. #
  84. # Special for msrdo20 build - this is a non-mfc server NOT built in the framework
  85. !if "$(NONFRAMEWRKMAKE)"==""
  86. LIBS=$(FXDIR)\Release\CtlFwR32.Lib $(DEVBIN)\htmlhelp\v6\retail\lib\htmlhelp.lib
  87. !endif
  88. #
  89. CFLAGS=-Zil -Owxsb1 -FI$(FRAMEWRKDIR)\include\vc41warn.h
  90. !if "$(PROCESSOR_ARCHITECTURE)"=="ALPHA"
  91. CFLAGS=$(CFLAGS) -QAieee -QAl
  92. !endif
  93. LFLAGS=
  94. _SERVERDEP=$(_SERVERDEP) ..\..\framewrk\release\CtlFwR32.Lib ..\..\vblic\release\vblic.lib
  95. LFLAGS=$(LFLAGS) -debugtype:fixup,cv -debug:notmapped,full
  96. !endif
  97. #
  98. # The CTLS_BROWSE environment variable turns on/off the compilation of a
  99. # browse file when the object is compiled. Set CTLS_BROWSE to something
  100. # if you wish a browse file generated.
  101. !if "$(CTLS_BROWSE)"!=""
  102. CFLAGS=$(CFLAGS) /FR
  103. BSCMAKE=bscmake.exe
  104. !endif
  105. #
  106. # default flags
  107. #
  108. INCPATH=-I. -I$(SRCDIR) -I$(FRAMEWRKDIR)\Include $(_INCPATH) -I$(VB55CTLS)
  109. RCFLAGS=-r -dRC_INVOKED $(RCFLAGS) $(_RCFLAGS) $(INCPATH)
  110. LIBS= $(LIBS) $(_LIBS) kernel32.lib user32.lib ole32.lib uuid.lib advapi32.lib oldnames.lib uuid2.lib oleaut32.nt4 comdlg32.lib gdi32.lib
  111. !ifdef RISC_BLD
  112. LFLAGS=$(LFLAGS) $(_LFLAGS) -nologo -out:$(_SERVERFILENAME) -DLL -subsystem:windows,4.00 -nodefaultlib -machine:$(PROCESSOR_ARCHITECTURE) -def:$(SRCDIR)\$(SERVERNAME).def
  113. !if "$(_NOODLFILE)"==""
  114. CFLAGS=-nologo -c $(INCPATH) -Gd -Gy -W3 -WX -Oi $(CFLAGS) $(_CFLAGS) -Tp
  115. !else
  116. CFLAGS=-nologo -c $(INCPATH) -Gd -Gy -W3 -WX -Oi $(CFLAGS) $(_CFLAGS)
  117. !endif
  118. !else
  119. LFLAGS=$(LFLAGS) $(_LFLAGS) -nologo -out:$(_SERVERFILENAME) -DLL -subsystem:windows,4.00 -nodefaultlib -machine:i386 -def:$(SRCDIR)\$(SERVERNAME).def
  120. !if "$(_NOODLFILE)"==""
  121. CFLAGS=-nologo -c $(INCPATH) -QIfdiv- -Gd -Gs -Gy -W3 -WX -Oi $(CFLAGS) $(_CFLAGS) -Tp
  122. !else
  123. CFLAGS=-nologo -c $(INCPATH) -QIfdiv- -Gd -Gs -Gy -W3 -WX -Oi $(CFLAGS) $(_CFLAGS)
  124. !endif
  125. !endif
  126. _SERVERDEP=$(_SERVERDEP)
  127. !if "$(PCHFILE)"!=""
  128. OBJS=$(OBJS) pch.obj
  129. PCHFLAGS=-Yu$(PCHFILE)
  130. !endif
  131. all: \
  132. !if "$(INTLBLD)"!=""
  133. $(INTLPATH)\$(_LOCALEBASENAME)xxx.Dll
  134. !elseif "$(DEPFILEBLD)"!=""
  135. $(_SERVERBASENAME).DEP
  136. !else
  137. $(MORETARGETS) $(_SERVERFILENAME) $(POSTTARGETS)
  138. !endif
  139. !if "$(_NOODLFILE)"==""
  140. $(_SERVERFILENAME): $(VERSIONHDR) $(SERVERNAME).TLB $(OBJS) \
  141. $(_SERVERDEP) $(SRCDIR)\Makefile
  142. $(LINK) $(OBJS) $(LIBS) $(LFLAGS)
  143. !else
  144. $(_SERVERFILENAME): $(VERSIONHDR) $(OBJS) \
  145. $(_SERVERDEP) $(SRCDIR)\Makefile
  146. $(LINK) $(OBJS) $(LIBS) $(LFLAGS)
  147. !endif
  148. !if "$(CTLS_BROWSE)"!=""
  149. $(BSCMAKE) /o $(SERVERNAME).bsc *.sbr
  150. !endif
  151. # Precompiled header build rules
  152. #
  153. !if "$(PCHFILE)"!=""
  154. pch.cpp:
  155. echo #include "$(PCHFILE)" > pch.cpp
  156. pch.pch pch.obj: $(SRCDIR)\$(PCHFILE) pch.cpp
  157. $(CC) -Yc$(PCHFILE) $(CFLAGS) pch.cpp
  158. !endif
  159. # Standard build rules.
  160. # If a .CPP, .C or .ODL file can't
  161. # be found in the other dependencies then it defaults to one of the following build rules
  162. #
  163. {$(SRCDIR)}.cpp.obj:
  164. $(CC) $(PCHFLAGS) $(CFLAGS) $<
  165. {$(SRCDIR)}.c.obj:
  166. $(CC) $(PCHFLAGS) $(CFLAGS) $<
  167. {$(SRCDIR)}.odl.tlb:
  168. $(MKTYPLIB) $(_MKTYPLIBFLAGS) -nologo -cpp_opt "/C /E /D__MKTYPLIB__ -nologo $(_MTLPREPROCFLAGS)" $(_ALTERNATEODLHFILE) -o Errors.LOG $<
  169. {$(SRCDIR)}.idl.tlb:
  170. $(MIDL) /newtlb /h -o Errors.LOG $<
  171. # TODO: you should come up with some mechanism to generate this file
  172. # on your own.
  173. #
  174. #-----------------------------------------------------------------------
  175. # Build dwinvers.h
  176. #-----------------------------------------------------------------------
  177. $(FRAMEWRKDIR)\dwinvers.h : $(FRAMEWRKDIR)\dwinvers.txt
  178. echo Building dwinvers.h
  179. $(MAKEVERS) > $(FRAMEWRKDIR)\dwinvers.h < $(FRAMEWRKDIR)\dwinvers.txt
  180. $(THUNDER55)\$(TOOLS)\bin\getver $(THUNDER55)\$(C32)\dll\vba6\vba6.dll VBA >> $(FRAMEWRKDIR)\dwinvers.h
  181. copy $(FRAMEWRKDIR)\dwinvers.h $(FRAMEWRKDIR)\framewrk
  182. !if "$(_NOODLFILE)"==""
  183. $(SERVERNAME).TLB : $(SRCDIR)\$(SERVERNAME).ODL $(TLBTARGETS)
  184. echo Generating $(SERVERNAME).TLB and $(_ALTERNATEODLHFILE)
  185. $(MKTYPLIB) $(_MKTYPLIBFLAGS) $(INCPATH) -nologo -cpp_opt "/C /E /D__MKTYPLIB__ -nologo $(_MTLPREPROCFLAGS)" $(_ALTERNATEODLHFILE) -o Errors.LOG -tlb $(SERVERNAME).TLB $(SRCDIR)\$(SERVERNAME).ODL
  186. $(SERVERNAME).Rbj : $(SERVERNAME).TLB $(SRCDIR)\$(SERVERNAME).RC
  187. echo Compiling $(SERVERNAME).RC
  188. $(RC) $(RCFLAGS) -fo $(SERVERNAME).Res $(SRCDIR)\$(SERVERNAME).Rc
  189. !endif
  190. !if "$(SERVERNAME)"=="RDOCURS"
  191. $(SERVERNAME).Rbj : $(SRCDIR)\$(SERVERNAME).RC
  192. echo Compiling $(SERVERNAME).RC
  193. $(RC) $(RCFLAGS) -fo $(SERVERNAME).Res $(SRCDIR)\$(SERVERNAME).Rc
  194. !endif
  195. !ifdef RISC_BLD
  196. cvtres -machine:$(PROCESSOR_ARCHITECTURE) -nologo -out:$(SERVERNAME).Rbj $(SERVERNAME).Res
  197. !else
  198. cvtres -machine:ix86 -nologo -out:$(SERVERNAME).Rbj $(SERVERNAME).Res
  199. !endif
  200. # Localized DLL build
  201. #
  202. Clean:
  203. del *.obj
  204. del *.dll
  205. del *.pdb
  206. del *.vcp
  207. !if "$(_NOODLFILE)"==""
  208. !if "$(PCHFILE)"==""
  209. Dep: $(MORETARGETS) $(SERVERNAME).TLB
  210. echo Generating Dependencies for $(SERVERNAME)
  211. $(INCLUDES) $(INCLPREOPT) $(INCPATH) -d $(SRCDIR)\*.c* $(SRCDIR)\*.odl > dep.mak
  212. !else
  213. Dep: $(MORETARGETS) $(SERVERNAME).TLB pch.pch
  214. echo Generating Dependencies for $(SERVERNAME)
  215. $(INCLUDES) $(INCPATH) -d -r$(PCHFILE)=pch.pch $(SRCDIR)\*.c* $(SRCDIR)\*.odl > dep.mak
  216. !endif
  217. !else
  218. !if "$(PCHFILE)"==""
  219. Dep: $(MORETARGETS)
  220. echo Generating Dependencies for $(SERVERNAME)
  221. $(INCLUDES) $(INCLPREOPT) $(INCPATH) -d $(SRCDIR)\*.c* > dep.mak
  222. !else
  223. Dep: $(MORETARGETS) pch.pch
  224. echo Generating Dependencies for $(SERVERNAME)
  225. $(INCLUDES) $(INCPATH) -d -r$(PCHFILE)=pch.pch $(SRCDIR)\*.c* > dep.mak
  226. !endif
  227. !endif
  228. #=----------------------------=
  229. # Include Dependency Makefile
  230. #
  231. !IF EXIST(dep.mak)
  232. !include dep.mak
  233. !ENDIF