makefile 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  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-1998 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 are supported.
  67. #
  68. # "INCREMENTAL=1" (defaults to 0)
  69. # This option enables incremental/minimal compilation and
  70. # incremental linking.
  71. #
  72. # Advanced Options:
  73. #
  74. # "MBCS=0" (defaults to 1)
  75. # To build an SBCS library instead of the default (MBCS)
  76. # you can use MBCS=0. This creates a slightly smaller
  77. # library, but the code will not work in far-east markets.
  78. # This option has no effect when UNICODE=1.
  79. #
  80. # "MT=0" (defaults to 1)
  81. # To build a non-multithreaded library instead of the default
  82. # (which enables multitheading and uses the multithread
  83. # C-runtimes) you can use MT=0.
  84. #
  85. #############################################################################
  86. # Define defaults if not defined
  87. # Default PLATFORM depending on host environment
  88. !ifndef PLATFORM
  89. !ifndef PROCESSOR_ARCHITECTURE
  90. PROCESSOR_ARCHITECTURE=x86
  91. !endif
  92. !if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  93. PLATFORM=INTEL
  94. !endif
  95. !if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  96. PLATFORM=MIPS
  97. !endif
  98. !if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  99. PLATFORM=ALPHA
  100. !endif
  101. !if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
  102. PLATFORM=PPC
  103. !endif
  104. !endif
  105. # Default to DEBUG mode
  106. !ifndef DEBUG
  107. DEBUG=1
  108. !endif
  109. # Default to NOT DLL
  110. !ifndef DLL
  111. DLL=0
  112. !endif
  113. # Default Codeview Info
  114. !ifndef CODEVIEW
  115. !if "$(DEBUG)" == "1"
  116. CODEVIEW=1
  117. !else
  118. CODEVIEW=0
  119. !endif
  120. !endif
  121. # BROWSEONLY is default 0 and implies BROWSE=1 if BROWSEONLY=1
  122. !ifndef BROWSEONLY
  123. BROWSEONLY=0
  124. !endif
  125. !if "$(BROWSEONLY)" != "0"
  126. !undef BROWSE
  127. BROWSE=1
  128. !endif
  129. # Default to no BROWSE info
  130. !ifndef BROWSE
  131. BROWSE=0
  132. !endif
  133. # Default to no INCREMENTAL build
  134. !ifndef DEVBUILD
  135. DEVBUILD=0
  136. !endif
  137. !if "$(DEBUG)" != "0"
  138. !ifndef INCREMENTAL
  139. INCREMENTAL=$(DEVBUILD)
  140. !endif
  141. !endif
  142. !ifndef INCREMENTAL
  143. INCREMENTAL=0
  144. !endif
  145. # Default to _MBCS build
  146. !ifndef MBCS
  147. MBCS=1
  148. !endif
  149. # Default to multithreading support
  150. !ifndef MT
  151. MT=1
  152. !endif
  153. #############################################################################
  154. # normalize cases of parameters, or error check
  155. !if "$(CPU)" == "MIPS"
  156. !if "$(PLATFORM)" != "MIPS"
  157. !error Must set PLATFORM=MIPS for MIPS builds
  158. !endif
  159. !endif
  160. !if "$(CPU)" == "ALPHA"
  161. !if "$(PLATFORM)" != "ALPHA"
  162. !error Must set PLATFORM=ALPHA for ALPHA builds
  163. !endif
  164. !endif
  165. BASE=W
  166. #############################################################################
  167. # Parse options
  168. #
  169. # DEBUG OPTIONS
  170. #
  171. !if "$(DEBUG)" != "0"
  172. DEBUGSUF=D
  173. DEBDEFS=/D_DEBUG
  174. DEBOPTS=/Od
  175. !endif
  176. #
  177. # NON-DEBUG OPTIONS
  178. #
  179. !if "$(DEBUG)" == "0"
  180. DEBUGSUF=
  181. DEBDEFS=
  182. !if "$(PLATFORM)" == "INTEL"
  183. DEBOPTS=/O1 /GyF
  184. !endif
  185. !if "$(PLATFORM)" == "MIPS"
  186. DEBOPTS=/O1 /GyF
  187. !endif
  188. !if "$(PLATFORM)" == "ALPHA"
  189. DEBOPTS=/O1 /GyF
  190. !endif
  191. !if "$(PLATFORM)" == "PPC"
  192. DEBOPTS=/O1 /GyF
  193. !endif
  194. !endif
  195. #
  196. # PLATFORM options
  197. #
  198. !if "$(PLATFORM)" == "INTEL"
  199. CL_MODEL=/D_X86_
  200. !endif
  201. !if "$(PLATFORM)" == "MIPS"
  202. CL_MODEL=/D_MIPS_
  203. !endif
  204. !if "$(PLATFORM)" == "ALPHA"
  205. CL_MODEL=/D_ALPHA_
  206. !endif
  207. !if "$(PLATFORM)" == "PPC"
  208. CL_MODEL=/D_PPC_
  209. !endif
  210. !if "$(CL_MODEL)" == ""
  211. !error PLATFORM must be one of INTEL, MIPS, ALPHA, or PPC.
  212. !endif
  213. # TYPE = Library Type Designator
  214. # c = normal C library
  215. # d = DLL library
  216. TYPE=c
  217. DEXT=
  218. #
  219. # Object File Directory
  220. #
  221. !if "$(OBJ)" == ""
  222. D=$$$(MODEL)$(BASE)$(DEBUGSUF)$(DEXT) # subdirectory specific to variant
  223. !else
  224. D=$(OBJ) # User specified directory
  225. !endif
  226. #
  227. # _AFXDLL DLL Variant
  228. #
  229. !if "$(DLL)" == "2"
  230. # _AFXDLL library
  231. TYPE=e
  232. !if "$(OBJ)" == ""
  233. D=DLL$(DEBUGSUF).$(BASE)
  234. !if "$(UNICODE)" == "1"
  235. D=$(MODEL)$D
  236. !endif
  237. D=$$$D
  238. !endif
  239. TARGOPTS=$(TARGOPTS) /MD /D_DLL /GF
  240. !if "$(MT)" != "0"
  241. TARGOPTS=$(TARGOPTS) /D_MT
  242. !endif
  243. TARGDEFS=$(TARGDEFS) /D_WINDLL /D_AFXDLL
  244. !else
  245. # not _AFXDLL library
  246. !if "$(MD)" == "1"
  247. TARGOPTS=$(TARGOPTS) /MD
  248. !else
  249. !if "$(MT)" != "0"
  250. TARGOPTS=$(TARGOPTS) /MT
  251. !endif
  252. !endif
  253. !endif
  254. !if "$(UNICODE)" == "1"
  255. MODEL=U
  256. TARGDEFS=$(TARGDEFS) /D_UNICODE
  257. !else
  258. MODEL=N
  259. !if "$(MBCS)" != "0"
  260. TARGDEFS=$(TARGDEFS) /D_MBCS
  261. !endif
  262. !endif
  263. !if "$(DLL)" == "2" && "$(BROWSEONLY)" != "1"
  264. !if "$(TARG)" == ""
  265. !error DLL=2 is used only from MFCDLL.MAK, MFCOLE.MAK, or MFCDB.MAK
  266. !endif
  267. GOAL=$(TARG)
  268. !else
  269. GOAL=$(MODEL)afx$(TYPE)$(BASE)$(DEBUGSUF)
  270. !endif
  271. #
  272. # CODEVIEW options
  273. #
  274. !if "$(CODEVIEW)" == "1"
  275. !if "$(NO_PDB)" == "1"
  276. CVOPTS=/Z7
  277. !if "$(PROFLIB)" != ""
  278. !error Can't build for profiling without PDB files.
  279. !endif
  280. !else
  281. CVOPTS=/Zi
  282. !if "$(PROFLIB)" != ""
  283. CVOPTS=$(CVOPTS) /Gh
  284. !endif
  285. !if "$(DLL)" == "2"
  286. PDBOPTS=/Fd$(GOAL).pdb
  287. !else
  288. PDBOPTS=/Fd..\lib\$(GOAL).pdb
  289. !endif
  290. !endif
  291. !endif
  292. #
  293. # INCREMENTAL options
  294. #
  295. !if "$(INCREMENTAL)" == "1"
  296. INCROPTS=/Gi /Gm
  297. !else
  298. INCROPTS=/Gi- /Gm-
  299. !endif
  300. #
  301. # COMPILER OPTIONS
  302. #
  303. !if "$(PLATFORM)" == "INTEL"
  304. CL_OPT=/W4 /WX /Zl /GX /GR $(INCROPTS) $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  305. !endif
  306. !if "$(PLATFORM)" == "MIPS"
  307. CL_OPT=/W4 /WX /Zl /GX /GR $(INCROPTS) $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  308. !endif
  309. !if "$(PLATFORM)" == "ALPHA"
  310. CL_OPT=/W4 /WX /Zl /GX /GR $(INCROPTS) $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  311. !endif
  312. !if "$(PLATFORM)" == "PPC"
  313. CL_OPT=/W4 /WX /Zl /GX /GR $(INCROPTS) $(DEBOPTS) $(CVOPTS) $(TARGOPTS)
  314. !endif
  315. !if "$(DEVBUILD)" != "0"
  316. CL_OPT=$(CL_OPT) /D_AFX_DEVBUILD
  317. !endif
  318. !if "$(BROWSE)" != "0"
  319. CL_OPT=/FR$D\ $(CL_OPT)
  320. !endif
  321. !if "$(BROWSEONLY)" != "0"
  322. CL_OPT=/Zs $(CL_OPT)
  323. !else
  324. CL_OPT=/Fo$D\ $(CL_OPT)
  325. !endif
  326. DEFS=$(DEFS) $(DEBDEFS) $(TARGDEFS)
  327. #############################################################################
  328. # Library Components
  329. OBJECT=$D\objcore.obj $D\except.obj \
  330. $D\validadd.obj $D\dumpcont.obj $D\dumpflt.obj \
  331. $D\arccore.obj $D\arcobj.obj $D\arcex.obj \
  332. $D\arcstrm.obj
  333. # non-shared diagnostics
  334. OBJDIAG=$D\dumpinit.obj $D\dumpout.obj \
  335. $D\afxasert.obj $D\afxmem.obj $D\afxabort.obj
  336. FILES=$D\filecore.obj $D\filetxt.obj $D\filemem.obj $D\fileshrd.obj \
  337. $D\filex.obj $D\filest.obj
  338. COLL1=$D\array_b.obj $D\array_d.obj $D\array_p.obj $D\array_o.obj \
  339. $D\array_s.obj $D\array_u.obj $D\array_w.obj \
  340. $D\list_o.obj $D\list_p.obj $D\list_s.obj
  341. COLL2=$D\map_pp.obj $D\map_pw.obj $D\map_so.obj \
  342. $D\map_sp.obj $D\map_ss.obj $D\map_wo.obj $D\map_wp.obj $D\plex.obj
  343. MISC=\
  344. $D\strcore.obj $D\strex.obj $D\timecore.obj \
  345. $D\afxdbcs.obj $D\afxstate.obj $D\afxtls.obj $D\fixalloc.obj \
  346. $D\mtcore.obj $D\mtex.obj
  347. WINDOWS=\
  348. $D\wincore.obj $D\winfrm.obj $D\winfrm2.obj $D\winfrmx.obj \
  349. $D\winmdi.obj $D\tooltip.obj $D\winmini.obj $D\winhand.obj \
  350. $D\winmain.obj $D\barcore.obj $D\bartool.obj $D\bardlg.obj \
  351. $D\barstat.obj $D\bardock.obj $D\dockcont.obj $D\dockstat.obj \
  352. $D\dcprev.obj $D\dcmeta.obj $D\trckrect.obj $D\barcool.obj
  353. DIALOG=\
  354. $D\winctrl1.obj $D\winctrl2.obj $D\winctrl3.obj $D\winctrl4.obj \
  355. $D\winbtn.obj $D\dlgcore.obj $D\dlgdata.obj $D\dlgfloat.obj \
  356. $D\dlgprop.obj $D\dlgcomm.obj $D\dlgfile.obj $D\dlgprnt.obj \
  357. $D\dlgclr.obj $D\dlgfnt.obj $D\dlgfr.obj $D\ccdata.obj \
  358. $D\dlgtempl.obj $D\winctrl6.obj $D\winctrl7.obj
  359. WINMISC=\
  360. $D\wingdi.obj $D\wingdix.obj $D\winstr.obj $D\winmenu.obj \
  361. $D\auxdata.obj $D\afxcrit.obj $D\afxtrace.obj $D\winutil.obj \
  362. $D\winocc.obj
  363. DOCVIEW=\
  364. $D\cmdtarg.obj $D\doccore.obj $D\doctempl.obj \
  365. $D\docsingl.obj $D\docmulti.obj $D\docmgr.obj \
  366. $D\viewcore.obj $D\viewprnt.obj $D\winsplit.obj $D\viewscrl.obj \
  367. $D\viewform.obj $D\viewedit.obj $D\viewprev.obj $D\viewcmn.obj \
  368. $D\docmapi.obj
  369. INTERNET=$D\inet.obj $D\filefind.obj
  370. !if "$(UNICODE)" != "1"
  371. INTERNET=$(INTERNET) $D\isapimix.obj
  372. !endif
  373. APPLICATION=\
  374. $D\thrdcore.obj $D\appcore.obj $D\appinit.obj $D\appterm.obj \
  375. $D\appui.obj $D\appui1.obj $D\appui2.obj $D\appui3.obj $D\appgray.obj \
  376. $D\appdlg.obj $D\app3d.obj $D\appprnt.obj $D\apphelp.obj $D\apphelpx.obj \
  377. $D\filelist.obj
  378. !if "$(DLL)" != "2"
  379. APPLICATION=$(APPLICATION) $D\app3ds.obj \
  380. $D\nolib.obj $D\appmodul.obj $D\dllmodul.obj $D\oleexp.obj $D\dumpstak.obj
  381. !endif
  382. DB=\
  383. $D\dbcore.obj $D\dbrfx.obj $D\dbview.obj $D\dbflt.obj \
  384. $D\dblong.obj $D\dbvar.obj \
  385. $(DB) $D\daocore.obj $D\daodfx.obj $D\daoview.obj $D\viewoled.obj
  386. SOCKETS=$D\sockcore.obj
  387. OLEREQ=$D\olelock.obj
  388. OLE=\
  389. $D\oleinit.obj $D\olecli1.obj $D\olecli2.obj \
  390. $D\olecli3.obj $D\olecnvrt.obj $D\oledobj1.obj $D\oledobj2.obj \
  391. $D\oledisp1.obj $D\oledisp2.obj $D\oledlgs1.obj $D\oledlgs2.obj \
  392. $D\oledlgs3.obj $D\oledata.obj $D\olevar.obj $D\olevar1.obj \
  393. $D\oledoc1.obj $D\oledoc2.obj $D\oledrop1.obj $D\oledrop2.obj \
  394. $D\olemsgf.obj $D\oleenum.obj $D\olefact.obj $D\oleipfrm.obj \
  395. $D\olelink.obj $D\olemisc.obj $D\olestrm.obj $D\olesvr1.obj \
  396. $D\olesvr2.obj $D\olereg.obj $D\oletsvr.obj $D\oleui1.obj \
  397. $D\oleui2.obj $D\oleunk.obj $D\oleverb.obj $D\olecall.obj \
  398. $D\viewrich.obj $D\oledll.obj $D\oletyplb.obj \
  399. $D\olemon.obj $D\winctrl5.obj $D\viewhtml.obj \
  400. $D\occmgr.obj $D\occevent.obj $D\occcont.obj $D\occsite.obj \
  401. $D\occlock.obj $D\occddx.obj $D\occddxf.obj $D\occdlg.obj \
  402. $D\oledocvw.obj $D\oledocob.obj $D\oledoctg.obj $D\oledocip.obj \
  403. $D\oledoccl.obj $D\oleasmon.obj $D\olebar.obj
  404. OLECTL=\
  405. $D\ctlcache.obj $D\ctlcore.obj $D\ctlconn.obj \
  406. $D\ctldata.obj $D\ctlevent.obj $D\ctlmodul.obj \
  407. $D\ctlframe.obj $D\ctlfont.obj $D\ctlinplc.obj \
  408. $D\ctllic.obj $D\oleconn.obj $D\ctlobj.obj $D\ctlpict.obj \
  409. $D\ctlpropx.obj $D\ctlppg.obj $D\ctlprop.obj \
  410. $D\ctlpset.obj $D\ctlpstg.obj $D\ctlpstm.obj \
  411. $D\ctlrefl.obj $D\ctlreg.obj $D\ctltrack.obj \
  412. $D\ctlview.obj $D\olepset.obj $D\ctlpbag.obj \
  413. $D\ctlquick.obj $D\ctlnownd.obj \
  414. $D\ppgcolor.obj $D\ppgfont.obj $D\ppgpict.obj $D\ppgstock.obj
  415. !if "$(DEBUG)" == "1"
  416. OLECTL=$(OLECTL) $D\ctlinl.obj
  417. !endif
  418. !if "$(PLATFORM)" == "ALPHA"
  419. !if "$(DEBUG)" == "1"
  420. OLEASM=.\alpha\olecalld.obj
  421. !else
  422. OLEASM=.\alpha\olecalln.obj
  423. !endif
  424. !endif
  425. !if "$(PLATFORM)" == "PPC"
  426. !if "$(DEBUG)" == "1"
  427. OLEASM=.\ppc\olecalld.obj
  428. !else
  429. OLEASM=.\ppc\olecalln.obj
  430. !endif
  431. !endif
  432. OLEDLL=$(OLE) $(OLECTL) $(OLEASM)
  433. !if "$(DEBUG)" == "1"
  434. INLINES = $D\afxinl1.obj $D\afxinl2.obj $D\afxinl3.obj
  435. !else
  436. INLINES =
  437. !endif
  438. CPP_OBJS=$(OBJECT) $(OBJDIAG) $(INLINES) $(FILES) $(COLL1) $(COLL2) $(MISC) \
  439. $(WINDOWS) $(DIALOG) $(WINMISC) $(DOCVIEW) $(APPLICATION) \
  440. $(SOCKETS) $(OLEREQ) $(OLE) $(DAO) $(DB) $(INTERNET) $(OLECTL)
  441. !if "$(BROWSEONLY)" == "1" && "$(DLL)" == "2"
  442. TARGDEFS=$(TARGDEFS) /D_AFX_CORE_IMPL /D_AFX_OLE_IMPL /D_AFX_DB_IMPL /D_AFX_NET_IMPL
  443. !endif
  444. OBJS=$(CPP_OBJS) $(OLEASM)
  445. #############################################################################
  446. # Standard tools
  447. #############################################################################
  448. # Set CPPFLAGS for use with .cpp.obj and .c.obj rules
  449. # Define rule for use with OBJ directory
  450. # C++ uses a PCH file
  451. CPPFLAGS=$(CPPFLAGS) $(CL_MODEL) $(CL_OPT) $(PDBOPTS) $(DEFS) $(OPT)
  452. !ifndef NO_PCH
  453. !ifndef PCH_FILE
  454. PCH_FILE=$D\stdafx
  455. !if "$(BROWSE)" != "0"
  456. PCH_FILE=$(PCH_FILE)b
  457. !endif
  458. PCH_FILE=$(PCH_FILE).pch
  459. !endif
  460. !ifndef PCH_CPP
  461. PCH_CPP=objcore
  462. !endif
  463. CPPFLAGS=$(CPPFLAGS) /Yustdafx.h /Fp$(PCH_FILE)
  464. !else
  465. PCH_FILE=
  466. !endif
  467. .SUFFIXES:: .cpp
  468. !if "$(BROWSE)" != "0"
  469. .cpp{$D}.obj:
  470. cl @<<
  471. $(CPPFLAGS) /c $<
  472. <<
  473. copy /b $*.sbr+pchmark.bin $*.sbr >NUL
  474. !else
  475. .cpp{$D}.obj::
  476. cl @<<
  477. $(CPPFLAGS) /c $<
  478. <<
  479. !endif
  480. .cpp{$D}.sbr:
  481. cl @<<
  482. $(CPPFLAGS) /c $<
  483. <<
  484. copy /b $*.sbr+pchmark.bin $*.sbr >NUL
  485. #############################################################################
  486. # Goals to build
  487. GOALS=create.dir
  488. !if "$(BROWSEONLY)" == "0"
  489. GOALS=$(GOALS) ..\lib\$(GOAL).lib
  490. !endif
  491. !if "$(BROWSE)" != "0"
  492. GOALS=$(GOALS) $(GOAL).bsc
  493. !endif
  494. goal: $(GOALS)
  495. create.dir:
  496. @-if not exist $D\*.* mkdir $D
  497. clean:
  498. -if exist $D\*.obj erase $D\*.obj
  499. -if exist $D\*.pch erase $D\*.pch
  500. -if exist $D\*.res erase $D\*.res
  501. -if exist $D\*.rsc erase $D\*.rsc
  502. -if exist $D\*.map erase $D\*.map
  503. -if not exist $D\*.* rmdir $D
  504. -if exist ..\lib\$(GOAL).pdb del ..\lib\$(GOAL).pdb
  505. -if exist ..\lib\$(GOAL).idb del ..\lib\$(GOAL).idb
  506. -if exist ..\lib\$(GOAL).rep del ..\lib\$(GOAL).rep
  507. -if exist $(GOAL).pdb del $(GOAL).pdb
  508. -if exist $(GOAL).idb del $(GOAL).idb
  509. -if exist $(GOAL).rep del $(GOAL).rep
  510. #############################################################################
  511. # Precompiled header file
  512. !ifndef NO_PCH
  513. !if "$(DEBUG)" == "1"
  514. HDRS =..\include\*.h
  515. !else
  516. HDRS =..\include\*.h ..\include\*.inl
  517. !endif
  518. PCH_TARGETS=$(PCH_FILE) $D\$(PCH_CPP).obj
  519. !if "$(BROWSEONLY)" != "0"
  520. PCH_TARGETS=$(PCH_TARGETS) $D\$(PCH_CPP).sbr
  521. !endif
  522. $(PCH_TARGETS):: $(PCH_CPP).cpp $(HDRS)
  523. cl @<<
  524. /Ycstdafx.h /Fp$(PCH_FILE) $(CL_MODEL) $(CL_OPT) $(PDBOPTS) $(DEFS) $(OPT) /c $(PCH_CPP).cpp
  525. <<
  526. !if "$(BROWSE)" != "0"
  527. copy /b $D\$(PCH_CPP).sbr+pchmark.bin $D\$(PCH_CPP).sbr>NUL
  528. !endif
  529. !if "$(BROWSEONLY)" == "1"
  530. $D\$(PCH_CPP).sbr:: $(PCH_CPP).cpp $(PCH_FILE)
  531. !endif
  532. !endif # NO_PCH
  533. #############################################################################
  534. ## PLATFORM=ALPHA specific target(s)
  535. !if "$(PLATFORM)" == "ALPHA"
  536. !if "$(DEBUG)" == "1"
  537. ASMOPT=$(ASMOPT) /D_DEBUG /g2
  538. !else
  539. ASMOPT=$(ASMOPT)
  540. !endif
  541. $(OLEASM) : alpha\olecall_.s
  542. asaxp $(ASMOPT) -o $@ alpha\olecall_.s
  543. !endif
  544. #############################################################################
  545. ## PLATFORM=PPC specific target(s)
  546. !if "$(PLATFORM)" == "PPC"
  547. !if "$(DEBUG)" == "1"
  548. ASMOPT=$(ASMOPT)
  549. !else
  550. ASMOPT=$(ASMOPT)
  551. !endif
  552. $(OLEASM) : ppc\olecall_.s
  553. pas $(ASMOPT) -o $@ ppc\olecall_.s
  554. !endif
  555. #############################################################################
  556. # Build the library from the up-to-date objs
  557. SBRS=$(CPP_OBJS:.obj=.sbr)
  558. !if "$(BROWSEONLY)" != "0"
  559. # Build final browse database
  560. $(GOAL).bsc: $(PCH_TARGETS) $(SBRS)
  561. bscmake /n /Iu /El /o$@ @<<
  562. $(SBRS)
  563. <<
  564. !else #BROWSEONLY
  565. !if "$(DLL)" != "2"
  566. # Build final library
  567. ..\lib\$(GOAL).lib: $(PCH_TARGETS) $(OBJS)
  568. @-if exist $@ erase $@
  569. @lib /out:$@ @<<
  570. $(OBJS)
  571. <<
  572. # Recurse to build browse database
  573. $(GOAL).bsc: $(PCH_TARGETS) $(SBRS)
  574. $(MAKE) /f makefile. @<<
  575. BROWSEONLY=1 PLATFORM=$(PLATFORM) DEBUG=$(DEBUG) CODEVIEW=$(CODEVIEW) \
  576. DLL=$(DLL) NO_PCH=$(NO_PCH) OBJ=$(OBJ) OPT=$(OPT)
  577. <<
  578. !endif #DLL!=2
  579. !endif #!BROWSEONLY
  580. #############################################################################