home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / MS_VC.50 / VC / MFC / SRC / MFCISAPI.MAK < prev    next >
Encoding:
Text File  |  1996-11-15  |  6.5 KB  |  343 lines

  1. # This is a part of the Microsoft Foundation Classes C++ library.
  2. # Copyright (C) 1996-1997 Microsoft Corporation
  3. # All rights reserved.
  4. #
  5. # This source code is only intended as a supplement to the
  6. # Microsoft Foundation Classes Reference and related
  7. # electronic documentation provided with the library.
  8. # See these sources for detailed information regarding the
  9. # Microsoft Foundation Classes product.
  10.  
  11. # Default PLATFORM depending on host environment
  12. !ifndef PLATFORM
  13. !ifndef PROCESSOR_ARCHITECTURE
  14. !error PLATFORM must be set to intended target
  15. !endif
  16. !if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  17. PLATFORM=INTEL
  18. !endif
  19. !if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  20. PLATFORM=MIPS
  21. !endif
  22. !if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  23. PLATFORM=ALPHA
  24. !endif
  25. !if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
  26. PLATFORM=PPC
  27. !endif
  28. !endif
  29.  
  30. # Default to DEBUG mode
  31. !ifndef DEBUG
  32. DEBUG=1
  33. !endif
  34.  
  35. # Default to NOT DLL
  36. !ifndef DLL
  37. DLL=0
  38. !endif
  39.  
  40. # Default Codeview Info
  41. !ifndef CODEVIEW
  42. !if "$(DEBUG)" == "1"
  43. CODEVIEW=1
  44. !else
  45. CODEVIEW=0
  46. !endif
  47. !endif
  48.  
  49. # BROWSEONLY is default 0 and implies BROWSE=1 if BROWSEONLY=1
  50. !ifndef BROWSEONLY
  51. BROWSEONLY=0
  52. !endif
  53.  
  54. !if "$(BROWSEONLY)" != "0"
  55. !undef BROWSE
  56. BROWSE=1
  57. !endif
  58.  
  59. # Default to no BROWSE info
  60. !ifndef BROWSE
  61. BROWSE=0
  62. !endif
  63.  
  64. # Default to _MBCS build
  65. !ifndef MBCS
  66. MBCS=1
  67. !endif
  68.  
  69. # Default to multithreading support
  70. !ifndef MT
  71. MT=1
  72. !endif
  73.  
  74. !if "$(MT)" != "1"
  75. !error This library must be built with threadding enabled.
  76. !endif
  77.  
  78. # TYPE = Library Type Designator
  79. #       N = normal C library
  80. #   D = for use with MFC USRDLL library
  81. #       E = for use with MFC Extension DLL library
  82.  
  83. !if "$(DLL)" == "0"
  84. TYPE=N
  85. !if "$(DEBUG)" == "1"
  86. TARGOPTS=$(TARGOPTS) /MTd
  87. !else
  88. TARGOPTS=$(TARGOPTS) /MT
  89. !endif
  90. !endif
  91.  
  92. !if "$(DLL)" == "1"
  93. !error The _USRDLL configuration is not supported by this library.
  94. !endif
  95.  
  96. !if "$(DLL)" == "2"
  97. !if "$(DEBUG)" == "1"
  98. TARGOPTS=$(TARGOPTS) /MDd
  99. !else
  100. TARGOPTS=$(TARGOPTS) /MD
  101. !endif
  102. TARGDEFS=$(TARGDEFS) /D_WINDLL /D_AFXDLL /D_DLL /D_AFX_CORE_IMPL
  103. TYPE=E
  104. !endif
  105.  
  106. #############################################################################
  107. # normalize cases of parameters, or error check
  108.  
  109. !if "$(CPU)" == "MIPS"
  110. !if "$(PLATFORM)" != "MIPS"
  111. !error Must set PLATFORM=MIPS for MIPS builds
  112. !endif
  113. !endif
  114.  
  115. !if "$(CPU)" == "ALPHA"
  116. !if "$(PLATFORM)" != "ALPHA"
  117. !error Must set PLATFORM=ALPHA for ALPHA builds
  118. !endif
  119. !endif
  120.  
  121. #############################################################################
  122. # Parse options
  123.  
  124. #
  125. # DEBUG OPTIONS
  126. #
  127. !if "$(DEBUG)" != "0"
  128.  
  129. DEBUGSUF=D
  130. DEBDEFS=/D_DEBUG
  131. DEBOPTS=/Od
  132.  
  133. !endif
  134.  
  135. #
  136. # NON-DEBUG OPTIONS
  137. #
  138. !if "$(DEBUG)" == "0"
  139.  
  140. DEBUGSUF=
  141. DEBDEFS=
  142.  
  143. !if "$(PLATFORM)" == "INTEL"
  144. DEBOPTS=/O1 /Gy
  145. !endif
  146. !if "$(PLATFORM)" == "MIPS"
  147. DEBOPTS=/O1 /Gy
  148. !endif
  149. !if "$(PLATFORM)" == "ALPHA"
  150. DEBOPTS=/O1 /Gy
  151. !endif
  152. !if "$(PLATFORM)" == "PPC"
  153. DEBOPTS=/O1 /Gy
  154. !endif
  155. !endif
  156.  
  157. #
  158. # PLATFORM options
  159. #
  160. CPP=cl
  161. LIB32=lib
  162. LINK32=link
  163.  
  164. !if "$(PLATFORM)" == "INTEL"
  165. CL_MODEL=/D_X86_
  166. !endif
  167.  
  168. !if "$(PLATFORM)" == "MIPS"
  169. CL_MODEL=/D_MIPS_
  170. !endif
  171.  
  172. !if "$(PLATFORM)" == "ALPHA"
  173. CL_MODEL=/D_ALPHA_
  174. !endif
  175.  
  176. !if "$(PLATFORM)" == "PPC"
  177. CL_MODEL=/D_PPC_
  178. !if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  179. CPP=mcl
  180. !endif
  181. !endif
  182.  
  183. !if "$(CPP)" == ""
  184. !error PLATFORM must be one of INTEL, MIPS, ALPHA, PPC
  185. !endif
  186.  
  187.  
  188. #REVIEW: does ISAPI support UNICODE?
  189.  
  190. !if "$(UNICODE)" == "1"
  191. MODEL=ISU
  192. TARGDEFS=$(TARGDEFS) /D_UNICODE
  193. !else
  194. MODEL=IS
  195. !if "$(MBCS)" != "0"
  196. TARGDEFS=$(TARGDEFS) /D_MBCS
  197. !endif
  198. !endif
  199.  
  200. #
  201. # Object File Directory
  202. #
  203. !if "$(OBJ)" == ""
  204. D=$$$(TYPE)$(MODEL)$(DEBUGSUF)    # subdirectory specific to variant
  205. !else
  206. D=$(OBJ)                                 # User specified directory
  207. !endif
  208.  
  209. GOAL=$(TYPE)AFX$(MODEL)$(DEBUGSUF)
  210.  
  211. #
  212. # CODEVIEW options
  213. #
  214. !if "$(CODEVIEW)" == "1"
  215. !if "$(NO_PDB)" == "1"
  216. CVOPTS=/Z7
  217. !else
  218. CVOPTS=/Zi /Fd..\lib\$(GOAL).pdb
  219. !endif
  220. !endif
  221.  
  222. #
  223. # COMPILER OPTIONS
  224. #
  225. !if "$(PLATFORM)" == "INTEL"
  226. CL_OPT=/W4 /WX /Zl /GX $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  227. !endif
  228.  
  229. !if "$(PLATFORM)" == "MIPS"
  230. CL_OPT=/W4 /WX /Zl /GX $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  231. !endif
  232.  
  233. !if "$(PLATFORM)" == "ALPHA"
  234. CL_OPT=/W4 /WX /Zl /GX $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  235. !endif
  236.  
  237. !if "$(PLATFORM)" == "PPC"
  238. CL_OPT=/W4 /Zl $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  239. !endif
  240.  
  241. !if "$(BROWSE)" != "0"
  242. CL_OPT=/FR$D\ $(CL_OPT)
  243. !endif
  244.  
  245. !if "$(BROWSEONLY)" != "0"
  246. CL_OPT=/Zs $(CL_OPT)
  247. !else
  248. CL_OPT=/Fo$D\ $(CL_OPT)
  249. !endif
  250.  
  251. DEFS=$(DEFS) $(DEBDEFS) $(TARGDEFS)
  252.  
  253. #############################################################################
  254. # Library Components
  255.  
  256. OBJS=$D\isapi.obj $D\inetcall.obj
  257.  
  258. #############################################################################
  259. # Standard tools
  260.  
  261. #############################################################################
  262. # Set CPPFLAGS for use with .cpp.obj and .c.obj rules
  263. # Define rule for use with OBJ directory
  264. # C++ uses a PCH file
  265.  
  266. CPPFLAGS=$(CPPFLAGS) $(CL_MODEL) $(CL_OPT) $(DEFS) $(OPT)
  267.  
  268. PCH_FILE=
  269.  
  270. .SUFFIXES: .cpp
  271.  
  272. .cpp{$D}.obj::
  273.     $(CPP) @<<
  274. $(CPPFLAGS) /c $<
  275. <<
  276. !if "$(BROWSE)" != "0"
  277.     copy /b $*.sbr+pchmark.bin $*.sbr >NUL
  278. !endif
  279.  
  280. .cpp{$D}.sbr::
  281.     $(CPP) @<<
  282. $(CPPFLAGS) /c $<
  283. <<
  284.     copy /b $*.sbr+pchmark.bin $*.sbr >NUL
  285.  
  286. #############################################################################
  287. # Goals to build
  288.  
  289. GOALS=create.dir
  290. !if "$(BROWSEONLY)" == "0"
  291. GOALS=$(GOALS) ..\lib\$(GOAL).lib
  292. !endif
  293. !if "$(BROWSE)" != "0"
  294. GOALS=$(GOALS) $(GOAL).bsc
  295. !endif
  296.  
  297. goal: $(GOALS)
  298.  
  299. create.dir:
  300.     @-if not exist $D\*.* mkdir $D
  301.  
  302. clean:
  303.     -if exist $D\*.obj erase $D\*.obj
  304.     -if exist $D\*.pch erase $D\*.pch
  305.     -if exist $D\*.res erase $D\*.res
  306.     -if exist $D\*.rsc erase $D\*.rsc
  307.     -if exist $D\*.map erase $D\*.map
  308.     -if not exist $D\*.* rmdir $D
  309.     -if exist ..\lib\$(GOAL).pdb del ..\lib\$(GOAL).pdb
  310.  
  311. #############################################################################
  312. # Build the library from the up-to-date objs
  313.  
  314. SBRS=$(CPP_OBJS:.obj=.sbr)
  315.  
  316. !if "$(BROWSEONLY)" != "0"
  317.  
  318. # Build final browse database
  319. $(GOAL).bsc: $(SBRS)
  320.     bscmake /n /Iu /El /o$@ @<<
  321. $(SBRS)
  322. <<
  323.  
  324. !else #BROWSEONLY
  325.  
  326. # Build final library
  327. ..\lib\$(GOAL).lib: $(OBJS)
  328.     @-if exist $@ erase $@
  329.     @$(LIB32) /out:$@ @<<
  330. $(OBJS)
  331. <<
  332.  
  333. # Recurse to build browse database
  334. $(GOAL).bsc: $(SBRS)
  335.     $(MAKE) /f makefile. @<<
  336. BROWSEONLY=1 PLATFORM=$(PLATFORM) DEBUG=$(DEBUG) CODEVIEW=$(CODEVIEW) \
  337. DLL=$(DLL) OBJ=$(OBJ) OPT=$(OPT)
  338. <<
  339.  
  340. !endif #!BROWSEONLY
  341.  
  342. #############################################################################
  343.