home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / MS_VC.50 / VC / MFC / SRC / MAKEFILE < prev    next >
Encoding:
Text File  |  1996-10-30  |  19.8 KB  |  804 lines

  1. # Makefile : Builds a Microsoft Foundation Class library variant.
  2. #
  3. # This is a part of the Microsoft Foundation Classes C++ library.
  4. # Copyright (C) 1992-1997 Microsoft Corporation
  5. # All rights reserved.
  6. #
  7. # This source code is only intended as a supplement to the
  8. # Microsoft Foundation Classes Reference and related
  9. # electronic documentation provided with the library.
  10. # See these sources for detailed information regarding the
  11. # Microsoft Foundation Classes product.
  12. #
  13. # Usage: NMAKE CLEAN        (removes all intermediary files)
  14. #    or: NMAKE options      (builds one library variant (see below))
  15. # Note that an NMAKE CLEAN should be performed before building a new variant.
  16. #
  17. # 'Options' are one of each of:
  18. #   "DLL"              (defaults to 0)
  19. #           If this item is 0, then a normal library is generated.
  20. #                       DLL=1 is obsolete and not supported by this release.
  21. #           If this item is 2, objects suitable for the shared DLL version
  22. #           of MFC are created.  Note: DLL=2 is to be used only from
  23. #           MFCDLL.MAK, MFCOLE.MAK, or MFCDB.MAK
  24. #
  25. #   "DEBUG"             (defaults to 1)
  26. #           If this item is 1, debugging support is compiled into
  27. #           the library.  If this item is 0, then debugging support
  28. #           is disabled.  Debug support does not include CodeView information.
  29. #
  30. #   "CODEVIEW"          (defaults to 1 for DEBUG=1, 0 for DEBUG=0)
  31. #           If this item is 1 CodeView information is compiled into
  32. #           the library.  You must use the /DEBUG:FULL and /DEBUGTYPE:cv link
  33. #           options when linking your executable. A value of 0 indicates that
  34. #           no CodeView information is to be generated.
  35. #
  36. #   "OBJ=.\obj"         (defaults to '$$(MODEL)$(BASE)$(DEBUG)')
  37. #           This optional specification specifies where temporary OBJ files
  38. #           are stored during the build process.  The directory is created or
  39. #           removed as necessary.
  40. #
  41. #   "OPT="              (no default value)
  42. #           This allows additional compiler options to be added to the build.
  43. #           If more than one switch is desired, put double-quotes around the
  44. #           whole OPT= argument, e.g., "OPT=/J /W3".
  45. #
  46. #   "NO_PCH=1"
  47. #           Set this item to override the default use of precompiled headers.
  48. #
  49. #   "NO_PDB=1"
  50. #           Set this item to override the default use of PDB files.
  51. #
  52. #   "BROWSE=1"          (defaults to 0)
  53. #           Set this option to build the browse database for the MFC
  54. #           library.  By setting BROWSE=1, both the .SBRs and the .BSC
  55. #           files will be built along with the .OBJ and .LIB files that
  56. #           are part of the normal build process.
  57. #
  58. #   "BROWSEONLY=1"      (defaults to 0)
  59. #           Set this option to build the browse files without re-building
  60. #           the MFC library itself.  Note: This option is used internally
  61. #           when BROWSE=1 is selected.
  62. #
  63. #   "PLATFORM=INTEL"    (defaults depends on host)
  64. #           This option chooses the appropriate tools and sources for the
  65. #           different platforms supporting the Win32 API. Currently INTEL,
  66. #                       MIPS, ALPHA, PPC, M68K, and MPPC are supported; more will
  67. #           be added as they become available.  This option must be set for
  68. #           Mac targets since they are built on an Intel host.
  69. #
  70. #   "INCREMENTAL=1"     (defaults to 0)
  71. #           This option enables incremental/minimal compilation and
  72. #           incremental linking.
  73. #
  74. #       "MACOCX=1"                      (defaults to no definition)
  75. #                       Temporary option to allow you to build OCX support into Mac MFC
  76. #                       with an additional define.  I'll remove it when Mac OCXs are
  77. #                       fully functional.
  78. #
  79. # Advanced Options:
  80. #
  81. #   "MBCS=0"            (defaults to 1)
  82. #           To build an SBCS library instead of the default (MBCS)
  83. #           you can use MBCS=0.  This creates a slightly smaller
  84. #           library, but the code will not work in far-east markets.
  85. #           This option has no effect when UNICODE=1.
  86. #
  87. #   "MT=0"              (defaults to 1)
  88. #           To build a non-multithreaded library instead of the default
  89. #           (which enables multitheading and uses the multithread
  90. #           C-runtimes) you can use MT=0.
  91. #
  92. #############################################################################
  93. # Define defaults if not defined
  94.  
  95. # Default PLATFORM depending on host environment
  96. !ifndef PLATFORM
  97. !ifndef PROCESSOR_ARCHITECTURE
  98. PROCESSOR_ARCHITECTURE=x86
  99. !endif
  100. !if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  101. PLATFORM=INTEL
  102. !endif
  103. !if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  104. PLATFORM=MIPS
  105. !endif
  106. !if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  107. PLATFORM=ALPHA
  108. !endif
  109. !if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
  110. PLATFORM=PPC
  111. !endif
  112. !endif
  113.  
  114. # Default to DEBUG mode
  115. !ifndef DEBUG
  116. DEBUG=1
  117. !endif
  118.  
  119. # Default to NOT DLL
  120. !ifndef DLL
  121. DLL=0
  122. !endif
  123.  
  124. # Default Codeview Info
  125. !ifndef CODEVIEW
  126. !if "$(DEBUG)" == "1"
  127. CODEVIEW=1
  128. !else
  129. CODEVIEW=0
  130. !endif
  131. !endif
  132.  
  133. # BROWSEONLY is default 0 and implies BROWSE=1 if BROWSEONLY=1
  134. !ifndef BROWSEONLY
  135. BROWSEONLY=0
  136. !endif
  137.  
  138. !if "$(BROWSEONLY)" != "0"
  139. !undef BROWSE
  140. BROWSE=1
  141. !endif
  142.  
  143. # Default to no BROWSE info
  144. !ifndef BROWSE
  145. BROWSE=0
  146. !endif
  147.  
  148. # Default to no INCREMENTAL build
  149. !ifndef DEVBUILD
  150. DEVBUILD=0
  151. !endif
  152. !if "$(DEBUG)" != "0"
  153. !ifndef INCREMENTAL
  154. INCREMENTAL=$(DEVBUILD)
  155. !endif
  156. !endif
  157. !ifndef INCREMENTAL
  158. INCREMENTAL=0
  159. !endif
  160.  
  161. # Default to _MBCS build
  162. !ifndef MBCS
  163. MBCS=1
  164. !endif
  165.  
  166. # Default to multithreading support
  167. !ifndef MT
  168. MT=1
  169. !endif
  170.  
  171. #############################################################################
  172. # normalize cases of parameters, or error check
  173.  
  174. !if "$(CPU)" == "MIPS"
  175. !if "$(PLATFORM)" != "MIPS"
  176. !error Must set PLATFORM=MIPS for MIPS builds
  177. !endif
  178. !endif
  179.  
  180. !if "$(CPU)" == "ALPHA"
  181. !if "$(PLATFORM)" != "ALPHA"
  182. !error Must set PLATFORM=ALPHA for ALPHA builds
  183. !endif
  184. !endif
  185.  
  186. BASE=W
  187. !if "$(PLATFORM)" == "M68K" || "$(PLATFORM)" == "MPPC"
  188. !undef BASE
  189. MACOS=1
  190. !if "$(PLATFORM)" == "M68K"
  191. BASE=M
  192. MACOS_ARCH='m68k'
  193. !else
  194. BASE=P
  195. MACOS_ARCH='pwpc'
  196. !endif
  197. !if "$(UNICODE)" == "1"
  198. !error Must set UNICODE=0 for Macintosh builds
  199. !endif
  200. !endif
  201.  
  202. #############################################################################
  203. # Parse options
  204.  
  205. #
  206. # DEBUG OPTIONS
  207. #
  208. !if "$(DEBUG)" != "0"
  209.  
  210. DEBUGSUF=D
  211. DEBDEFS=/D_DEBUG
  212. DEBOPTS=/Od
  213.  
  214. !if "$(PLATFORM)" == "M68K"
  215. DEBOPTS=/Q68m $(DEBOPTS)
  216. !elseif "$(PLATFORM)" == "MPPC"
  217. DEBOPTS=/QPm $(DEBOPTS)
  218. !endif
  219. !endif
  220.  
  221. #
  222. # NON-DEBUG OPTIONS
  223. #
  224. !if "$(DEBUG)" == "0"
  225.  
  226. DEBUGSUF=
  227. DEBDEFS=
  228.  
  229. !if "$(PLATFORM)" == "INTEL"
  230. DEBOPTS=/O1 /GyF
  231. !endif
  232. !if "$(PLATFORM)" == "MIPS"
  233. DEBOPTS=/O1 /GyF
  234. !endif
  235. !if "$(PLATFORM)" == "ALPHA"
  236. DEBOPTS=/O1 /GyF
  237. !endif
  238. !if "$(PLATFORM)" == "PPC"
  239. DEBOPTS=/O1 /GyF
  240. !endif
  241. !if "$(PLATFORM)" == "M68K"
  242. DEBOPTS=/O1 /GyF
  243. !endif
  244. !if "$(PLATFORM)" == "MPPC"
  245. DEBOPTS=/O1 /GyF
  246. !endif
  247. !endif
  248.  
  249. #
  250. # PLATFORM options
  251. #
  252.  
  253. !if "$(PLATFORM)" == "INTEL"
  254. CL_MODEL=/D_X86_
  255. !endif
  256.  
  257. !if "$(PLATFORM)" == "MIPS"
  258. CL_MODEL=/D_MIPS_
  259. !endif
  260.  
  261. !if "$(PLATFORM)" == "ALPHA"
  262. CL_MODEL=/D_ALPHA_
  263. !endif
  264.  
  265. !if "$(PLATFORM)" == "PPC"
  266. CL_MODEL=/D_PPC_
  267. !endif
  268.  
  269. !if "$(PLATFORM)" == "M68K"
  270. MT=0
  271. CL_MODEL=/D_68K_ /D_MAC /NTAFX_DEF
  272. !endif
  273.  
  274. !if "$(PLATFORM)" == "MPPC"
  275. MT=0
  276. CL_MODEL=/D_MPPC_ /D_MAC
  277. !endif
  278.  
  279. !if "$(CL_MODEL)" == ""
  280. !error PLATFORM must be one of INTEL, MIPS, ALPHA, PPC, M68K, or MPPC
  281. !endif
  282.  
  283. # TYPE = Library Type Designator
  284. #       c = normal C library
  285. #       d = DLL library
  286. TYPE=c
  287. DEXT=
  288.  
  289. #
  290. # Object File Directory
  291. #
  292. !if "$(OBJ)" == ""
  293. D=$$$(MODEL)$(BASE)$(DEBUGSUF)$(DEXT)    # subdirectory specific to variant
  294. !else
  295. D=$(OBJ)                                 # User specified directory
  296. !endif
  297.  
  298. #
  299. # _AFXDLL DLL Variant
  300. #
  301.  
  302. !if "$(DLL)" == "2"
  303. # _AFXDLL library
  304. TYPE=e
  305. !if "$(OBJ)" == ""
  306. D=DLL$(DEBUGSUF).$(BASE)
  307. !if "$(UNICODE)" == "1"
  308. D=$(MODEL)$D
  309. !endif
  310. D=$$$D
  311. !endif
  312. TARGOPTS=$(TARGOPTS) /MD /D_DLL /GF
  313. !if "$(MT)" != "0"
  314. TARGOPTS=$(TARGOPTS) /D_MT
  315. !endif
  316. TARGDEFS=$(TARGDEFS) /D_WINDLL /D_AFXDLL
  317. !else
  318. # not _AFXDLL library
  319. !if "$(MT)" != "0"
  320. TARGOPTS=$(TARGOPTS) /MT
  321. !endif
  322. !endif
  323.  
  324. !if "$(UNICODE)" == "1"
  325. MODEL=U
  326. TARGDEFS=$(TARGDEFS) /D_UNICODE
  327. !else
  328. MODEL=N
  329. !if "$(MBCS)" != "0"
  330. TARGDEFS=$(TARGDEFS) /D_MBCS
  331. !endif
  332. !endif
  333.  
  334. !if "$(DLL)" == "2" && "$(BROWSEONLY)" != "1"
  335. !if "$(TARG)" == ""
  336. !error DLL=2 is used only from MFCDLL.MAK, MFCOLE.MAK, or MFCDB.MAK
  337. !endif
  338. GOAL=$(TARG)
  339. !else
  340. GOAL=$(MODEL)afx$(TYPE)$(BASE)$(DEBUGSUF)
  341. !endif
  342.  
  343. #
  344. # CODEVIEW options
  345. #
  346. !if "$(CODEVIEW)" == "1"
  347. !if "$(NO_PDB)" == "1"
  348. CVOPTS=/Z7
  349. !if "$(PROFLIB)" != ""
  350. !error Can't build for profiling without PDB files.
  351. !endif
  352. !else
  353. CVOPTS=/Zi
  354. !if "$(PROFLIB)" != ""
  355. CVOPTS=$(CVOPTS) /Gh
  356. !endif
  357. !if "$(DLL)" == "2"
  358. PDBOPTS=/Fd$(GOAL).pdb
  359. !else
  360. PDBOPTS=/Fd..\lib\$(GOAL).pdb
  361. !endif
  362. !endif
  363. !endif
  364.  
  365. #
  366. # INCREMENTAL options
  367. #
  368. !if "$(INCREMENTAL)" == "1"
  369. INCROPTS=/Gi /Gm
  370. !else
  371. INCROPTS=/Gi- /Gm-
  372. !endif
  373.  
  374. #
  375. # COMPILER OPTIONS
  376. #
  377. !if "$(PLATFORM)" == "INTEL"
  378. CL_OPT=/W4 /WX /Zl /GX /GR $(INCROPTS) $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  379. !endif
  380.  
  381. !if "$(PLATFORM)" == "MIPS"
  382. CL_OPT=/W4 /WX /Zl /GX /GR $(INCROPTS) $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  383. !endif
  384.  
  385. !if "$(PLATFORM)" == "ALPHA"
  386. CL_OPT=/W4 /WX /Zl /GX /GR $(INCROPTS) $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  387. !endif
  388.  
  389. !if "$(PLATFORM)" == "PPC"
  390. CL_OPT=/W4 /WX /Zl /GX /GR $(INCROPTS) $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  391. !endif
  392.  
  393. !if "$(PLATFORM)" == "M68K"
  394. CL_OPT=/W4 /WX /Zl /GX /GR /AL /Gt1 /Q68s $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  395. !endif
  396.  
  397. !if "$(PLATFORM)" == "MPPC"
  398. CL_OPT=/W4 /WX /Zl /GX /GR $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  399. !if "$(MACOCX)" == "1"
  400. DEFS=$(DEFS) /DMACOCX=1
  401. !endif
  402. !endif
  403.  
  404. !if "$(BROWSE)" != "0"
  405. CL_OPT=/FR$D\ $(CL_OPT)
  406. !endif
  407.  
  408. !if "$(BROWSEONLY)" != "0"
  409. CL_OPT=/Zs $(CL_OPT)
  410. !else
  411. CL_OPT=/Fo$D\ $(CL_OPT)
  412. !endif
  413.  
  414. DEFS=$(DEFS) $(DEBDEFS) $(TARGDEFS)
  415.  
  416. #############################################################################
  417. # Library Components
  418.  
  419. OBJECT=$D\objcore.obj $D\except.obj \
  420.     $D\validadd.obj $D\dumpcont.obj $D\dumpflt.obj \
  421.     $D\arccore.obj $D\arcobj.obj $D\arcex.obj \
  422.     $D\arcstrm.obj
  423.  
  424. # non-shared diagnostics
  425. OBJDIAG=$D\dumpinit.obj $D\dumpout.obj \
  426.     $D\afxasert.obj $D\afxmem.obj $D\afxabort.obj
  427.  
  428. FILES=$D\filecore.obj $D\filetxt.obj $D\filemem.obj $D\fileshrd.obj \
  429.     $D\filex.obj $D\filest.obj
  430.  
  431. COLL1=$D\array_b.obj $D\array_d.obj $D\array_p.obj $D\array_o.obj \
  432.     $D\array_s.obj $D\array_u.obj $D\array_w.obj \
  433.     $D\list_o.obj $D\list_p.obj $D\list_s.obj
  434.  
  435. COLL2=$D\map_pp.obj $D\map_pw.obj $D\map_so.obj \
  436.     $D\map_sp.obj $D\map_ss.obj $D\map_wo.obj $D\map_wp.obj $D\plex.obj
  437.  
  438. MISC=\
  439.     $D\strcore.obj $D\strex.obj $D\timecore.obj \
  440.     $D\afxdbcs.obj $D\afxstate.obj $D\afxtls.obj
  441.  
  442. !if "$(MACOS)" != "1"
  443. MISC=$(MISC) $D\mtcore.obj $D\mtex.obj
  444. !endif
  445.  
  446. WINDOWS=\
  447.     $D\wincore.obj $D\winfrm.obj $D\winfrm2.obj $D\winfrmx.obj \
  448.     $D\winmdi.obj $D\tooltip.obj $D\winmini.obj $D\winhand.obj \
  449.     $D\winmain.obj $D\barcore.obj $D\bartool.obj $D\bardlg.obj \
  450.     $D\barstat.obj $D\bardock.obj $D\dockcont.obj $D\dockstat.obj \
  451.     $D\dcprev.obj $D\dcmeta.obj $D\trckrect.obj
  452.  
  453. DIALOG=\
  454.     $D\winctrl1.obj $D\winctrl2.obj $D\winctrl3.obj $D\winctrl4.obj \
  455.     $D\winbtn.obj $D\dlgcore.obj $D\dlgdata.obj $D\dlgfloat.obj \
  456.     $D\dlgprop.obj $D\dlgcomm.obj $D\dlgfile.obj $D\dlgprnt.obj \
  457.     $D\dlgclr.obj $D\dlgfnt.obj $D\dlgfr.obj $D\ccdata.obj $D\dlgtempl.obj
  458.  
  459. WINMISC=\
  460.     $D\wingdi.obj $D\wingdix.obj $D\winstr.obj $D\winmenu.obj \
  461.     $D\auxdata.obj $D\afxcrit.obj $D\afxtrace.obj $D\winutil.obj
  462.  
  463. !if "$(MACOS)" != "1" || "$(MACOCX)" == "1"
  464. WINMISC=$(WINMISC) $D\winocc.obj
  465. !endif
  466.  
  467. DOCVIEW=\
  468.     $D\cmdtarg.obj $D\doccore.obj $D\doctempl.obj \
  469.     $D\docsingl.obj $D\docmulti.obj $D\docmgr.obj \
  470.     $D\viewcore.obj $D\viewprnt.obj $D\winsplit.obj $D\viewscrl.obj \
  471.     $D\viewform.obj $D\viewedit.obj $D\viewprev.obj $D\viewcmn.obj
  472.  
  473. !if "$(MACOS)" != "1"
  474. DOCVIEW=$(DOCVIEW) $D\docmapi.obj
  475. !endif
  476.  
  477. !if "$(MACOS)" != "1"
  478. INTERNET=$D\inet.obj $D\filefind.obj $D\inetimpl.obj
  479. !if "$(UNICODE)" != "1"
  480. INTERNET=$(INTERNET) $D\isapimix.obj
  481. !endif
  482. !endif
  483.  
  484. APPLICATION=\
  485.     $D\thrdcore.obj $D\appcore.obj $D\appinit.obj $D\appterm.obj \
  486.     $D\appui.obj $D\appui2.obj $D\appui3.obj $D\appgray.obj $D\appdlg.obj \
  487.     $D\app3d.obj $D\appprnt.obj $D\apphelp.obj $D\apphelpx.obj \
  488.     $D\filelist.obj
  489.  
  490. !if "$(DLL)" != "2"
  491. APPLICATION=$(APPLICATION) $D\app3ds.obj \
  492.     $D\nolib.obj $D\appmodul.obj $D\dllmodul.obj $D\oleexp.obj
  493. !endif
  494.  
  495. DB=\
  496.     $D\dbcore.obj $D\dbrfx.obj $D\dbview.obj $D\dbflt.obj \
  497.     $D\dblong.obj $D\dbvar.obj
  498.  
  499. !if "$(MACOS)" != "1"
  500. DB=\
  501.     $(DB) $D\daocore.obj $D\daodfx.obj $D\daoview.obj
  502. !endif
  503.  
  504. SOCKETS=$D\sockcore.obj
  505.  
  506. OLEREQ=$D\olelock.obj
  507.  
  508. OLE=\
  509.     $D\oleinit.obj $D\olecli1.obj $D\olecli2.obj \
  510.     $D\olecli3.obj $D\olecnvrt.obj $D\oledobj1.obj $D\oledobj2.obj \
  511.     $D\oledisp1.obj $D\oledisp2.obj $D\oledlgs1.obj $D\oledlgs2.obj \
  512.     $D\oledlgs3.obj $D\oledata.obj \
  513.     $D\oledoc1.obj $D\oledoc2.obj $D\oledrop1.obj $D\oledrop2.obj \
  514.     $D\olemsgf.obj $D\oleenum.obj $D\olefact.obj $D\oleipfrm.obj \
  515.     $D\olelink.obj $D\olemisc.obj $D\olestrm.obj $D\olesvr1.obj \
  516.     $D\olesvr2.obj $D\olereg.obj $D\oletsvr.obj $D\oleui1.obj \
  517.     $D\oleui2.obj $D\oleunk.obj $D\oleverb.obj $D\olecall.obj \
  518.     $D\olevar.obj $D\viewrich.obj $D\oledll.obj $D\oletyplb.obj \
  519.     $D\olemon.obj
  520.  
  521. # OLE control containment, remote automation, and async. monikers
  522. # are not yet supported on Macintosh
  523. !if "$(MACOS)" != "1" || "$(MACOCX)" == "1"
  524. OLE=$(OLE)\
  525.      $D\occmgr.obj $D\occevent.obj $D\occcont.obj $D\occsite.obj \
  526.      $D\occlock.obj $D\occddx.obj $D\occddxf.obj $D\occdlg.obj \
  527.      $D\oledocvw.obj $D\oledocob.obj $D\oledoctg.obj $D\oledocip.obj \
  528. !if "$(MACOS)" != "1"
  529.      $D\oleasmon.obj \
  530. !endif
  531.      $D\olebar.obj
  532. !endif
  533.  
  534. OLECTL=\
  535.     $D\ctlcache.obj $D\ctlcore.obj $D\ctlconn.obj \
  536.     $D\ctldata.obj $D\ctlevent.obj $D\ctlmodul.obj \
  537.     $D\ctlframe.obj $D\ctlfont.obj $D\ctlinplc.obj \
  538.     $D\ctllic.obj $D\oleconn.obj $D\ctlobj.obj $D\ctlpict.obj \
  539.     $D\ctlpropx.obj $D\ctlppg.obj $D\ctlprop.obj \
  540.     $D\ctlpset.obj $D\ctlpstg.obj $D\ctlpstm.obj \
  541.     $D\ctlrefl.obj $D\ctlreg.obj $D\ctltrack.obj \
  542.     $D\ctlview.obj $D\olepset.obj $D\ctlpbag.obj \
  543.     $D\olepro32.obj $D\ctlquick.obj $D\ctlnownd.obj \
  544.     $D\ppgcolor.obj $D\ppgfont.obj $D\ppgpict.obj \
  545.     $D\ppgstock.obj
  546.  
  547. !if "$(DEBUG)" == "1"
  548. OLECTL=$(OLECTL) $D\ctlinl.obj
  549. !endif
  550.  
  551. # DAO is not yet supported on Macintosh
  552. !if "$(MACOS)" == "1"
  553. DAO=
  554. !endif
  555.  
  556. # Sockets are not yet supported on 68K Macintosh
  557. !if "$(PLATFORM)" == "M68K"
  558. SOCKETS=
  559. !endif
  560.  
  561. # WININET isn't available for the Macintosh
  562. # FindFirstFile isn't a good API on the Macintosh
  563. !if "$(MACOS)" == "1"
  564. INTERNET=
  565. !endif
  566.  
  567. !if "$(PLATFORM)" == "ALPHA"
  568. !if "$(DEBUG)" == "1"
  569. OLEASM=.\alpha\olecalld.obj
  570. !else
  571. OLEASM=.\alpha\olecalln.obj
  572. !endif
  573. !endif
  574.  
  575. !if "$(PLATFORM)" == "PPC"
  576. !if "$(DEBUG)" == "1"
  577. OLEASM=.\ppc\olecalld.obj
  578. !else
  579. OLEASM=.\ppc\olecalln.obj
  580. !endif
  581. !endif
  582.  
  583. !if "$(PLATFORM)" == "MPPC"
  584. OLEASM=.\mppc\olecall_.obj
  585. !endif
  586.  
  587. !if "$(PLATFORM)" == "M68K"
  588. OLEASM=.\m68k\olecall_.obj
  589. !endif
  590.  
  591. !if "$(PLATFORM)" == "MPPC" && "$(MACOCX)" != "1"
  592. OLEDLL=$(OLE) $(OLEASM)
  593. !else
  594. OLEDLL=$(OLE) $(OLECTL) $(OLEASM)
  595. !endif
  596.  
  597. !if "$(DEBUG)" == "1"
  598. INLINES = $D\afxinl1.obj $D\afxinl2.obj $D\afxinl3.obj
  599. !else
  600. INLINES =
  601. !endif
  602.  
  603. CPP_OBJS=$(OBJECT) $(OBJDIAG) $(INLINES) $(FILES) $(COLL1) $(COLL2) $(MISC) \
  604.     $(WINDOWS) $(DIALOG) $(WINMISC) $(DOCVIEW) $(APPLICATION) \
  605.     $(SOCKETS) $(OLEREQ) $(OLE) $(DAO) $(DB) $(INTERNET)
  606.  
  607. !if "$(BROWSEONLY)" == "1" && "$(DLL)" == "2"
  608. CPP_OBJS=$(CPP_OBJS) $(OLECTL)
  609. TARGDEFS=$(TARGDEFS) /D_AFX_CORE_IMPL /D_AFX_OLE_IMPL /D_AFX_DB_IMPL /D_AFX_NET_IMPL
  610. !endif
  611.  
  612. OBJS=$(CPP_OBJS) $(OLEASM)
  613.  
  614.  
  615. #############################################################################
  616. # Standard tools
  617.  
  618. #############################################################################
  619. # Set CPPFLAGS for use with .cpp.obj and .c.obj rules
  620. # Define rule for use with OBJ directory
  621. # C++ uses a PCH file
  622.  
  623. CPPFLAGS=$(CPPFLAGS) $(CL_MODEL) $(CL_OPT) $(PDBOPTS) $(DEFS) $(OPT)
  624.  
  625. !ifndef NO_PCH
  626. !ifndef PCH_FILE
  627. PCH_FILE=$D\stdafx
  628. !if "$(BROWSE)" != "0"
  629. PCH_FILE=$(PCH_FILE)b
  630. !endif
  631. PCH_FILE=$(PCH_FILE).pch
  632. !endif
  633. !ifndef PCH_CPP
  634. PCH_CPP=objcore
  635. !endif
  636.  
  637. CPPFLAGS=$(CPPFLAGS) /Yustdafx.h /Fp$(PCH_FILE)
  638. !else
  639. PCH_FILE=
  640. !endif
  641.  
  642. .SUFFIXES:: .cpp
  643.  
  644. .cpp{$D}.obj::
  645.     cl @<<
  646. $(CPPFLAGS) /c $<
  647. <<
  648. !if "$(BROWSE)" != "0"
  649.     copy /b $*.sbr+pchmark.bin $*.sbr >NUL
  650. !endif
  651.  
  652. .cpp{$D}.sbr::
  653.     cl @<<
  654. $(CPPFLAGS) /c $<
  655. <<
  656.     copy /b $*.sbr+pchmark.bin $*.sbr >NUL
  657.  
  658. #############################################################################
  659. # Goals to build
  660.  
  661. GOALS=create.dir
  662. !if "$(BROWSEONLY)" == "0"
  663. GOALS=$(GOALS) ..\lib\$(GOAL).lib
  664. !endif
  665. !if "$(BROWSE)" != "0"
  666. GOALS=$(GOALS) $(GOAL).bsc
  667. !endif
  668.  
  669. goal: $(GOALS)
  670.  
  671. create.dir:
  672.     @-if not exist $D\*.* mkdir $D
  673.  
  674. clean:
  675.     -if exist $D\*.obj erase $D\*.obj
  676.     -if exist $D\*.pch erase $D\*.pch
  677.     -if exist $D\*.res erase $D\*.res
  678.     -if exist $D\*.rsc erase $D\*.rsc
  679.     -if exist $D\*.map erase $D\*.map
  680.     -if not exist $D\*.* rmdir $D
  681.     -if exist ..\lib\$(GOAL).pdb del ..\lib\$(GOAL).pdb
  682.     -if exist ..\lib\$(GOAL).idb del ..\lib\$(GOAL).idb
  683.     -if exist ..\lib\$(GOAL).rep del ..\lib\$(GOAL).rep
  684.     -if exist $(GOAL).pdb del $(GOAL).pdb
  685.     -if exist $(GOAL).idb del $(GOAL).idb
  686.     -if exist $(GOAL).rep del $(GOAL).rep
  687.  
  688. #############################################################################
  689. # Precompiled header file
  690.  
  691. !ifndef NO_PCH
  692.  
  693. !if "$(DEBUG)" == "1"
  694. HDRS =..\include\*.h
  695. !else
  696. HDRS =..\include\*.h ..\include\*.inl
  697. !endif
  698.  
  699. PCH_TARGETS=$(PCH_FILE) $D\$(PCH_CPP).obj
  700. !if "$(BROWSEONLY)" != "0"
  701. PCH_TARGETS=$(PCH_TARGETS) $D\$(PCH_CPP).sbr
  702. !endif
  703.  
  704. $(PCH_TARGETS):: $(PCH_CPP).cpp $(HDRS)
  705.     cl @<<
  706. /Ycstdafx.h /Fp$(PCH_FILE) $(CL_MODEL) $(CL_OPT) $(PDBOPTS) $(DEFS) $(OPT) /c $(PCH_CPP).cpp
  707. <<
  708. !if "$(BROWSE)" != "0"
  709.     copy /b $D\$(PCH_CPP).sbr+pchmark.bin $D\$(PCH_CPP).sbr>NUL
  710. !endif
  711.  
  712. !if "$(BROWSEONLY)" == "1"
  713. $D\$(PCH_CPP).sbr:: $(PCH_CPP).cpp $(PCH_FILE)
  714. !endif
  715.  
  716. !endif # NO_PCH
  717.  
  718. #############################################################################
  719. ## PLATFORM=ALPHA specific target(s)
  720.  
  721. !if "$(PLATFORM)" == "ALPHA"
  722.  
  723. !if "$(DEBUG)" == "1"
  724. ASMOPT=$(ASMOPT) /D_DEBUG /g2
  725. !else
  726. ASMOPT=$(ASMOPT)
  727. !endif
  728.  
  729. $(OLEASM) : alpha\olecall_.s
  730.     asaxp $(ASMOPT) -o $@ alpha\olecall_.s
  731.  
  732. !endif
  733.  
  734. #############################################################################
  735. ## PLATFORM=PPC specific target(s)
  736.  
  737. !if "$(PLATFORM)" == "PPC"
  738.  
  739. !if "$(DEBUG)" == "1"
  740. ASMOPT=$(ASMOPT)
  741. !else
  742. ASMOPT=$(ASMOPT)
  743. !endif
  744.  
  745. $(OLEASM) : ppc\olecall_.s
  746.     pas $(ASMOPT) -o $@ ppc\olecall_.s
  747.  
  748. !endif
  749.  
  750. #############################################################################
  751. ## PLATFORM=M68K specific target(s)
  752.  
  753. !if "$(PLATFORM)" == "M68K"
  754.  
  755. $(OLEASM) : m68k\olecall_.s
  756.     asm68 -S -T -n AFX_DEF -c -o $@ m68k\olecall_.s
  757.  
  758. !endif
  759.  
  760. #############################################################################
  761. ## PLATFORM=MPPC specific target(s)
  762.  
  763. !if "$(PLATFORM)" == "MPPC"
  764.  
  765. $(OLEASM) : mppc\olecall_.s
  766.     asmppc -Fo $@ mppc\olecall_.s
  767.  
  768. !endif
  769.  
  770. #############################################################################
  771. # Build the library from the up-to-date objs
  772.  
  773. SBRS=$(CPP_OBJS:.obj=.sbr)
  774.  
  775. !if "$(BROWSEONLY)" != "0"
  776.  
  777. # Build final browse database
  778. $(GOAL).bsc: $(PCH_TARGETS) $(SBRS)
  779.     bscmake /n /Iu /El /o$@ @<<
  780. $(SBRS)
  781. <<
  782.  
  783. !else #BROWSEONLY
  784.  
  785. !if "$(DLL)" != "2"
  786. # Build final library
  787. ..\lib\$(GOAL).lib: $(PCH_TARGETS) $(OBJS)
  788.     @-if exist $@ erase $@
  789.     @lib /out:$@ @<<
  790. $(OBJS)
  791. <<
  792.  
  793. # Recurse to build browse database
  794. $(GOAL).bsc: $(PCH_TARGETS) $(SBRS)
  795.     $(MAKE) /f makefile. @<<
  796. BROWSEONLY=1 PLATFORM=$(PLATFORM) DEBUG=$(DEBUG) CODEVIEW=$(CODEVIEW) \
  797. DLL=$(DLL) NO_PCH=$(NO_PCH) OBJ=$(OBJ) OPT=$(OPT)
  798. <<
  799. !endif #DLL!=2
  800.  
  801. !endif #!BROWSEONLY
  802.  
  803. #############################################################################
  804.