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.

2683 lines
61 KiB

  1. ############################################################################
  2. #
  3. # Microsoft Windows
  4. # Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. #
  6. # File: makefile.inc
  7. #
  8. # Contents: Main project makefile
  9. #
  10. # History:
  11. #
  12. #
  13. ############################################################################
  14. #** Make include file
  15. #
  16. # Definitions for compiler
  17. #
  18. # GCFLAGS - additional flags for the C compiler, intended only
  19. # to be used for global changes. DONT EVER PUT THIS
  20. # IN A MAKEFILE.
  21. # GAFLAGS - Same as GCFLAGS, but for the assembler.
  22. #
  23. #
  24. # -------------------- Build Type Control ------------------------------------
  25. #
  26. # The "build type" determines what kind of internal checking is done.
  27. # Turning on checking allows for catching more internal
  28. # consistency errors, but slows the system down.
  29. #
  30. # Mechanically, one changes the build type the makefile is set for by
  31. # editing the makefile to comment in or out the OBFLAGS line of interest.
  32. # (Separate entry points cannot easily be used for this, this is a failing
  33. # of make. That's why you have to edit the makefile.)
  34. #
  35. #
  36. ############################################################################
  37. #
  38. # Default target is "all"
  39. #
  40. default: all
  41. ############################################################################
  42. #
  43. # Suffixes for inference rules
  44. #
  45. .SUFFIXES:
  46. .SUFFIXES: .idl .tdl .tlb .dll .h .inc .exe .obj .lst .cod .cxx .cpp
  47. .SUFFIXES: .c .s .lrf .lnk .map .sym .rc .lib .def .res .dgn .rtf .y .mc
  48. .SUFFIXES: .i .ico .bmp .dlg .cur .cx2 .c2 .rc2 .hxx .pas .for .cbl .bas
  49. ##################################################
  50. # TGTDIR, OBJDIR selection
  51. #
  52. # Each build type stores obj files and built binaries in a different
  53. # directory below the source or distribution tree. Current directory
  54. # naming convention is:
  55. #
  56. # TGTDIR=OBJ<p><o><b>
  57. # OBJDIR=OBJ<p><o><b>
  58. #
  59. # <p>: i = i386
  60. # m = MIPS
  61. # a = ALPHA
  62. # 2 = i286
  63. #
  64. # <o>: d = DOS
  65. # 1 = NT 1.x
  66. # n = NT 2.0 (Cairo)
  67. # o = OS/2
  68. # w = Win16 (used when targeting Win32s)
  69. #
  70. # <b>: r = Retail
  71. # d = Debug
  72. # p = Profile (Retail with debug info)
  73. # <Nothing> = Release
  74. #
  75. # TGTEXT/RDEXT selection for MULTIDEPEND != ""
  76. # Each build type stores depend.mk files with a different last character
  77. # in the extension, as in "mk?". Current extension convention is:
  78. # <1>: NT 2.0 x86
  79. # <3>: Chicago
  80. # <5>: NT 2.0 MIPS
  81. # <7>: NT 2.0 Alpha
  82. # <9>: Win 3.1
  83. # <a>: Dos 5.0
  84. # <c>: OS/2 1.x
  85. # <e>: NTKERNEL x86
  86. # <g>: NTKERNEL MIPS
  87. # <h>: NTKERNEL Alpha
  88. # <j>: Win32s
  89. # <k>: NT 1.x x86
  90. # <l>: NT 1.x MIPS
  91. # <m>: NT 1.x Alpha
  92. #
  93. # As you can see the scheme gets a bit cumbersome, so if you define
  94. # MULTIDEPEND == MERGED then similar systems use the same letter, so:
  95. # <1>: NT 2.0 all
  96. # <3>: NT 1.x all, Chicago, Win32s
  97. # <9>: Win 3.1
  98. # <a>: Dos 5.0
  99. # <c>: OS/2 1.x
  100. # <e>: NTKERNEL all
  101. OBJDIR=
  102. TGTDIR=
  103. TGTEXT=
  104. RDEXT=
  105. # set BUILDTYPE based on NTDEBUG setting
  106. # bugbug need to base on settings in makefile.def
  107. #
  108. !if "$(NTDEBUG)" == "retail"
  109. BUILDTYPE=RELEASE
  110. !else
  111. !if "$(NTDEBUG)" == "ntsdnodbg"
  112. BUILDTYPE=RELEASE
  113. !else
  114. BUILDTYPE=DEBUG
  115. !endif
  116. !endif
  117. !ifndef _NTROOT
  118. _NTROOT=\nt
  119. !endif
  120. !ifndef BASEDIR
  121. BASEDIR=$(_NTDRIVE)$(_NTROOT)
  122. !endif
  123. !if "$(OPSYS)"==""
  124. OPSYS=NT
  125. !endif
  126. !if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  127. PLAT = i
  128. PLATFORM=I386
  129. !elseif "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  130. PLAT = m
  131. PLATFORM=MIPS
  132. !elseif "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  133. PLAT = a
  134. PLATFORM=ALPHA
  135. !else
  136. !error Unknown PROCESSOR_ARCHITECTURE setting "$(PROCESSOR_ARCHITECTURE)"
  137. !endif
  138. !if "$(BUILDTYPE)" == "DEBUG"
  139. BLDT = d
  140. !elseif "$(BUILDTYPE)" == "RETAIL"
  141. BLDT = r
  142. !elseif "$(BUILDTYPE)" == "PROFILE"
  143. BLDT = p
  144. !elseif "$(BUILDTYPE)" == "RELEASE"
  145. BLDT =
  146. !else
  147. !error Unknown BUILDTYPE setting "$(BUILDTYPE)"
  148. !endif
  149. # DavidBak hack
  150. !if "$(PERFSNAP)" == "1"
  151. BLDT = p
  152. !endif
  153. !if "$(OPSYS)" == "NT" || "$(OPSYS)" == "NTKERNEL"
  154. OPST = n
  155. !elseif "$(OPSYS)" == "DOS"
  156. OPST = d
  157. !elseif "$(OPSYS)" == "DOS5"
  158. OPST = 5
  159. !elseif "$(OPSYS)" == "OS2"
  160. OPST = o
  161. !elseif "$(OPSYS)" == "WIN16"
  162. OPST = w
  163. !elseif "$(OPSYS)" == "NT1X"
  164. OPST = 1
  165. !else
  166. !error Unknown OPSYS setting "$(OPSYS)"
  167. !endif
  168. OBJDIR = OBJ\$(PLATFORM)
  169. TGTDIR = OBJ\$(PLATFORM)
  170. !if "$(MULTIDEPEND)" == "MERGED"
  171. ! if "$(OPSYS)" == "NT"
  172. DEXT = 1
  173. ! endif
  174. !else # !MERGED
  175. ! if "$(OPSYS)" == "NT"
  176. PLATDIR=DAYTONA
  177. ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  178. DEXT = 1
  179. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  180. DEXT = 5
  181. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  182. DEXT = 7
  183. ! endif
  184. ! elseif "$(OPSYS)" == "NTKERNEL"
  185. ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  186. DEXT = e
  187. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  188. DEXT = g
  189. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  190. DEXT = h
  191. ! endif
  192. ! elseif "$(OPSYS)" == "DOS" && "$(PROCESSOR_ARCHITECTURE)" == "i286"
  193. DEXT = 9
  194. ! elseif "$(OPSYS)" == "DOS5"
  195. DEXT = a
  196. ! elseif "$(OPSYS)" == "OS2"
  197. DEXT = c
  198. ! elseif "$(OPSYS)" == "NT1X"
  199. PLATDIR=DAYTONA
  200. ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  201. DEXT = k
  202. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  203. DEXT = l
  204. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  205. DEXT = m
  206. ! endif
  207. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "x86" && "$(OPSYS)" == "WIN16"
  208. DEXT = j
  209. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "x86" && "$(OPSYS)" == "DOS"
  210. DEXT = 3
  211. ! endif
  212. !endif
  213. #bugbug, what about chicago platform
  214. RDEXT = $(DEXT)
  215. TGTEXT = $(DEXT)
  216. ####################################################################################
  217. #
  218. #
  219. #
  220. #
  221. RELEASE_BIN=
  222. !IFDEF NTDBGFILES
  223. ! IF "$(PROCESSOR_ARCHITECTURE)" == "x86"
  224. BINPLACE_FLAGS=-s $(_NT386TREE)\Symbols
  225. ! ELSE
  226. ! IF "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  227. BINPLACE_FLAGS=-s $(_NTMIPSTREE)\Symbols
  228. ! ELSE
  229. ! IF "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  230. BINPLACE_FLAGS=-s $(_NTALPHATREE)\Symbols
  231. ! ENDIF
  232. ! ENDIF
  233. ! ENDIF
  234. !ELSE
  235. BINPLACE_FLAGS=
  236. !ENDIF
  237. # The xxxTREE macros are set in the razzle cmd window.
  238. # for cairo builds cairoxxxxxx macros will be set.
  239. !ifdef CAIRO_PRODUCT
  240. !ifdef _CAIROMIPSTREE
  241. _NTMIPSTREE=$(_CAIROMIPSTREE)
  242. !endif
  243. !ifdef _CAIRO386TREE
  244. _NT386TREE=$(_CAIRO386TREE)
  245. !endif
  246. !ifdef _CAIROALPHATREE
  247. _NTALPHATREE=$(_CAIROALPHATREE)
  248. !endif
  249. !endif
  250. !ifdef _NTMIPSTREE
  251. RELEASE_BIN=TRUE
  252. !endif
  253. !ifdef _NT386TREE
  254. RELEASE_BIN=TRUE
  255. !endif
  256. !ifdef _NTALPHATREE
  257. RELEASE_BIN=TRUE
  258. !endif
  259. !ifndef BUILDDETAIL
  260. BUILDDETAIL = quiet
  261. !endif
  262. !if "$(BUILDDETAIL)" == "FULL" || "$(BUILDDETAIL)" == "full"
  263. COMPLOGO =
  264. COMPRESP = KEEP
  265. LINKLOGO =
  266. LINKRESP = KEEP
  267. !endif
  268. !if "$(BUILDDETAIL)" == "KEEPCOMP" || "$(BUILDDETAIL)" == "keepcomp"
  269. COMPLOGO =
  270. COMPRESP = KEEP
  271. LINKLOGO = -nologo
  272. LINKRESP = NOKEEP
  273. !endif
  274. !if "$(BUILDDETAIL)" == "KEEPLINK" || "$(BUILDDETAIL)" == "keeplink"
  275. COMPLOGO = -nologo
  276. COMPRESP = NOKEEP
  277. LINKLOGO =
  278. LINKRESP = KEEP
  279. !endif
  280. !if "$(BUILDDETAIL)" == "QUIET" || "$(BUILDDETAIL)" == "quiet"
  281. COMPLOGO = -nologo
  282. COMPRESP = NOKEEP
  283. LINKLOGO = -nologo
  284. LINKRESP = NOKEEP
  285. !endif
  286. !if "$(NOLOGOS)" != ""
  287. COMPLOGO = -nologo
  288. LINKLOGO = -nologo
  289. !endif
  290. ######################################################################
  291. # Destination for messages
  292. !ifdef NOTIME
  293. TIMESTR=
  294. ATSTR=
  295. !else
  296. TIMESTR=/H:M:S
  297. ATSTR=at
  298. !endif
  299. !ifndef OUTPUT
  300. ! ifdef BUILDQUIET
  301. OUTPUT= >nul
  302. ! else
  303. OUTPUT=
  304. ! endif
  305. !endif
  306. #
  307. # DOS doesn't let us redirect stderr output, so we use the following define
  308. # to unify our output.
  309. #
  310. !if "$(HOST)" != "DOS"
  311. OUTNUL= 1>nul 2>nul
  312. !else
  313. OUTNUL=
  314. !endif
  315. !ifndef OUTFIX
  316. OUTFIX = $(OUTNUL)
  317. !endif
  318. ######################################################################
  319. #
  320. # Set location to locate tools
  321. # Empty toolpath so it can be used to check for invalid host type
  322. TOOLPATH=
  323. SDKTOOLPATH=
  324. !if "$(HOST)" == ""
  325. HOST = NT
  326. !endif
  327. HOSTBIN = .
  328. ######################################################################
  329. #
  330. # Set location to copy include files
  331. HCOPY= ..\oleprx32\daytona
  332. LIBCP=
  333. SEDHCOPY= ..\oleprx32\daytona
  334. ######################################################################
  335. #
  336. # Misc tool defines
  337. AWK= awk.exe
  338. CAT= cat.exe
  339. CHMODE= chmode.exe
  340. CLASSGEN= classgen
  341. CMP= fcom.exe
  342. COFF= link32
  343. COPY= copy /v
  344. CP= $(COPY)
  345. CTCOPY= xcopy /v /i
  346. CVPACK= cvpack.exe
  347. DEL= del
  348. CVTRES= cvtres.exe
  349. DOCGEN= docgen.exe
  350. ECH= ech.exe
  351. ECHOTIME= echotime
  352. FLEX= flex.exe
  353. GENLRF= genlrf.exe
  354. GENORD= genord.exe
  355. IN= $(SLMTOOLS)\in.exe
  356. INCLUDES= includes.exe
  357. MAPSYM= mapsym.exe
  358. MC= mc.exe
  359. MIDL= midl
  360. MKHEADER= mkheader
  361. MKTMPLAT= mktmplat
  362. MKTYPLIB= mktyplib
  363. MUNGE= munge.exe
  364. OUT= out.exe
  365. RC= rc
  366. REGTLB= regtlb.exe
  367. SED= sed.exe
  368. SIFTTOOL= sifttool.exe
  369. SORT= sort.exe
  370. SPLITSYM= splitsym.exe
  371. TOUCH= touch.exe
  372. UNIQ= uniq.exe
  373. UNREGTLB= unregtlb.exe
  374. YACC= yacc.exe
  375. IMPORTNT = $(SDK_PATH)
  376. TYPESDIR = $(BASEDIR)\private\oleutest\balls
  377. SCRIPTS = $(BASEDIR)\private\oleutest\balls
  378. CAIROINC = $(BASEDIR)\private\cinc
  379. BASEINC =$(TYPESDIR)\idl
  380. PROXYINC =$(TYPESDIR)\oleprx32\$(PLATDIR)
  381. ############################################################################
  382. #
  383. # Object files and resource files
  384. #
  385. CXX_OBJS=$(CXXFILES:.cxx=.obj)
  386. CXX_OBJS=$(CXX_OBJS) $(CPPFILES:.cpp=.obj)
  387. C_OBJS=$(CFILES:.c=.obj)
  388. RESFILES = $(RCFILES:.rc=.res)
  389. TYPELIBS = $(TDLFILES:.tdl=.tlb)
  390. MKHDR_H_FILES = $(TDLFILES:.tdl=.h)
  391. MKHDR_C_FILES = $(TDLFILES:.tdl=.c)
  392. MIDL_INCS=$(IDLFILES:.idl=.h)
  393. MIDL_PROXYS=$(IDLFILES:.idl=.h)
  394. # Hack alert:
  395. #
  396. # We want to use $(OBJDIR) in the replacement string, like this:
  397. #
  398. # CXX_OBJS = $(CXX_OBJS:.\=$(OBJDIR)\)
  399. #
  400. # Unfortunately, nmake wants no part of it. As a workaround, we test for
  401. # each known value of $(OBJDIR) and perform the individual substitution
  402. # for each.
  403. !if "$(MKHEADER_OUT_DIR)"==""
  404. MKHEADER_OUT_DIR=$(TYPESDIR)\oleprx32\$(PLATDIR)\
  405. !endif
  406. !if "$(MIDL_OUT_DIR)"==""
  407. MIDL_PROXYS=$(MIDL_PROXYS:.\=..\oleprx32\daytona\)
  408. MIDL_INCS=$(MIDL_INCS:.\=..\oleprx32\daytona\)
  409. MKHDR_H_FILES=$(MKHDR_H_FILES:.\=..\oleprx32\daytona\)
  410. MKHDR_C_FILES=$(MKHDR_C_FILES:.\=..\oleprx32\daytona\)
  411. MIDL_HDR_OUT_DIR=..\oleprx32\daytona
  412. !else
  413. MIDL_INCS=$(MIDL_INCS:.\=..\oleprx32\daytona\)
  414. MIDL_HDR_OUT_DIR=..\oleprx32\daytona
  415. !endif
  416. !if "$(MIDL_OUT_DIR)"==""
  417. MIDL_OUT_DIR=..\oleprx32\$(PLATDIR)
  418. MIDL_HDR_OUT_DIR=..\oleprx32\daytona
  419. !endif
  420. !if "$(OBJDIR)" == "OBJ\I386"
  421. CXX_OBJS = $(CXX_OBJS:.\=.\OBJ\I386\)
  422. C_OBJS = $(C_OBJS:.\=.\OBJ\I386\)
  423. RESFILES = $(RESFILES:.\=OBJ\I386\)
  424. TYPELIBS = $(TYPELIBS:.\=.\OBJ\i386\)
  425. ! elseif "$(OBJDIR)" == "OBJ\MIPS"
  426. CXX_OBJS = $(CXX_OBJS:.\=.\OBJ\MIPS\)
  427. C_OBJS = $(C_OBJS:.\=.\OBJ\MIPS\)
  428. RESFILES = $(RESFILES:.\=OBJ\MIPS\)
  429. TYPELIBS = $(TYPELIBS:.\=.\OBJ\MIPS\)
  430. ! elseif "$(OBJDIR)" == "OBJ\ALPHA"
  431. CXX_OBJS = $(CXX_OBJS:.\=.\OBJ\ALPHA\)
  432. C_OBJS = $(C_OBJS:.\=.\OBJ\ALPHA\)
  433. RESFILES = $(RESFILES:.\=OBJ\ALPHA\)
  434. TYPELIBS = $(TYPELIBS:.\=.\OBJ\ALPHA\)
  435. ! else
  436. ! error Unknown object directory: $(OBJDIR)
  437. !endif # $(OBJDIR)
  438. ############################################################################
  439. # Rules for generating .h, and .rc files from .mc files.
  440. #
  441. #
  442. #
  443. #
  444. # bugbug, what about chicago builds?
  445. # bugbug, maybe we should use other variable besides
  446. # MIDL_OUT_DIR to determine which directory to generate
  447. # message flies in.
  448. !if "$(MESSAGE_FILES)" != ""
  449. MCRESOURCE=$(MESSAGE_FILES:.mc=.rc)
  450. MESSAGE_H_FILES=$(MESSAGE_FILES:.mc=.h)
  451. !if "$(PLATDIR)" == "DAYTONA"
  452. MESSAGE_H_FILES=$(MESSAGE_H_FILES:.\=..\..\..\..\public\sdk\inc\)
  453. MC_OUT_DIR=..\..\..\..\public\sdk\inc
  454. !endif
  455. !if "$(OBJDIR)" == "OBJ\I386"
  456. MCRESOURCE = $(MCRESOURCE:.\=.\OBJ\I386\)
  457. !elseif "$(OBJDIR)"== "OBJ\MIPS"
  458. MCRESOURCE = $(MCRESOURCE:.\=.\OBJ\MIPS\)
  459. !elseif "$(OBJDIR)"== "OBJ\ALPHA"
  460. MCRESOURCE = $(MCRESOURCE:.\=.\OBJ\ALPHA\)
  461. !else
  462. !error Uknown object directory : $(OBJDIR)
  463. !endif
  464. MCBIN= $(OBJDIR)\msg00001.bin
  465. all: $(MESSAGE_H_FILES)
  466. .mc{$(MC_OUT_DIR)}.h:
  467. @echo Building $< $(OUTPUT)
  468. @-md $(OBJDIR) $(OUTNUL)
  469. $(MC) $(MCFLAGS) $< -h $(HCOPY) $(OUTPUT)
  470. !if "$(OPSYS)"=="NT1X" && "$(NORELEASE_CHICAGO)"==""
  471. @-md $(HCOPY)\chicago $(OUTNUL)
  472. @echo Build_Status Releasing $(@B).h files to $(HCOPY)\chicago
  473. $(COPY) $(HCOPY)\$(@B).h $(HCOPY)\chicago $(OUTNUL)
  474. !endif
  475. clean: cleancomp
  476. -$(DEL) $(MESSAGE_H_FILES:.mc=.h) $(MCRESOURCE) $(MCBIN) $(OUTNUL)
  477. !endif
  478. ############################################################################
  479. #
  480. # Rules for generating .tlb, .hxx and .cxx files from .tdl files
  481. # These should be before any target rules, to force code
  482. # generation before compiling.
  483. #
  484. !if "$(TDLFILES)" != ""
  485. all: $(TYPELIBS)
  486. .tdl{$(OBJDIR)}.tlb:
  487. @-md $(OBJDIR) $(OUTNUL)
  488. $(MKTYPLIB) $(MKTYPLIBFLAGS) $(CINC) $(TLBDIRS) -tlb$@ $<
  489. $(MKHEADER) $(MKHEADERFLAGS) -o $(HCOPY)\$(@B).h -u $(MKHEADER_OUT_DIR)\$(@B).c -x $(@)
  490. $(REGTLB) $@
  491. $(TDLFILES): $(IDLFILES)
  492. DEPENDFILES = $(TYPELIBS) $(MKHDR_H_FILES) $(MKHDR_C_FILES) $(DEPENDFILES)
  493. TYPELIBS = $(TYPELIBS:.\=)
  494. CLEANFILES = $(CLEANFILES) $(TYPELIBS) $(MKHDR_H_FILES) $(MKHDR_C_FILES)
  495. !endif
  496. ############################################################################
  497. #
  498. # Generate .h and .c files from .idl files
  499. # 1
  500. # NOTE: this rule should appear before any target rules, to force
  501. # idl-to-h translation to happen first.
  502. !if "$(IDLFILES)" != ""
  503. all: $(MIDL_INCS)
  504. clean: cleanidl
  505. #
  506. # Due to command line limitations (yes, even NT has them), we write a script
  507. # to delete the idl output files.
  508. #
  509. cleanidl:
  510. @type << | $(SED) -f << > idlclean.bat
  511. $(MIDL_INCS:.h=.h
  512. )
  513. $(MIDL_PROXYS:.h=_?.c
  514. )
  515. $(MIDL_PROXYS:.h=_?.cxx
  516. )
  517. $(MIDL_PROXYS:.h=_?.h
  518. )
  519. $(MIDL_PROXYS:.h=_?.hxx
  520. )
  521. <<NOKEEP
  522. 1i\
  523. \@echo off \
  524. \@echo Build_Status Deleting MIDL output files...
  525. /\./!d
  526. s/^/del /g
  527. s/$$/ $(OUTNUL)/g
  528. <<NOKEEP
  529. @-idlclean.bat
  530. @-$(DEL) idlclean.bat $(OUTNUL)
  531. DEPENDFILES = $(DEPENDFILES) $(MIDL_INCS)
  532. !endif # IDLFILES
  533. ##################################################################
  534. #
  535. # Rules to build the composite .h file from midl generated files #
  536. #
  537. #
  538. !if "$(ITFS_BASE)" != "" && "$(ITFS_DIR)" != ""
  539. ITFS_H = $(ITFS_BASE).h
  540. all: $(ITFS_DIR)\$(ITFS_H)
  541. $(ITFS_DIR)\$(ITFS_H): $(MIDL_INCS) $(ITFS_BASE).x $(ITFS_BASE).y
  542. @echo Build_Status Building $(ITFS_DIR)\$(ITFS_H) ...
  543. @del $(ITFS_DIR)\$(ITFS_H) $(OUTNUL)
  544. #
  545. # Add the file header and base #includes.
  546. #
  547. @type $(ITFS_BASE).x >> $(ITFS_DIR)\$(ITFS_H)
  548. @echo @echo off > copyall.cmd
  549. @echo cd $(ITFS_DIR)\ >> copyall.cmd
  550. @type << | $(SED) -f << >> copyall.cmd
  551. $(BASE_HFILES: =
  552. )
  553. <<NOKEEP
  554. /\./!d
  555. s/\.\\//g
  556. s/^/\@sed -e \"\/^\#include\/d\" -e \"\/\\\/\\\/ File\\\:\/d" /g
  557. s/$$/ \>\> $(ITFS_H)/g
  558. <<NOKEEP
  559. @echo cd $(MAKEDIR) >> copyall.cmd
  560. @copyall.cmd
  561. @del copyall.cmd
  562. #
  563. # Copy the initial forward declarations from all the derived h files.
  564. #
  565. @type << >> $(ITFS_DIR)\$(ITFS_H)
  566. // Forward declarations for typedefs in this file
  567. <<NOKEEP
  568. @type << > $(ITFS_DIR)\forward.sed
  569. /\/\* Forward Declarations \*\// {
  570. N
  571. s/\/\* Forward Declarations \*\/\ntypedef/xtypedef/
  572. }
  573. /xtypedef/!d
  574. s/xtypedef/typedef/
  575. <<NOKEEP
  576. @echo @echo off > forward.cmd
  577. @echo cd $(ITFS_DIR) >> forward.cmd
  578. @type << | $(SED) -f << >> forward.cmd
  579. $(DERIVED_HFILES: =
  580. )
  581. <<NOKEEP
  582. /\./!d
  583. s/\.\\//g
  584. s/^/\@sed -f forward.sed /g
  585. s/$$/ \>\> $(ITFS_H)/g
  586. <<NOKEEP
  587. @echo cd $(MAKEDIR) >> forward.cmd
  588. @forward.cmd
  589. @del forward.cmd
  590. @del $(ITFS_DIR)\forward.sed $(OUTNUL)
  591. #
  592. # Copy the derived h files in. Strip off any #includes along the way.
  593. #
  594. @echo @echo off > copyall.cmd
  595. @echo cd $(ITFS_DIR)\ >> copyall.cmd
  596. @type << | $(SED) -f << >> copyall.cmd
  597. $(DERIVED_HFILES: =
  598. )
  599. <<NOKEEP
  600. /\./!d
  601. s/\.\\//g
  602. s/^/\@sed -e \"\/^\#include\/d\" -e \"\/\\\/\\\/ File\\\:\/d" /g
  603. s/$$/ \>\> $(ITFS_H)/g
  604. <<NOKEEP
  605. @echo cd $(MAKEDIR) >> copyall.cmd
  606. @copyall.cmd
  607. @del copyall.cmd
  608. #
  609. # Append API prototypes to the end of the file
  610. #
  611. @type $(ITFS_BASE).y >> $(ITFS_DIR)\$(ITFS_H)
  612. #
  613. # Finally, close the file #ifdef
  614. #
  615. @type << >> $(ITFS_DIR)\$(ITFS_H)
  616. #ifndef RC_INVOKED
  617. #pragma pack()
  618. #endif // RC_INVOKED
  619. #endif // __$(ITFS_BASE)_H__
  620. <<NOKEEP
  621. !if "$(OPSYS)"=="NT1X" && "$(NORELEASE_CHICAGO)" == ""
  622. @echo "Releaseing composite .h file for Chicago" $(OUTPUT)
  623. $(COPY) $(ITFS_DIR)\$(ITFS_BASE).h $(HCOPY)\chicago
  624. !endif
  625. !endif # ITFS_BASE
  626. ##################################################################
  627. #
  628. # Rules to build the composite .h file from mc generated files #
  629. #
  630. #
  631. !if "$(MCERRS_BASE)" != "" && "$(MCERRS_DIR)" != ""
  632. MCERRS_H = $(MCERRS_BASE).h
  633. all: $(MCERRS_DIR)\$(MCERRS_H)
  634. $(MCERRS_DIR)\$(MCERRS_H): $(MESSAGE_FILES)
  635. @echo Build_Status Building $(MCERRS_DIR)\$(MCERRS_H) ...
  636. @del $(MCERRS_DIR)\$(MCERRS_H) $(OUTNUL)
  637. #
  638. # Add the file header and base #includes.
  639. #
  640. @echo @echo off > copyall.cmd
  641. @echo cd $(MCERRS_DIR)\ >> copyall.cmd
  642. @type << | $(SED) -f << >> copyall.cmd
  643. $(MESSAGE_FILES:.mc=.h
  644. )
  645. <<NOKEEP
  646. /\./!d
  647. s/\.\\//g
  648. s/^/\@sed -e \"\/\\\/\\\/ File\\\:\/d" /g
  649. s/$$/ \>\> $(MCERRS_H)/g
  650. <<NOKEEP
  651. @echo cd $(MAKEDIR) >> copyall.cmd
  652. @copyall.cmd
  653. @del copyall.cmd
  654. !if "$(OPSYS)"=="NT1X" && "$(NORELEASE_CHICAGO)" == ""
  655. @echo "Releaseing composite .h file for Chicago" $(OUTPUT)
  656. $(COPY) $(MCERRS_DIR)\$(MCERRS_BASE).h $(HCOPY)\chicago
  657. !endif
  658. cleancomp:
  659. @del $(MCERRS_DIR)\$(MCERRS_H)
  660. !endif
  661. ############################################################################
  662. #
  663. # Determine target type (DLL, EXE, or LIB)
  664. #
  665. !ifdef TARGET
  666. TARGET = $(TARGET:.\=)
  667. CLEANTARGET= $(CLEANTARGET) $(TGTDIR)\$(TARGET)
  668. #
  669. # Is it a DLL?
  670. #
  671. TARGETBASE=$(TARGET:.dll=)
  672. ! if "$(TARGETBASE)" != "$(TARGET)"
  673. all: $(YACCFILES:.y=.h) $(TGTDIR)\$(TARGET) copy
  674. TARGETTYPE=dll
  675. DLLFILES= $(DLLFILES) $(TGTDIR)\$(TARGET)
  676. ! else
  677. #
  678. # Is it an EXE?
  679. #
  680. TARGETBASE=$(TARGET:.exe=)
  681. ! if "$(TARGETBASE)" != "$(TARGET)"
  682. all: $(YACCFILES:.y=.h) $(TGTDIR)\$(TARGET) copy
  683. TARGETTYPE=exe
  684. EXEFILES= $(EXEFILES) $(TGTDIR)\$(TARGET)
  685. ! else
  686. #
  687. # Is it a LIB?
  688. #
  689. TARGETBASE=$(TARGET:.lib=)
  690. ! if "$(TARGETBASE)" != "$(TARGET)"
  691. all: $(YACCFILES:.y=.h) $(OBJDIR)\$(TARGET) copy
  692. TARGETTYPE=lib
  693. ! if "$(DEFFILE)" == ""
  694. NO_IMPLIB= TRUE
  695. ! endif
  696. ! else
  697. #
  698. # This is a special target used when we have files to RELEASE
  699. # but nothing to actually build.
  700. #
  701. ! if "$(TARGET)" == "RELEASE"
  702. all:
  703. ! else
  704. #
  705. # We don't know what it is.
  706. #
  707. ! error Unrecognized target type: $(TARGET)
  708. ! endif # !RELEASE
  709. ! endif # !.lib
  710. ! endif # !.exe
  711. ! endif # !.dll
  712. !endif # TARGET
  713. #
  714. # If no name was given for a DEF file, make one up.
  715. #
  716. DEFEXT = f
  717. !ifndef DEFBASE
  718. DEFBASE = $(TARGETBASE)
  719. !endif
  720. !ifndef DEFFILE
  721. DEFFILE=$(DEFBASE).def
  722. !endif
  723. !if "$(NO_IMPLIB)" == ""
  724. DEFFILELIB = $(OBJDIR)\$(DEFBASE).lib
  725. DEFFILEEXP = $(OBJDIR)\$(DEFBASE).exp
  726. !endif
  727. ######################################################################
  728. # Make sure INCLUDE and LIB are null.
  729. INCLUDE=
  730. LIB=
  731. ######################################################################
  732. # Independent definitions for C compiler, LINK
  733. CFLAGS= $(CFLAGS) -D_WINDOWS -ZB64
  734. # The 16 bit OLE DOCFILE libraries do not want UNICODE defined.
  735. !ifndef NO_UNICODE
  736. ! if "$(OPSYS)" == "NT" || "$(OPSYS)" == "NT1X" || "$(OPSYS)" == "NTKERNEL"
  737. CFLAGS = $(CFLAGS) -DUNICODE -D_UNICODE
  738. ! endif
  739. !endif
  740. CINC= -I. $(CINC)
  741. CINC= $(CINC) -I$(TYPESDIR)\oleprx32\$(PLATDIR)
  742. CINC= $(CINC) -I$(CAIROINC) -I$(BASEINC)
  743. ######################################################################
  744. # Debug/Retail definitions
  745. #
  746. # These are hardware independant debug/retail flags
  747. #
  748. # NOTE: NT kernel include files require that DBG be defined.
  749. !if "$(BUILDTYPE)" == "DEBUG"
  750. CDEBUGFLAGS = $(CDEBUGFLAGS) -DDBG=1 -DDEVL=1
  751. !elseif "$(BUILDTYPE)" == "RETAIL"
  752. CDEBUGFLAGS = $(CDEBUGFLAGS) -DDBG=0 -DDEVL=1
  753. !else
  754. CDEBUGFLAGS = $(CDEBUGFLAGS) -DDBG=0 -DDEVL=0
  755. !endif
  756. CFLAGS = $(CFLAGS) $(CDEBUGFLAGS)
  757. ######################################################################
  758. #
  759. # Generic Definitions
  760. #
  761. COMMON_LIBS = $(SDK_LIB_DEST)\$(PLATFORM)
  762. CAIROLIB = $(COMMON_LIBS)\commnot.lib\
  763. $(COMMON_LIBS)\compob32.lib\
  764. $(COMMON_LIBS)\storag32.lib\
  765. $(COMMON_LIBS)\propset.lib\
  766. $(COMMON_LIBS)\ole232.lib\
  767. $(COMMON_LIBS)\lnktrack.lib\
  768. $(TYPESDIR)\oleprx32\$(PLATDIR)\$(OBJDIR)\uuid.lib\
  769. $(COMMON_LIBS)\change.lib\
  770. $(COMMON_LIBS)\events.lib\
  771. $(COMMON_LIBS)\dsys.lib \
  772. $(SDK_LIB_PATH)\ntdll.lib
  773. ######################################################################
  774. #
  775. # Win32 (NT 1.x/NT 2.0/Chicago/Win32s) Definitions
  776. #
  777. !if "$(PROCESSOR_ARCHITECTURE)" == "x86" || \
  778. "$(PROCESSOR_ARCHITECTURE)" == "MIPS" || \
  779. "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  780. ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  781. #--------------------------------------
  782. # X86 Specific Flags
  783. #--------------------------------------
  784. CC= cl386
  785. BUILD_EXE_COMPFLAG= cl386
  786. BUILD_EXE_PROCTYPE=i386
  787. CPLATFORM= -Di386=1 -D_X86_=1
  788. CFLAGS = $(CFLAGS) -G4f -Zl -Bbb1
  789. # Chicago doesn't have Unicode API's
  790. ! if "$(OPSYS)" == "DOS" || "$(OPSYS)" == "WIN16"
  791. CFLAGS = $(CFLAGS) -UUNICODE -U_UNICODE
  792. ! endif
  793. !if "$(CALLCONV)" == ""
  794. ! ifndef 386_STDCALL
  795. 386_STDCALL = TRUE
  796. ! endif
  797. ! if "$(386_STDCALL)" == "TRUE"
  798. CFLAGS = $(CFLAGS) -Gz
  799. ! else
  800. CFLAGS = $(CFLAGS) -Gd
  801. ! endif
  802. !else
  803. CFLAGS = $(CFLAGS) $(CALLCONV)
  804. !endif
  805. #
  806. # Disable FPO for now. If/when we determine if the debuggers can handle
  807. # it, and the CriticalSection code isn't dependent on the stack frame, and
  808. # the Stack walk-back code is updated, we should turn it back on...
  809. #
  810. ! ifndef OPTFLAGS
  811. ! if "$(BUILDTYPE)" == "DEBUG" || "$(BUILDTYPE)" == "RETAIL"
  812. OPTFLAGS = -Ogit -Oy-
  813. ! elseif "$(BUILDTYPE)" == "RELEASE" || "$(BUILDTYPE)" == "PROFILE"
  814. OPTFLAGS = -Owx -Oy- -Ob1
  815. ! endif
  816. ! endif
  817. # Make sure intrinsics are always on.
  818. OPTFLAGS = $(OPTFLAGS) -Oi
  819. # Hack to workaround cvpack types limit when building ole2prxy.dll in
  820. # common\types. s/b revisted once the linker and cvpack are one.
  821. # BryanT 8/10/93
  822. !if "$(NO_DEBUG)" == "1"
  823. NTDEBUGTYPE = ntsd
  824. !else
  825. NTDEBUGTYPE = windbg
  826. !endif
  827. DLLENTRY = @12
  828. DRIVERENTRY = @8
  829. #
  830. # (To be moved to NT section when the MIPS linker understands this flag)
  831. #
  832. LFLAGS = $(LFLAGS) -merge:.CRT=.data
  833. #
  834. # The CUDA Linker requires this if there is no entrypoint (resource only DLL)
  835. #
  836. ! ifdef NOEXPORTS
  837. DLLSTARTUP= -NOENTRY
  838. ! endif
  839. LFLAGS = $(LFLAGS) -NODEFAULTLIB -OPT:REF -RELEASE
  840. OBJFILES = $(OBJFILES) $(X86_OBJFILES)
  841. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  842. #--------------------------------------
  843. # MIPS Specific Flags
  844. #--------------------------------------
  845. CC= mcl
  846. BUILD_EXE_COMPFLAG= ClMips
  847. BUILD_EXE_PROCTYPE=mips
  848. CPLATFORM= -DMIPS=1 -D_MIPS_=1 -DR4000=1
  849. CFLAGS = $(CFLAGS) -QmipsOb2000 -QmipsG2
  850. ! ifndef OPTFLAGS
  851. ! if "$(BUILDTYPE)" == "DEBUG" || "$(BUILDTYPE)" == "RETAIL"
  852. OPTFLAGS = -Oglt
  853. ! elseif "$(BUILDTYPE)" == "RELEASE" || "$(BUILDTYPE)" == "PROFILE"
  854. OPTFLAGS = -Owx -Ob1
  855. ! endif
  856. ! endif
  857. DLLENTRY =
  858. DRIVERENTRY =
  859. ! if "$(TARGETTYPE)" == "exe"
  860. LFLAGS = $(LFLAGS) -GPSIZE:32
  861. ! endif
  862. !ifdef NEW_LINKER
  863. ! ifdef NOEXPORTS
  864. DLLSTARTUP= -NOENTRY
  865. ! endif
  866. LFLAGS = $(LFLAGS) -NODEFAULTLIB -OPT:REF -RELEASE
  867. ! if "$(NO_DEBUG)" == "1"
  868. NTDEBUGTYPE = ntsd
  869. ! else
  870. NTDEBUGTYPE = windbg
  871. ! endif
  872. !else
  873. #
  874. # The MIPS Linker doesn't use a special switch to disable the entrypoint.
  875. #
  876. ! ifdef NOEXPORTS
  877. DLLSTARTUP=
  878. ! endif
  879. LFLAGS = $(LFLAGS) -IGNORE:505
  880. #
  881. # The MIPS Linker doesn't understand the nologo switch... Disable it for now.
  882. #
  883. LINKLOGO =
  884. !endif
  885. # BUGBUG: For GPSIZE to really be useful, the compiler switches should include
  886. # -Gt32 and we should add libm.lib to the LIBS macros. However, I'm
  887. # pretty sure Steve (shanson) and Sundeep haven't implemented the
  888. # necessary code for it to work with DLL's... So for now, we just add
  889. # if to the exe link flags in case some library we link with was built
  890. # with -Gt... BryanT 6/20/93
  891. OBJFILES = $(OBJFILES) $(MIPS_OBJFILES)
  892. ! elseif "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  893. #--------------------------------------
  894. # ALPHA Specific Flags
  895. #--------------------------------------
  896. CC= claxp
  897. BUILD_EXE_COMPFLAG= ClAlpha
  898. BUILD_EXE_PROCTYPE=alpha
  899. CPLATFORM= -DALPHA=1 -D_ALPHA_=1 -DJENSEN
  900. ! ifndef OPTFLAGS
  901. ! if "$(BUILDTYPE)" == "DEBUG" || "$(BUILDTYPE)" == "RETAIL"
  902. OPTFLAGS = -Oglt
  903. ! elseif "$(BUILDTYPE)" == "RELEASE" || "$(BUILDTYPE)" == "PROFILE"
  904. OPTFLAGS = -Owx -Ob1
  905. ! endif
  906. ! endif
  907. DLLENTRY =
  908. DRIVERENTRY =
  909. #
  910. # The ALPHA Linker doesn't use a special switch to disable the entrypoint.
  911. #
  912. ! ifdef NOEXPORTS
  913. DLLSTARTUP=
  914. ! endif
  915. LFLAGS = $(LFLAGS) -IGNORE:505
  916. #
  917. # The ALPHA Linker doesn't understand the nologo switch... Disable it for now.
  918. #
  919. LINKLOGO =
  920. OBJFILES = $(OBJFILES) $(ALPHA_OBJFILES)
  921. ! endif # PROCESSOR_ARCHITECTURE == x86 / MIPS / ALPHA
  922. #--------------------------------------
  923. # NT/Chicago(DOS) Specific Flags
  924. #--------------------------------------
  925. CPLATFORM = $(CPLATFORM) -DFLAT
  926. CFLAGS = $(CFLAGS) -Zp8 -Ze -Gys -W3 -FI$(BASEDIR)\private\cinc\warning.h
  927. !if "$(OPSYS)" == "NT" || "$(OPSYS)" == "NTKERNEL"
  928. CFLAGS = $(CFLAGS) -DCAIROLE_BUILD
  929. !endif
  930. # WIN32 == 50 -> Win32s
  931. # WIN32 == 100 -> NT version 1.0
  932. # WIN32 == 200 -> Chicago version 1.0
  933. # WIN32 == 300 -> Cairo (NT version 2.0)
  934. !if "$(OPSYS)" == "WIN16"
  935. CPLATFORM = $(CPLATFORM) -DWIN32=50 -D_WIN32S_=50
  936. !elseif "$(OPSYS)" == "NT1X"
  937. CPLATFORM = $(CPLATFORM) -DWIN32=100 -D_NT1X_=100
  938. !elseif "$(OPSYS)" == "DOS"
  939. CPLATFORM = $(CPLATFORM) -DWIN32=200 -D_CHICAGO_=200
  940. !elseif "$(OPSYS)" == "NT" || "$(OPSYS)" == "NTKERNEL"
  941. CPLATFORM = $(CPLATFORM) -DWIN32=300 -D_CAIRO_=300
  942. !else
  943. !error Unknown OPSYS: $(OPSYS)
  944. !endif
  945. !ifdef PERFSNAP
  946. CFLAGS = $(CFLAGS) -DPERFSNAP=1
  947. !endif
  948. !ifdef NO_OLE
  949. INCLUDES_FLAGS = $(INCLUDES_FLAGS) -nole2.h
  950. CFLAGS = $(CFLAGS) -DNOOLETYPES
  951. !else
  952. CFLAGS = $(CFLAGS) -DINC_OLE2
  953. !endif
  954. IDLFLAGS = $(IDLFLAGS) -Zp8
  955. NO_SPLITSYM = TRUE # Reenable when commnot understands .dbg files
  956. IMAGE_TYPE_COFF = TRUE
  957. ! if "$(BUILDTYPE)" == "RELEASE"
  958. DBGFLAGS =
  959. ! else
  960. DBGFLAGS = -Z7
  961. ! endif
  962. ! if "$(NO_STRICT)" == ""
  963. CFLAGS = $(CFLAGS) -DSTRICT
  964. ! else
  965. CFLAGS = $(CFLAGS) -DNO_STRICT
  966. ! endif
  967. CFLAGS = $(CFLAGS) $(OPTFLAGS) $(DBGFLAGS) $(CPLATFORM)
  968. ! if "$(TARGETTYPE)" != "sys" && !defined(USE_STDCRT)
  969. USE_MSVCRT=TRUE
  970. ! endif
  971. ! ifdef USE_MSVCRT
  972. CFLAGS= $(CFLAGS) -D_MT -D_DLL
  973. MTHREAD= 1
  974. ! else
  975. ! if "$(TARGETTYPE)" == "dll" || "$(MTHREAD)" == "1"
  976. CFLAGS= $(CFLAGS) -D_MT
  977. ! endif
  978. ! endif
  979. WILDCARDOBJ = $(RTLIBDIR)\setargv.obj
  980. ! ifdef WILDCARDS
  981. OBJFILES = $(OBJFILES) $(WILDCARDOBJ)
  982. ! endif
  983. AFLAGS= $(AFLAGS) -Ml -W2 -Zi -t
  984. CRTINC= $(OSINC)\crt
  985. RTLIBDIR= $(OSLIBDIR)
  986. ! if "$(OPSYS)" == "NT" || "$(OPSYS)" == "NTKERNEL"
  987. RTLIBST= $(RTLIBDIR)\cairost.lib $(RTLIBDIR)\libc.lib
  988. RTLIBMT= $(RTLIBDIR)\cairomt.lib $(RTLIBDIR)\libcmt.lib
  989. RTLIBCRTDLL= $(RTLIBDIR)\crtdll.lib
  990. RTLIBSYS= $(RTLIBDIR)\cairoker.lib $(RTLIBDIR)\libcnt.lib
  991. ! else
  992. RTLIBST= $(RTLIBDIR)\libc.lib
  993. RTLIBMT= $(RTLIBDIR)\libcmt.lib
  994. RTLIBSYS= $(RTLIBDIR)\libcnt.lib
  995. RTLIBCRTDLL= $(RTLIBDIR)\crtdll.lib
  996. ! endif
  997. RTLIBEXE= $(RTLIBST)
  998. RTLIBEXEQ=
  999. RTLIBEXEFP=
  1000. RTLIBEXEFPMT=
  1001. ! ifdef USE_MSVCRT
  1002. RTLIBEXEMT= $(RTLIBCRTDLL)
  1003. RTLIBDLL= $(RTLIBCRTDLL)
  1004. ! else
  1005. RTLIBEXEMT= $(RTLIBMT)
  1006. RTLIBDLL= $(RTLIBMT)
  1007. ! endif
  1008. RPCLIBDIR= $(OSLIBDIR)
  1009. RPCNDRLIB= $(RPCLIBDIR)\RpcNdr.lib
  1010. RPCRTLIB= $(RPCLIBDIR)\RpcRt4.lib
  1011. RPCLIBS= $(RPCRTLIB) $(RPCLIBDIR)\ntdll.lib
  1012. ! if "$(SUBSYSTEMVER)" == ""
  1013. SUBSYSTEMVER = 3.10
  1014. ! endif
  1015. ! if "$(NO_WINMAIN)" == ""
  1016. EXESTARTUP= -ENTRY:WinMainCRTStartup
  1017. SUBSYSTEM= WINDOWS,$(SUBSYSTEMVER)
  1018. ! else
  1019. EXESTARTUP= -ENTRY:mainCRTStartup
  1020. ! if "$(SUBSYSTEM)" == ""
  1021. SUBSYSTEM= CONSOLE,$(SUBSYSTEMVER)
  1022. ! else # Make sure the subsystem version is set
  1023. ! if "$(SUBSYSTEM)" == "$(SUBSYSTEM:,=x)"
  1024. SUBSYSTEM= $(SUBSYSTEM),$(SUBSYSTEMVER)
  1025. ! endif
  1026. ! endif # allows override of subsystem
  1027. ! endif
  1028. #
  1029. # For a perfsnap build, we use a modified version of dllentr2.obj
  1030. #
  1031. !if "$(PERFSNAP)" == "1"
  1032. STARTUPFILE=dllpsnap.obj
  1033. !else
  1034. STARTUPFILE=dllentr2.obj
  1035. !endif
  1036. #
  1037. # BugBug, what do we do about the DllEntryPoint for Daytona builds?
  1038. # now we jus link with dllentr2.obj.
  1039. ! ifndef NOEXPORTS
  1040. ! ifdef USE_MSVCRT
  1041. ! if "$(OPSYS)" == "NT" || "$(OPSYS)" == "NTKERNEL"
  1042. DLLSTARTUP= -ENTRY:DllEntryPoint$(DLLENTRY)
  1043. ! else
  1044. DLLSTARTUP= -ENTRY:DllEntryPoint$(DLLENTRY)
  1045. ! endif
  1046. ! else
  1047. DLLSTARTUP= -ENTRY:DllEntryPoint$(DLLENTRY)
  1048. ! endif
  1049. ! endif
  1050. SYSSTARTUP= -ENTRY:DriverEntry$(DRIVERENTRY)
  1051. !ifdef USE_OLE_MC
  1052. MCFLAGS= -r $(OBJDIR) -o
  1053. !else
  1054. MCFLAGS= -r $(OBJDIR)
  1055. !endif
  1056. RCFLAGS= $(RCFLAGS) -r $(CDEBUGFLAGS) $(CPLATFORM) $(CINC) -fo
  1057. RCEXEFLAGS= $(RCEXEFLAGS)
  1058. LINK= $(COFF) -link $(LINKLOGO)
  1059. LIBUTIL= $(COFF) -lib $(LINKLOGO)
  1060. LFLAGS= $(LFLAGS) \
  1061. -MACHINE:$(PLATFORM) \
  1062. -MAP:$(OBJDIR)\$(TARGETBASE).map \
  1063. !if "$(OPSYS)" == "NT" || "$(OPSYS)" == "NTKERNEL"
  1064. -VERSION:2.0 \
  1065. !else
  1066. -VERSION:1.0 \
  1067. !endif
  1068. -SECTION:.rsrc,r \
  1069. -SECTION:.guids,r
  1070. ! if "$(BUILDTYPE)" == "RELEASE"
  1071. LFLAGS= $(LFLAGS) -DEBUG:none
  1072. ! else
  1073. ! if "$(TARGETTYPE)" == "sys"
  1074. ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  1075. LFLAGS= $(LFLAGS) -DEBUG:notmapped,full -DEBUGTYPE:both,fixup
  1076. NTDEBUGTYPE=windbg
  1077. ! else
  1078. LFLAGS= $(LFLAGS) -DEBUG:notmapped,full -DEBUGTYPE:coff
  1079. NTDEBUGTYPE=ntsd
  1080. ! endif
  1081. ! else
  1082. ! if "$(NTDEBUGTYPE)" == "windbg"
  1083. ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  1084. LFLAGS= $(LFLAGS) -DEBUG:mapped,full -DEBUGTYPE:both,fixup
  1085. ! else
  1086. LFLAGS= $(LFLAGS) -DEBUG:mapped,full -DEBUGTYPE:both
  1087. ! endif
  1088. ! else
  1089. LFLAGS= $(LFLAGS) -DEBUG:mapped,full -DEBUGTYPE:coff
  1090. ! endif
  1091. ! endif
  1092. ! endif
  1093. LFLAGSEXE= $(LFLAGS) -ALIGN:0x1000 -SUBSYSTEM:$(SUBSYSTEM)
  1094. LFLAGSDLL= $(LFLAGS) -DLL -ALIGN:0x1000 -SUBSYSTEM:$(SUBSYSTEM)
  1095. LFLAGSSYS= $(LFLAGS) -DLL:system -ALIGN:0x200
  1096. # Chicago and Win32s need relocations
  1097. !if "$(OPSYS)" != "DOS" && "$(OPSYS)" != "WIN16"
  1098. LFLAGSEXE= $(LFLAGSEXE) -FIXED
  1099. !endif
  1100. LIBFLAGS= -MACHINE:$(PLATFORM) -DEBUGTYPE:BOTH
  1101. ! ifndef IMAGEBASE
  1102. ! if "$(TARGETTYPE)" == "sys"
  1103. IMAGEBASE = 0x10000
  1104. ! elseif "$(TARGETTYPE)" == "dll" || "$(TARGETTYPE)" == "cpl"
  1105. ! ifdef COFFBASE
  1106. IMAGEBASE= @$(TYPESDIR)\coffbase.txt,$(COFFBASE)
  1107. ! else
  1108. ! if "$(RELEASE)" != ""
  1109. !error *** BUILD ERROR - Cannot set RELEASE w/o a COFFBASE setting ***
  1110. ! endif
  1111. ! endif
  1112. ! else
  1113. IMAGEBASE= @$(TYPESDIR)\coffbase.txt,usermode
  1114. ! endif
  1115. ! endif
  1116. IMAGEBASE= -BASE:$(IMAGEBASE)
  1117. SPLITSYMFLAGS= -v
  1118. !endif # $(PROCESSOR_ARCHITECTURE) == x86/MIPS/ALPHA
  1119. ##################################################
  1120. # OS dependent Definitions for C compiler
  1121. #
  1122. # These are definitions which will change for each flavor of Win32
  1123. # supported (NT, DOS)
  1124. #
  1125. !if "$(PROCESSOR_ARCHITECTURE)" == "x86" || "$(PROCESSOR_ARCHITECTURE)" == "MIPS" || "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  1126. !if "$(OPSYS)" == "NT" || "$(OPSYS)" == "NT1X"
  1127. OSLIBDIR= $(IMPORTNT)\lib\$(PLATFORM)
  1128. OSINC= $(IMPORTNT)\inc
  1129. !if "$(OPSYS)" == "NT"
  1130. CAIROOSINC=$(IMPORTNT)\inc
  1131. !elseif "$(OPSYS)" == "NT1X"
  1132. CAIROOSINC=$(IMPORTNT)\inc
  1133. !endif
  1134. RPCINC= $(IMPORTNT)\inc
  1135. !else
  1136. !error Unknown OPSYS: $(OPSYS)
  1137. !endif
  1138. OSLIBEXE= $(OSLIBDIR)\gdi32.lib $(OSLIBDIR)\kernel32.lib \
  1139. $(OSLIBDIR)\user32.lib $(OSLIBDIR)\advapi32.lib
  1140. OSLIBEXE= $(OSLIBEXE) $(EXTRAOSLIBS)
  1141. ! if "$(PROFILE)" == "TRUE"
  1142. OSLIBEXE= $(OSLIBEXE) $(OSLIBDIR)\cap.lib
  1143. ! endif # "$(PROFILE)" == "TRUE"
  1144. OSLIBDLL= $(OSLIBEXE)
  1145. OSLIBSYS= $(OSLIBDIR)\ntoskrnl.lib $(OSLIBDIR)\hal.lib $(EXTRAOSLIBS)
  1146. ! if "$(IDLBASE)" != ""
  1147. OSLIBEXE= $(OSLIBEXE) $(RPCNDRLIB)
  1148. OSLIBDLL= $(OSLIBDLL) $(RPCNDRLIB)
  1149. ! endif
  1150. !endif # PROCESSOR_ARCHITECTURE == x86/MIPS/ALPHA
  1151. CINC= $(CINC) -I$(CRTINC) -I$(CAIROOSINC) -I$(OSINC) -I$(RPCINC)
  1152. ####################################################################
  1153. #
  1154. # Defines for the SDK Tools.
  1155. #
  1156. MKHEADERFLAGS = $(MKHEADERFLAGS)
  1157. MKTYPLIBFLAGS = $(MKTYPLIBFLAGS) -cpp_cmd $(CC)
  1158. MKTMPLATFLAGS = $(MKTMPLATFLAGS)
  1159. # update TLBDIRS to point to the location of the master winole
  1160. # type library. Currently this is in $(BASEINC)\$(OBJDIR)
  1161. TLBDIRS = $(TLBDIRS) -L$(BASEINC)\$(OBJDIR)
  1162. ######################################################################
  1163. #
  1164. # Generic rules to build OBJs from C, and CXX files.
  1165. #
  1166. CLOBJ= $(CC) $(CFLAGS) $(OCFLAGS) $(CINC) $(GCFLAGS) -c
  1167. ALLCFLAGS = $(CFLAGS) $(OCFLAGS) $(GCFLAGS) -c
  1168. IDLMIDLFLAGS = $(MIDLFLAGS) $(IDLFLAGS)
  1169. #####################################################################
  1170. #
  1171. # Rules for generating precompiled headers
  1172. #
  1173. # BUGBUG: This business with adding a dummy function to the end of the pch
  1174. # is necessitated by the compiler not doing it for us. By doing
  1175. # it, we force the linker to add the module to the library. We
  1176. # also create a .lic (Link Include) file that will follow the library
  1177. # around and force the module to be linked in to the final image
  1178. # so cvpack can find the types data. 4-14-93 BryanT
  1179. #
  1180. # Define NEW_PCH_BUILD to eliminate this problem. Instead of generating
  1181. # a dummy function and the .lic file, we use -Yl on the compile line with
  1182. # the name of the target. This causes the compiler to add a special
  1183. # symbol to the pch file. Not turned on for the full build because
  1184. # Centaur doesn't support it yet. 9-24-93 BryanT
  1185. #
  1186. !if "$(PCHDIR)" == ""
  1187. PCHDIR = $(MAKEDIR)
  1188. !endif
  1189. CINC = -I$(PCHDIR) $(CINC)
  1190. PCH_SECRET_NAME = __@@_PchDebugInfoLibrary
  1191. DUMFUNC = $(PCH_SECRET_NAME)_$(TARGETBASE)_$(TARGETTYPE)
  1192. ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  1193. DUMINCLUDE = -INCLUDE:_$(DUMFUNC)
  1194. ! else
  1195. DUMINCLUDE = -INCLUDE:$(DUMFUNC)
  1196. ! endif
  1197. PCHOBJDIR = $(PCHDIR)\$(OBJDIR)
  1198. # --------------------------- PXXFILE Support ------------------------
  1199. #bugbug
  1200. #work around for precompiled header problem.
  1201. !if "$(NTNOPCH)"!=""
  1202. PXXFILE=
  1203. !endif
  1204. !if "$(PXXFILE)" != ""
  1205. PXXFILE = $(PXXFILE:.\=)
  1206. PXXSOURCE = $(PCHDIR)\$(PXXFILE)
  1207. PXXHEADER = $(PCHOBJDIR)\$(PXXFILE:.cxx=.pxh)
  1208. PRECOMPXXOBJ = $(PCHOBJDIR)\$(PXXFILE:.cxx=.obj)
  1209. PXXLIC = $(PCHOBJDIR)\$(PXXFILE:.cxx=.lxp)
  1210. PCH_CXX_OPT = -Yu -Fp$(PXXHEADER)
  1211. !if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" || "$(PROCESSOR_ARCHITECTURE)" == "x86" || "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  1212. PCH_CXX_NAME = -Yl$(TARGETBASE)_$(TARGETTYPE)
  1213. !else
  1214. PCH_CXX_NAME =
  1215. !endif
  1216. ! ifndef NEW_PCH_BUILD
  1217. $(PXXHEADER) $(PXXLIC): $(PXXSOURCE)
  1218. ! if "$(PCHDIR)" == "$(MAKEDIR)"
  1219. @-md $(OBJDIR) $(OUTNUL)
  1220. $(CC) $(COMPLOGO) @<<$(OBJDIR)\$(PXXFILE:.cxx=.rsp)
  1221. $(ALLCFLAGS: =
  1222. )
  1223. $(CINC: =
  1224. )
  1225. -Yc
  1226. $(PCH_CXX_NAME)
  1227. -Fp$(PXXHEADER)
  1228. -Fo$(PRECOMPXXOBJ)
  1229. -Tp$(PXXSOURCE)
  1230. <<$(COMPRESP)
  1231. @echo $(DUMINCLUDE) > $(PXXLIC)
  1232. ! else
  1233. @-cd $(PCHDIR)
  1234. @-$(MAKE) -$(MAKEFLAGS)
  1235. @-cd $(MAKEDIR)
  1236. ! endif
  1237. ! else # NEW_PCH_BUILD
  1238. $(PXXHEADER): $(PXXSOURCE)
  1239. ! if "$(PCHDIR)" == "$(MAKEDIR)"
  1240. @-md $(OBJDIR) $(OUTNUL)
  1241. $(CC) $(COMPLOGO) @<<$(OBJDIR)\$(PXXFILE:.cxx=.rsp)
  1242. $(ALLCFLAGS: =
  1243. )
  1244. $(CINC: =
  1245. )
  1246. -Yc
  1247. $(PCH_CXX_NAME)
  1248. -Fp$(PXXHEADER)
  1249. -Fo$(PRECOMPXXOBJ)
  1250. -Tp$(PXXSOURCE)
  1251. <<$(COMPRESP)
  1252. ! else
  1253. @-cd $(PCHDIR)
  1254. @-$(MAKE) -$(MAKEFLAGS)
  1255. @-cd $(MAKEDIR)
  1256. ! endif
  1257. ! endif # NEW_PCH_BUILD
  1258. !else # PXXFILE == ""
  1259. PCH_CXX_OPT =
  1260. PRECOMPXXOBJ =
  1261. !endif
  1262. # ---------------------------- PFILE Support -------------------------
  1263. !if "$(PFILE)" != ""
  1264. PFILE = $(PFILE:.\=)
  1265. PSOURCE = $(PCHDIR)\$(PFILE)
  1266. PHEADER = $(PCHOBJDIR)\$(PFILE:.c=.ph)
  1267. PRECOMPOBJ = $(PCHOBJDIR)\$(PFILE:.c=.obj)
  1268. PLIC = $(PCHOBJDIR)\$(PFILE:.c=.lp)
  1269. PCH_C_OPT = -Yu -Fp$(PHEADER)
  1270. !if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" || "$(PROCESSOR_ARCHITECTURE)" == "x86" || "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  1271. PCH_C_NAME = -Yl$(TARGETBASE)_$(TARGETTYPE)
  1272. !else
  1273. PCH_C_NAME =
  1274. !endif
  1275. ! ifndef NEW_PCH_BUILD
  1276. $(PHEADER) $(PLIC): $(PSOURCE)
  1277. @-md $(OBJDIR) $(OUTNUL)
  1278. $(CC) $(COMPLOGO) @<<$(OBJDIR)\$(PFILE:.c=.rsp)
  1279. $(ALLCFLAGS: =
  1280. )
  1281. $(CINC: =
  1282. )
  1283. -Yc
  1284. $(PCH_C_NAME)
  1285. -Fp$(PHEADER)
  1286. -Fo$(PRECOMPOBJ)
  1287. -Tc$(PSOURCE)
  1288. <<$(COMPRESP)
  1289. @echo $(DUMINCLUDE) > $(PLIC)
  1290. ! else # NEW_PCH_BUILD
  1291. $(PHEADER): $(PSOURCE)
  1292. @-md $(OBJDIR) $(OUTNUL)
  1293. $(CC) $(COMPLOGO) @<<$(OBJDIR)\$(PFILE:.c=.rsp)
  1294. $(ALLCFLAGS: =
  1295. )
  1296. $(CINC: =
  1297. )
  1298. -Yc
  1299. $(PCH_C_NAME)
  1300. -Fp$(PHEADER)
  1301. -Fo$(PRECOMPOBJ)
  1302. -Tc$(PSOURCE)
  1303. <<$(COMPRESP)
  1304. ! endif # NEW_PCH_BUILD
  1305. !else # PFILE == ""
  1306. PCH_C_OPT =
  1307. PRECOMPOBJ =
  1308. !endif
  1309. !ifndef NEW_PCH_BUILD
  1310. # ----------------------- Library .LIC Support ------------------------
  1311. !if "$(TARGETTYPE)" == "lib" && ("$(PXXFILE)" != "" || "$(PFILE)" != "")
  1312. $(TGTDIR)\$(TARGET): $(TGTDIR)\$(TARGETBASE).lic
  1313. $(TGTDIR)\$(TARGETBASE).lic: $(PXXLIC) $(PLIC)
  1314. @-md $(OBJDIR) $(OUTNUL)
  1315. @-$(DEL) $@ $(OUTNUL)
  1316. @for %i in ($**) do @type %i >> $@
  1317. !endif
  1318. !endif # NEW_PCH_BUILD
  1319. #####################################################################
  1320. #
  1321. # Rules for c files
  1322. #
  1323. .c{$(OBJDIR)}.obj:
  1324. @echo $< --^> $@ $(OUTPUT)
  1325. @-md $(OBJDIR) $(OUTNUL)
  1326. @echo $(BUILD_EXE_COMPFLAG) $< $(CC) $(COMPLOGO) @$*.rsp
  1327. @$(CC) $(COMPLOGO) @<<$*.rsp
  1328. $(ALLCFLAGS: =
  1329. )
  1330. $(CINC: =
  1331. )
  1332. $(PCH_C_OPT: =
  1333. )
  1334. -Fo$(MAKEDIR)\$*.obj
  1335. $(MAKEDIR)\$<
  1336. <<$(COMPRESP)
  1337. !ifdef SIFTBUILD
  1338. $(SIFTTOOL) $(SIFTFLAGS) $*.obj
  1339. !endif
  1340. .c{$(OBJDIR)}.lst:
  1341. @echo $< --^> $@ $(OUTPUT)
  1342. @-md $(OBJDIR) $(OUTNUL)
  1343. @echo $(BUILD_EXE_COMPFLAG) $< $(CC) $(COMPLOGO) -Fc$*.lst @$*.rsp
  1344. @$(CC) $(COMPLOGO) -Fc$*.lst @<<$*.rsp
  1345. $(ALLCFLAGS: =
  1346. )
  1347. $(CINC: =
  1348. )
  1349. $(PCH_C_OPT: =
  1350. )
  1351. -Fo$(MAKEDIR)\$*.obj
  1352. $(MAKEDIR)\$<
  1353. <<$(COMPRESP)
  1354. #####################################################################
  1355. #
  1356. # Rules for cxx files
  1357. #
  1358. !if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  1359. CFFLAGS = +L +m7 +H63
  1360. !elseif "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  1361. CFFLAGS = +L +m7 +H63 +E$(IMPORTNT)\h\sdk\mipsxcpt.tab +M
  1362. !elseif "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  1363. CFFLAGS = +L +m7 +H63 +E$(IMPORTNT)\h\sdk\alphxcpt.tab +M
  1364. !endif
  1365. .cxx{$(OBJDIR)}.obj:
  1366. @echo $< --^> $@ $(OUTPUT)
  1367. @-md $(OBJDIR) $(OUTNUL)
  1368. @echo $(BUILD_EXE_COMPFLAG) $< $(CC) $(COMPLOGO) @$*.rsp
  1369. @$(CC) $(COMPLOGO) @<<$*.rsp
  1370. $(ALLCFLAGS: =
  1371. )
  1372. $(CINC: =
  1373. )
  1374. $(PCH_CXX_OPT: =
  1375. )
  1376. -Fo$(MAKEDIR)\$*.obj
  1377. -Tp$(MAKEDIR)\$<
  1378. <<$(COMPRESP)
  1379. !ifdef SIFTBUILD
  1380. $(SIFTTOOL) $(SIFTFLAGS) $*.obj
  1381. !endif
  1382. .cxx{$(OBJDIR)}.lst:
  1383. @echo $< --^> $@ $(OUTPUT)
  1384. @-md $(OBJDIR) $(OUTNUL)
  1385. @echo $(BUILD_EXE_COMPFLAG) $< $(CC) $(COMPLOGO) -Fc$*.lst @$*.rsp
  1386. @$(CC) $(COMPLOGO) -Fc$*.lst @<<$*.rsp
  1387. $(ALLCFLAGS: =
  1388. )
  1389. $(CINC: =
  1390. )
  1391. $(PCH_CXX_OPT: =
  1392. )
  1393. -Fo$*.obj
  1394. -Tp$(MAKEDIR)\$<
  1395. <<$(COMPRESP)
  1396. .cpp{$(OBJDIR)}.obj:
  1397. @echo $< --^> $@ $(OUTPUT)
  1398. @-md $(OBJDIR) $(OUTNUL)
  1399. @echo $(BUILD_EXE_COMPFLAG) $< $(CC) $(COMPLOGO) @$*.rsp
  1400. @$(CC) $(COMPLOGO) @<<$*.rsp
  1401. $(ALLCFLAGS: =
  1402. )
  1403. $(CINC: =
  1404. )
  1405. $(PCH_CXX_OPT: =
  1406. )
  1407. -Fo$(MAKEDIR)\$*.obj
  1408. -Tp$(MAKEDIR)\$<
  1409. <<$(COMPRESP)
  1410. !ifdef SIFTBUILD
  1411. $(SIFTTOOL) $(SIFTFLAGS) $*.obj
  1412. !endif
  1413. .cpp{$(OBJDIR)}.lst:
  1414. @echo $< --^> $@ $(OUTPUT)
  1415. @-md $(OBJDIR) $(OUTNUL)
  1416. @echo $(BUILD_EXE_COMPFLAG) $< $(CC) $(COMPLOGO) -Fc$*.lst @$*.rsp
  1417. @$(CC) $(COMPLOGO) -Fc$*.lst @<<$*.rsp
  1418. $(ALLCFLAGS: =
  1419. )
  1420. $(CINC: =
  1421. )
  1422. $(PCH_CXX_OPT: =
  1423. )
  1424. -Fo$*.obj
  1425. -Tp$(MAKEDIR)\$<
  1426. <<$(COMPRESP)
  1427. ############################################################################
  1428. #
  1429. # Build a Version resource (NT only) for every image in the build.
  1430. #
  1431. # The user has the choice of either defining their own version resource
  1432. # script or letting the build make one for them on the fly. If the user
  1433. # defines their own, set VERSION_RC in filelist.mk to point to a valid .rc
  1434. # file (with the same format as $(VERSION_RC), below) and don't add that
  1435. # file to the RCFILES macro in filelist.mk. If the user does not define
  1436. # VERSION_RC, build a default file by using TARGET_DESCRIPTION and
  1437. # (optionally) TARGET_INTERNAL_NAME to the internal name (By default, the
  1438. # target name minus the extension).
  1439. #
  1440. !ifdef IMAGE_TYPE_COFF
  1441. ! if "$(OPSYS)" != "DOS" # BUGBUG: Chicago seems to fail on version resources BryanT 9/28/93
  1442. ! if "$(TARGETTYPE)" != "lib" && "$(TARGET)" != "RELEASE" && "$(TARGET)" != ""
  1443. ! if "$(VERSION_RC)" == ""
  1444. VERSION_RC = $(OBJDIR)\$(TARGETBASE).rc1
  1445. ! ifndef TARGET_DESCRIPTION
  1446. ! if "$(RELEASE)" != ""
  1447. !error *** BUILD ERROR - TARGET_DESCRIPTION not set. Aborting. ***
  1448. ! endif
  1449. ! endif
  1450. ! if "$(TARGET_INTERNAL_NAME)" == ""
  1451. TARGET_INTERNAL_NAME = "$(TARGETBASE)"
  1452. ! endif
  1453. # Set the major file type to one of DRV, APP, DLL, STATIC LIB, or UNKNOWN.
  1454. ! if "$(TARGETTYPE)" == "dll"
  1455. VFT_TYPE = VFT_DLL
  1456. ! elseif "$(TARGETTYPE)" == "exe"
  1457. VFT_TYPE = VFT_APP
  1458. ! elseif "$(TARGETTYPE)" == "lib"
  1459. VFT_TYPE = VFT_STATIC_LIB
  1460. ! else
  1461. VFT_TYPE = VFT_UNKNOWN
  1462. ! endif # if "$(TARGETTYPE)" == "sys"
  1463. # The Minor file type distinguishes the type of driver. All DRV's in Cairo
  1464. # are currently SYSTEM drivers.
  1465. ! if "$(TARGETTYPE)" == "sys"
  1466. VFT_TYPE2 = VFT2_DRV_SYSTEM
  1467. ! else
  1468. VFT_TYPE2 = VFT2_UNKNOWN
  1469. ! endif
  1470. all: $(VERSION_RC)
  1471. $(VERSION_RC): $(TYPESDIR)\makefile.inc
  1472. @-md $(OBJDIR) $(OUTNUL)
  1473. type << > $@
  1474. #include <windows.h>
  1475. #include <ntverp.h>
  1476. #define VER_FILETYPE $(VFT_TYPE)
  1477. #define VER_FILESUBTYPE $(VFT_TYPE2)
  1478. #define VER_FILEDESCRIPTION_STR $(TARGET_DESCRIPTION)
  1479. #define VER_INTERNALNAME_STR $(TARGET_INTERNAL_NAME)
  1480. #include <common.ver>
  1481. <<NOKEEP
  1482. ! endif # if "$(VERSION_RC)" == ""
  1483. RCFILES = $(VERSION_RC) $(RCFILES)
  1484. !else # TARGETTYPE != lib && TARGET != RELEASE
  1485. VERSION_RC =
  1486. ! endif # TARGETTYPE != lib && TARGET != RELEASE
  1487. !endif # OPSYS == DOS BUGBUG: Chicago
  1488. !endif # IMAGE_TYPE_COFF
  1489. ######################################################################
  1490. #
  1491. # Rule to build RES from RC file.
  1492. #
  1493. # Note: we mess with PATH because RC is not real clever about
  1494. # finding RCPP (it's sub-component EXE). It looks along PATH,
  1495. # so we limit PATH here in order to guarantee that RCPATH is
  1496. # in PATH, and also to avoid invoking a non-compatible RCPP that
  1497. # might just be in the user's private toolset.
  1498. #
  1499. # In the case of an NT build, COFF can't handle more than one
  1500. # resource obj. So, we build a single .rc2 file that #include's
  1501. # all the component RCFILES.
  1502. #
  1503. !ifdef IMAGE_TYPE_COFF
  1504. ! if "$(RCFILES)" != ""
  1505. $(OBJDIR)\$(TARGETBASE).rc2: $(RCFILES)
  1506. @echo $(RCFILES) --^> $@ $(OUTPUT)
  1507. type << | $(SED) -f $(SCRIPTS)\rcfiles.sed > $@
  1508. $(RCFILES: =
  1509. )
  1510. <<NOKEEP
  1511. $(OBJDIR)\$(TARGETBASE).res: $(OBJDIR)\$(TARGETBASE).rc2
  1512. {$(OBJDIR)}.rc2{$(OBJDIR)}.res:
  1513. @echo $< --^> $@ $(OUTPUT)
  1514. @-md $(OBJDIR) $(OUTNUL)
  1515. $(RC) $(ORCFLAGS) -I$(OBJDIR) $(RCFLAGS) $(MAKEDIR)\$(<R).tmp $(MAKEDIR)\$<
  1516. $(CVTRES) -$(PLATFORM) -o $*.res $(MAKEDIR)\$(<R).tmp
  1517. ! endif
  1518. !else
  1519. .rc{$(OBJDIR)}.res:
  1520. @echo $< --^> $@ $(OUTPUT)
  1521. @-md $(OBJDIR) $(OUTNUL)
  1522. @set oldpath=%%PATH%%
  1523. @set path=$(RCPATH)
  1524. $(RC) $(ORCFLAGS) $(RCFLAGS) $*.res $(MAKEDIR)\$<
  1525. @set path=%%oldpath%%
  1526. @set oldpath=
  1527. !endif
  1528. ######################################################################
  1529. #
  1530. # Rule for building .lib files from .lrf files
  1531. .lrf{$(OBJDIR)}.lib:
  1532. @echo $< --^> $@ $(OUTPUT)
  1533. @-md $(OBJDIR) $(OUTNUL)
  1534. -$(DEL) $*.lib $(OUTNUL)
  1535. @echo lib32 -out:@$< $(BUILD_EXE_PROCTYPE)
  1536. @$(LIBUTIL) $(LIBFLAGS) @$<
  1537. .lrf.lib:
  1538. @echo $< --^> $@ $(OUTPUT)
  1539. @-md $(OBJDIR) $(OUTNUL)
  1540. if exist $*.lib $(DEL) $*.lib $(OUTNUL)
  1541. @echo lib32 -out:@$< $(BUILD_EXE_PROCTYPE)
  1542. $(LIBUTIL) $(LIBFLAGS) @$*.lrf
  1543. ##################################################
  1544. #
  1545. # Rules for generating .h and .c files from .idl files
  1546. #
  1547. ##
  1548. ## IDLUSE == none --> generate header file only
  1549. ##
  1550. .idl{$(MIDL_HDR_OUT_DIR)}.h:
  1551. @echo $< --^> $@ $(OUTPUT)
  1552. !ifdef IMAGE_TYPE_COFF
  1553. $(MIDL) @<<$*.rsp $<
  1554. $(IDLMIDLFLAGS)
  1555. $(CINC)
  1556. -no_format_opt
  1557. -no_warn
  1558. -char unsigned
  1559. -mode c_port
  1560. -proxy $(MIDL_OUT_DIR)\$(@B)_p.c
  1561. -iid $(MIDL_OUT_DIR)\$(@B)_i.c
  1562. -header $(MIDL_HDR_OUT_DIR)\$(@B).h
  1563. -caux $(MIDL_OUT_DIR)\$(@B)_x.c
  1564. -saux $(MIDL_OUT_DIR)\$(@B)_y.c
  1565. -cpp_cmd
  1566. $(CC)
  1567. -cpp_opt "$(COMPLOGO) -DMIDL_PASS $(CPLATFORM) $(OCFLAGS) $(CINC) -E -Tc"
  1568. <<$(COMPRESP)
  1569. !else
  1570. $(MIDL) $(CINC) -char unsigned -mode c_port -header $@ -cpp_cmd $(CC) -cpp_opt "$(COMPLOGO) @<<$*.rsp -Tc" $<
  1571. -DMIDL_PASS
  1572. -D$(PLATFORM)
  1573. $(OCFLAGS)
  1574. $(CINC)
  1575. -D$(PLATFORM)=1
  1576. -E
  1577. <<$(COMPRESP)
  1578. !if "$(OPSYS)"=="NT1X" && "$(NORELEASE_CHICAGO)"==""
  1579. @echo Build_Status Releasing Midl generated $(@B).h files to $(HCOPY)\chicago
  1580. copy $(MIDL_HDR)OUT_DIR)\$(@B).h $(HCOPY)\chicago
  1581. !endif
  1582. !endif
  1583. #-proxy $(MIDL_OUT_DIR)\$(@B)_p.c
  1584. ##################################################
  1585. # Provide some includes prefixes
  1586. INCLUDES_PREFIX= -L$$(OBJDIR) -S$$(OBJDIR)
  1587. INCLUDES_ROOTS= $(INCLUDES_ROOTS) \
  1588. -P$$(BASEDIR)=$(BASEDIR)
  1589. OBJS=$(CXX_OBJS) \
  1590. $(C_OBJS) \
  1591. $(PRECOMPOBJ) \
  1592. $(PRECOMPXXOBJ) \
  1593. $(OBJFILES)
  1594. ############################################################################
  1595. #
  1596. # Build a Link Include file.
  1597. # Basically, every library we call that has a precompiled header needs
  1598. # to have that header obj forced into the final image. The .lic file built
  1599. # with the pch provides that for us. We just make a simple one with
  1600. # NODEFAULTLIB and append any others we can find. BryanT 4/14/93
  1601. #
  1602. !ifdef IMAGE_TYPE_COFF
  1603. ! ifndef NEW_PCH_BUILD
  1604. TARGETLICS = $(TGTDIR)\$(TARGETBASE).tlc
  1605. $(TARGETLICS): $(OBJS) $(LIBS)
  1606. @-md $(TGTDIR) $(OUTNUL)
  1607. @echo -NODEFAULTLIB > KTx14J.lic
  1608. @echo @echo off > $*.cmd
  1609. @$(SED) -f $(SCRIPTS)\licfiles.sed << >> $*.cmd
  1610. $(LIBS: =
  1611. )
  1612. $(OBJS: =
  1613. )
  1614. <<NOKEEP
  1615. @-$*.cmd
  1616. @-$(DEL) $@ $(OUTNUL)
  1617. @for %%i in (*.lic) do @type %i >> $@
  1618. @-$(DEL) *.lic $(OUTNUL)
  1619. ! else
  1620. TARGETLICS =
  1621. ! endif # NEW_PCH_BUILD
  1622. !else
  1623. TARGETLICS =
  1624. !endif
  1625. ############################################################################
  1626. #
  1627. # HACK for NT COFF limitation of only 1 .res obj per image.
  1628. #
  1629. # We force a single resfile name and handle generating it with the
  1630. # .rc->.rc2->,res rules.
  1631. #
  1632. !ifdef IMAGE_TYPE_COFF
  1633. ! if "$(RCFILES)" != ""
  1634. RESFILES = $(OBJDIR)\$(TARGETBASE).res
  1635. ! endif
  1636. !endif
  1637. ############################################################################
  1638. #
  1639. # Build a DLL or CPL (Control Panel Applet)
  1640. #
  1641. #BUGBUG BuildDLL
  1642. !if "$(TARGETTYPE)" == "dll"
  1643. ! ifdef NOEXPORTS
  1644. DLLDEF=
  1645. ! else
  1646. DLLDEF= $(DEFFILEEXP)
  1647. ! endif
  1648. DLLOBJS= $(OBJS)
  1649. ! ifdef SIFTBUILD
  1650. DLLOBJS = $(DLLOBJS) $(SIFTOBJ)
  1651. ! endif # SIFTBUILD
  1652. DLLLIBS= $(LIBS) $(OSLIBDLL) $(RTLIBDLL)
  1653. DLLRES= $(RESFILES)
  1654. ! ifndef NEW_PCH_BUILD
  1655. TLRSPFILE = @$(TARGETLICS)
  1656. ! else
  1657. TLRSPFILE =
  1658. ! endif
  1659. #
  1660. # Link the DLL.
  1661. #
  1662. $(TGTDIR)\$(TARGET): $(DLLOBJS) $(DLLLIBS) $(DLLRES) $(DLLDEF) $(TYPESDIR)\coffbase.txt $(TARGETLICS)
  1663. @$(ECHOTIME) Linking $@ $(ATSTR) $(TIMESTR)... $(OUTPUT)
  1664. @-md $(TGTDIR) $(OUTNUL)
  1665. ! ifdef IMAGE_TYPE_COFF
  1666. @echo link32 -out:$@ $(BUILD_EXE_PROCTYPE)
  1667. @$(LINK) @<<$*.lnk $(TLRSPFILE)
  1668. $(DLLDEF)
  1669. $(LFLAGSDLL: =
  1670. )
  1671. $(DLLSTARTUP)
  1672. -OUT:$@
  1673. $(IMAGEBASE)
  1674. $(DLLOBJS: =
  1675. )
  1676. $(DLLRES)
  1677. $(DLLLIBS: =
  1678. )
  1679. <<$(LINKRESP)
  1680. ! ifndef NO_SPLITSYM
  1681. $(SPLITSYM) $(SPLITSYMFLAGS) $@
  1682. ! endif
  1683. !if "$(RELEASE_BIN)" != ""
  1684. binplace $(BINPLACE_FLAGS) $@
  1685. !endif
  1686. !if "$(NO_RELEASE_IMPORT_LIB)" == "" && "$(LIBCP)" != ""
  1687. $(COPY) $*.lib $(LIBCP)
  1688. !endif
  1689. CLEANTARGET= $(CLEANTARGET)\
  1690. $(OBJDIR)\$(TARGETBASE).lib\
  1691. $(OBJDIR)\$(TARGETBASE).exp
  1692. ! else # IMAGE_TYPE_COFF
  1693. @echo link32 -out:$*.dll $(BUILD_EXE_PROCTYPE)
  1694. @$(LINK) @<<$*.lnk
  1695. $(LFLAGSDLL) $(DLLSTARTUP) $(DLLOBJS: = +^
  1696. )
  1697. $*.dll
  1698. $*.map
  1699. $(DLLLIBS: = +^
  1700. )
  1701. $(DLLDEF)
  1702. <<$(LINKRESP)
  1703. if exist $(DLLRES) $(RC) $(RCEXEFLAGS) -fe $*.dll $(DLLRES) $*.dll
  1704. $(MAPSYM) $(MAPSYMFLAGS) $*.map
  1705. #
  1706. # Generate the import library.
  1707. #
  1708. all: $(OBJDIR)\$(TARGETBASE).lib
  1709. $(OBJDIR)\$(TARGETBASE).lib: $(DLLDEF:.\=)
  1710. CLEANTARGET= $(CLEANTARGET) $(OBJDIR)\$(TARGETBASE).lib
  1711. ! endif # IMAGE_TYPE_COFF
  1712. !endif # Build DLL
  1713. ############################################################################
  1714. #
  1715. # Build a LIB
  1716. #
  1717. !if "$(TARGETTYPE)" == "lib"
  1718. $(OBJDIR)\$(TARGETBASE).lib: $(OBJS) $(LIBS)
  1719. @$(ECHOTIME) Building $@ $(ATSTR) $(TIMESTR)... $(OUTPUT)
  1720. @-md $(OBJDIR) $(OUTNUL)
  1721. -$(DEL) $@ $(OUTNUL)
  1722. ! ifdef IMAGE_TYPE_COFF
  1723. @echo lib32 -out:$@ $(BUILD_EXE_PROCTYPE)
  1724. @$(LIBUTIL) @<<$*.lnb
  1725. $(LIBFLAGS: =
  1726. )
  1727. $(OBJS: =
  1728. )
  1729. $(LIBS: =
  1730. )
  1731. -OUT:$@
  1732. <<$(LINKRESP)
  1733. ! else # IMAGE_TYPE_COFF
  1734. @echo lib32 -out:$@ $(BUILD_EXE_PROCTYPE)
  1735. @$(LIBUTIL) $(LIBFLAGS) @<<$*.lnb
  1736. $(OBJDIR)\$(TARGET)
  1737. y
  1738. $(OBJS: = &^
  1739. )&
  1740. $(LIBS: = &^
  1741. )&
  1742. $*.lls
  1743. <<$(LINKRESP)
  1744. ! endif # IMAGE_TYPE_COFF
  1745. !endif # Build LIB
  1746. ############################################################################
  1747. #
  1748. # Build an EXE
  1749. #
  1750. !if "$(TARGETTYPE)" == "exe"
  1751. ! ifdef IMAGE_TYPE_COFF
  1752. EXEDEF=
  1753. ! else
  1754. ! if "$(DEFFILE)" == ""
  1755. EXEDEF=
  1756. ! else
  1757. EXEDEF= $(DEFFILEEXP)
  1758. ! endif
  1759. ! endif
  1760. EXELIBS= $(LIBS)\
  1761. ! if "$(MTHREAD)" == "1"
  1762. $(RTLIBEXEMT)\
  1763. ! else
  1764. $(RTLIBEXE)\
  1765. ! endif
  1766. $(OSLIBEXE)
  1767. EXEOBJS= $(OBJS)
  1768. !ifdef SIFTBUILD
  1769. EXEOBJS = $(EXEOBJS) $(SIFTOBJ)
  1770. !endif # SIFTBUILD
  1771. EXERES= $(RESFILES)
  1772. #
  1773. # Link the EXE.
  1774. #
  1775. ! ifndef NEW_PCH_BUILD
  1776. TLRSPFILE = @$(TARGETLICS)
  1777. ! else
  1778. TLRSPFILE =
  1779. ! endif
  1780. #
  1781. # Need WINSTUB.EXE to build WIN16 targets -- "DOS" "i286"
  1782. #
  1783. WINSTUB=$(RCPATH)\winstub.exe
  1784. $(TGTDIR)\$(TARGET): $(EXEOBJS) $(EXELIBS) $(EXERES) $(EXEDEF) $(TARGETLICS)
  1785. !if "$(OPSYS)" == "DOS" && "$(PROCESSOR_ARCHITECTURE)" == "i286"
  1786. $(COPY) $(WINSTUB) .
  1787. !endif
  1788. @$(ECHOTIME) Linking $@ $(ATSTR) $(TIMESTR)... $(OUTPUT)
  1789. @-md $(TGTDIR) $(OUTNUL)
  1790. ! ifdef IMAGE_TYPE_COFF
  1791. @echo link32 -out:$@ $(BUILD_EXE_PROCTYPE)
  1792. @$(LINK) @<<$*.lnk $(TLRSPFILE)
  1793. $(LFLAGSEXE: =
  1794. )
  1795. $(EXESTARTUP)
  1796. $(EXEOBJS: =
  1797. )
  1798. $(EXELIBS: =
  1799. )
  1800. $(EXERES)
  1801. -OUT:$@
  1802. $(IMAGEBASE)
  1803. ! if "$(NTDEBUGTYPE)" == "windbg" && "$(PROCESSOR_ARCHITECTURE)" == "x86"
  1804. -nopack
  1805. ! endif
  1806. <<$(LINKRESP)
  1807. ! if "$(NTDEBUGTYPE)" == "windbg" && "$(PROCESSOR_ARCHITECTURE)" == "x86"
  1808. $(CVPACK) -nologo $@
  1809. ! endif
  1810. ! ifndef NO_SPLITSYM
  1811. $(SPLITSYM) $(SPLITSYMFLAGS) $@
  1812. ! endif
  1813. ! else # IMAGE_TYPE_COFF
  1814. @echo link32 -out:$*.exe $(BUILD_EXE_PROCTYPE)
  1815. @$(LINK) @<<$*.lnk
  1816. $(LFLAGSEXE) $(EXESTARTUP) +
  1817. $(EXEOBJS: = +^
  1818. )
  1819. $*.exe
  1820. $*.map
  1821. $(EXELIBS: = +^
  1822. )
  1823. $(EXEDEF)
  1824. <<$(LINKRESP)
  1825. !if "$(OPSYS)" == "DOS" && "$(PROCESSOR_ARCHITECTURE)" == "i286"
  1826. if exist $(EXERES) $(RC) $(RCEXEFLAGS) -fe $*.exe $(EXERES) $*.exe
  1827. -$(DEL) winstub.exe
  1828. !else
  1829. if exist $(EXERES) $(RC) $(RCEXEFLAGS) -fo $*.exe $(EXERES) $*.exe
  1830. !endif
  1831. $(MAPSYM) $(MAPSYMFLAGS) $*.map
  1832. ! endif # IMAGE_TYPE_COFF
  1833. !endif # Build EXE
  1834. ######################################################################
  1835. # IMPLIB files (unlike their real lib counterparts)
  1836. # live in the source directory, not in a version
  1837. # specific subdirectory
  1838. !if "$(NO_IMPLIB)" == ""
  1839. ! ifdef IMAGE_TYPE_COFF
  1840. $(DEFFILEEXP) $(DEFFILELIB): $(DEFFILE)
  1841. @echo $(DEFFILE) --^> $@ $(OUTPUT)
  1842. @-md $(OBJDIR) $(OUTNUL)
  1843. $(CC) $(COMPLOGO) @<<$*.rsp 1>$*.def
  1844. $(CPLATFORM)
  1845. $(CDEBUGFLAGS)
  1846. $(CINC: =
  1847. )
  1848. -EP
  1849. -Tc $**
  1850. <<$(COMPRESP)
  1851. $(LIBUTIL) @<<$*.lsp
  1852. $(LIBFLAGS)
  1853. -OUT:$(DEFFILELIB)
  1854. -DEF:$*.def
  1855. <<$(LINKRESP)
  1856. .def{$(OBJDIR)}.lib:
  1857. @echo $< --^> $@ $(OUTPUT)
  1858. @-md $(OBJDIR) $(OUTNUL)
  1859. $(CC) $(COMPLOGO) @<<$*.rsp 1>$(OBJDIR)\$<
  1860. $(CPLATFORM)
  1861. $(CDEBUGFLAGS)
  1862. $(CINC: =
  1863. )
  1864. -EP
  1865. -Tc $<
  1866. <<$(COMPRESP)
  1867. $(LIBUTIL) @<<$*.lsp
  1868. $(LIBFLAGS)
  1869. -OUT:$@
  1870. -DEF:$(OBJDIR)\$<
  1871. <<$(LINKRESP)
  1872. ! else # IMAGE_TYPE_COFF
  1873. IMPFLAGS=-nologo -noignorecase
  1874. .def.lib:
  1875. @echo $< --^> $@ $(OUTPUT)
  1876. $(IMPLIB) $(IMPFLAGS) $@ $<
  1877. $(DEFFILEEXP): $(DEFFILE)
  1878. @echo $(DEFFILE) --^> $@ $(OUTPUT)
  1879. @-md $(OBJDIR) $(OUTNUL)
  1880. $(CC) $(COMPLOGO) @<<$*.rsp 1>$(DEFFILEEXP)
  1881. $(ALLCFLAGS: =
  1882. )
  1883. $(CINC: =
  1884. )
  1885. -EP
  1886. -Tc $**
  1887. <<$(COMPRESP)
  1888. $(DEFFILELIB): $(DEFFILEEXP)
  1889. @echo $(DEFFILEEXP) --^> $@ $(OUTPUT)
  1890. $(IMPLIB) $(IMPFLAGS) $(DEFFILELIB) $(DEFFILEEXP)
  1891. ! endif # IMAGE_TYPE_COFF
  1892. !endif # NO_IMPLIB
  1893. ############################################################################
  1894. #
  1895. # Cleanup
  1896. #
  1897. !if defined(TARGET) || defined(CLEANTARGET)
  1898. clean: cleanobj
  1899. cleanobj:
  1900. ! if "$(HOST)" == "NT"
  1901. -$(DEL) /q $(OBJDIR) $(OUTNUL)
  1902. ! else
  1903. -echo y | $(DEL) $(OBJDIR) $(OUTNUL)
  1904. ! endif
  1905. -rmdir $(OBJDIR) $(OUTNUL)
  1906. cleantarget:
  1907. ! if "$(HOST)" == "NT"
  1908. -$(DEL) /q $(CLEANTARGET) $(OUTNUL)
  1909. ! else
  1910. -echo y | $(DEL) $(CLEANTARGET) $(OUTNUL)
  1911. ! endif
  1912. !endif
  1913. !ifdef CLEANFILES
  1914. clean: cleanclean
  1915. cleanclean:
  1916. -$(DEL) $(CLEANFILES) $(OUTNUL)
  1917. !endif
  1918. !ifdef LIBCOPY
  1919. ! if "$(TARGETTYPE)" == "lib" || "$(TARGETTYPE)" == "dll"
  1920. clean: cleanlibcopy
  1921. cleanlibcopy:
  1922. -$(DEL) $(LIBCOPY)\$(TARGETBASE).lib $(OUTNUL)
  1923. -$(DEL) $(LIBCOPY)\$(TARGETBASE).lic $(OUTNUL)
  1924. !if "$(OPSYS)"=="NT1X" && "$(NORELEASE_CHICAGO)" == ""
  1925. -$(DEL) $(CHICAGOLIBCOPY)\$(TARGETBASE).lib $(OUTNUL)
  1926. -$(DEL) $(CHICAGOLIBCOPY)\$(TARGETBASE).lic $(OUTNUL)
  1927. !endif
  1928. ! endif
  1929. !endif
  1930. !ifdef DLLCOPY
  1931. ! if "$(TARGETTYPE)" == "dll"
  1932. clean: cleandllcopy
  1933. cleandllcopy:
  1934. -$(DEL) $(DLLCOPY)\$(TARGETBASE).dll $(OUTNUL)
  1935. -$(DEL) $(DLLCOPY)\$(TARGETBASE).dbg $(OUTNUL)
  1936. ! endif
  1937. !endif
  1938. !ifdef EXECOPY
  1939. ! if "$(TARGETTYPE)" == "exe"
  1940. clean: cleanexecopy
  1941. cleanexecopy:
  1942. -$(DEL) $(EXECOPY)\$(TARGETBASE).exe $(OUTNUL)
  1943. -$(DEL) $(EXECOPY)\$(TARGETBASE).dbg $(OUTNUL)
  1944. ! endif
  1945. !endif
  1946. !if "$(TLBCOPY)" != ""
  1947. clean: cleantlbcopy
  1948. cleantlbcopy:
  1949. @echo WARNING - Can't clean Type Library copies in $(TLBCOPY).
  1950. !endif
  1951. ############################################################################
  1952. #
  1953. # Copy targets to other directories.
  1954. #
  1955. copy:
  1956. !ifdef LIBCOPY
  1957. ! if "$(TARGETTYPE)" == "dll" || "$(TARGETTYPE)" == "lib"
  1958. copy: $(LIBCOPY)\$(TARGETBASE).lib
  1959. $(LIBCOPY)\$(TARGETBASE).lib: $(OBJDIR)\$(TARGETBASE).lib
  1960. @echo Copying $(TARGETBASE).lib to $(LIBCOPY)... $(OUTPUT)
  1961. @-md $(LIBCOPY) $(OUTNUL)
  1962. @-$(CHMODE) -r $(LIBCOPY)\$(TARGETBASE).lib $(OUTNUL)
  1963. @-$(CHMODE) -r $(LIBCOPY)\$(TARGETBASE).lic $(OUTNUL)
  1964. $(COPY) $(OBJDIR)\$(TARGETBASE).lib $(LIBCOPY)\$(TARGETBASE).lib
  1965. @-$(COPY) $(OBJDIR)\$(TARGETBASE).lic $(LIBCOPY)\$(TARGETBASE).lic $(OUTNUL)
  1966. !if "$(OPSYS)" == "NT1X" && "$(NORELEASE_CHICAGO)" == ""
  1967. @echo Releasing $(TARGETBASE).lib for Chicago... $(OUTPUT)
  1968. @-md $(CHICAGOLIBCOPY) $(OUTNUL)
  1969. @-$(CHMODE) -r $(CHICAGOLIBCOPY)$(TARGETBASE).lib $(OUTNUL)
  1970. @-$(CHMODE) -r $(CHICAGOLIBCOPY)$(TARGETBASE).lic $(OUTNUL)
  1971. $(COPY) $(OBJDIR)\$(TARGETBASE).lib $(CHICAGOLIBCOPY)\$(TARGETBASE).lib
  1972. @-$(COPY) $(OBJDIR)\$(TARGETBASE).lic $(CHICAGOLIBCOPY)\$(TARGETBASE).lic $(OUTNUL)
  1973. !endif
  1974. ! endif # dll or lib
  1975. !endif # LIBCOPY
  1976. !ifdef DLLCOPY
  1977. ! if "$(TARGETTYPE)" == "dll"
  1978. copy: $(DLLCOPY)\$(TARGETBASE).dll
  1979. $(DLLCOPY)\$(TARGETBASE).dll: $(TGTDIR)\$(TARGETBASE).dll
  1980. @echo Copying $(TARGETBASE).dll to $(DLLCOPY)... $(OUTPUT)
  1981. @-md $(DLLCOPY) $(OUTNUL)
  1982. @-$(CHMODE) -r $(DLLCOPY)\$(TARGETBASE).dll $(OUTNUL)
  1983. @-$(CHMODE) -r $(DLLCOPY)\$(TARGETBASE).dbg $(OUTNUL)
  1984. $(COPY) $(TGTDIR)\$(TARGETBASE).dll $(DLLCOPY)\$(TARGETBASE).dll
  1985. @-$(COPY) $(TGTDIR)\$(TARGETBASE).dbg $(DLLCOPY)\$(TARGETBASE).dbg $(OUTNUL)
  1986. ! endif # dll
  1987. !endif # DLLCOPY
  1988. !ifdef EXECOPY
  1989. ! if "$(TARGETTYPE)" == "exe"
  1990. copy: $(EXECOPY)\$(TARGETBASE).exe
  1991. $(EXECOPY)\$(TARGETBASE).exe: $(TGTDIR)\$(TARGETBASE).exe
  1992. @echo Copying $(TARGETBASE).exe to $(EXECOPY)... $(OUTPUT)
  1993. @-md $(EXECOPY) $(OUTNUL)
  1994. @-$(CHMODE) -r $(EXECOPY)\$(TARGETBASE).exe $(OUTNUL)
  1995. @-$(CHMODE) -r $(EXECOPY)\$(TARGETBASE).dbg $(OUTNUL)
  1996. $(COPY) $(TGTDIR)\$(TARGETBASE).exe $(EXECOPY)\$(TARGETBASE).exe
  1997. @-$(COPY) $(TGTDIR)\$(TARGETBASE).dbg $(EXECOPY)\$(TARGETBASE).dbg $(OUTNUL)
  1998. ! endif # exe
  1999. !endif # EXECOPY
  2000. !if "$(TLBCOPY)" != "" && "$(TYPELIBS)" != ""
  2001. copy: copytlbfiles
  2002. copytlbfiles: $(TYPELIBS)
  2003. @echo Build_Status Copying Type Libraries to "$(TLBCOPY)"... $(OUTPUT)
  2004. @-md $(TLBCOPY) $(OUTNUL)
  2005. !$(COPY) $** $(TLBCOPY)
  2006. !$(UNREGTLB) $**
  2007. !$(REGTLB) $(TLBCOPY)\$(**F)
  2008. !else
  2009. copytlbfiles:
  2010. !endif
  2011. ############################################################################
  2012. #
  2013. # Generate external header file
  2014. #
  2015. !ifdef HFILES
  2016. all: $(TARGETBASE).h
  2017. clean: cleanh
  2018. cleanh:
  2019. -$(DEL) $(TARGETBASE).h $(OUTNUL)
  2020. $(TARGETBASE).h: $(HFILES)
  2021. @echo Generating $(TARGETBASE).h $(OUTPUT)
  2022. $(SED) -f $(SCRIPTS)\public.sed $(HFILES) >$(TMP)\$(TARGETBASE).h
  2023. -$(CMP) -s $(TMP)\$(TARGETBASE).h $@ 2>nul || $(COPY) $(TMP)\$(TARGETBASE).h $@
  2024. -$(DEL) $(TMP)\$(TARGETBASE).h $(OUTNUL)
  2025. DEPENDFILES = $(DEPENDFILES) $(TARGETBASE).h
  2026. !endif
  2027. ############################################################################
  2028. #
  2029. # Resource files dependencies
  2030. #
  2031. !if "$(RESFILES)" != ""
  2032. $(RESFILES): $(RCFILES) $(RCOBJECTS)
  2033. !endif
  2034. ############################################################################
  2035. #
  2036. # Dependencies
  2037. #
  2038. !if "$(DEPENDSRC)" == "" && \
  2039. "$(CXXFILES)" == "" && \
  2040. "$(CPPFILES)" == "" && \
  2041. "$(CFILES)" == "" && \
  2042. "$(IDLFILES)" == "" && \
  2043. "$(TDLFILES)" == ""
  2044. depend:
  2045. !else
  2046. ! if "$(DEPENDSRC)" == "" && \
  2047. "$(CXXFILES)" == "" && \
  2048. "$(CPPFILES)" == "" && \
  2049. "$(CFILES)" == ""
  2050. DEPENDSRC=
  2051. ! else
  2052. DEPENDSRC=$(DEPENDSRC) $(CXXFILES) $(CPPFILES) $(CFILES)
  2053. ! endif
  2054. depend: dependfile
  2055. !ifdef MULTIDEPEND
  2056. DEPENDFILE=depend.mk$(RDEXT)
  2057. NEWDEPENDFILE=depend.ne$(RDEXT)
  2058. !else
  2059. DEPENDFILE=depend.mk
  2060. NEWDEPENDFILE=depend.new
  2061. !endif
  2062. OBJPATTERN=$(OBJDIR:\=\\)
  2063. #########################################################################
  2064. #
  2065. # Here's where the dependencies are actually generated. We break up
  2066. # the CINC, INCLUDES_ROOTS, and src macros to put one command on each
  2067. # to ensure no one line is over 1024 bytes in length. The includes
  2068. # tool reads in 1k bytes and get's confused if any one line is split.
  2069. #
  2070. INCLUDES_FLAGS = $(INCLUDES_FLAGS) -nntos.h -nzwapi.h -dos
  2071. !if "$(OPSYS)"=="NT1X"
  2072. INCLUDES_FLAGS =$(INCLUDES_FLAGS) -nole2.h
  2073. !endif
  2074. dependfile: $(DEPENDFILES)
  2075. $(ECHOTIME) # ; # Built automatically ; # ; >$(NEWDEPENDFILE)
  2076. !if "$(DEPENDSRC)" != ""
  2077. #
  2078. # Source file dependencies
  2079. #
  2080. $(ECHOTIME) # ; # Source files ; # ; >>$(NEWDEPENDFILE)
  2081. $(INCLUDES) @<< >>$(NEWDEPENDFILE)
  2082. -e
  2083. $(INCLUDES_FLAGS)
  2084. $(INCLUDES_PREFIX)
  2085. $(CINC:-I=
  2086. -I)
  2087. $(INCLUDES_ROOTS:-P=
  2088. -P)
  2089. $(DEPENDSRC:.\=
  2090. .\)
  2091. <<NOKEEP
  2092. !endif # DEPENDSRC
  2093. #
  2094. # MIDL dependencies
  2095. #
  2096. !if "$(IDLFILES)" != ""
  2097. $(ECHOTIME) # ; # MIDL Source files ; # ; >>$(NEWDEPENDFILE)
  2098. $(INCLUDES) @<<idl.tmp >>$(NEWDEPENDFILE)
  2099. -e
  2100. $(INCLUDES_FLAGS)
  2101. $(CINC:-I=
  2102. -I)
  2103. $(INCLUDES_ROOTS:-P=
  2104. -P)
  2105. -sh
  2106. -S$$(MIDL_HDR_OUT_DIR)
  2107. $(IDLFILES:.\=
  2108. .\)
  2109. <<NOKEEP
  2110. !endif # IDLFILES
  2111. !if "$(TDLFILES)" != ""
  2112. $(ECHOTIME) # ; # MkTypeLib Source files ; # ; >>$(NEWDEPENDFILE)
  2113. $(INCLUDES) @<<tdl.tmp >>$(NEWDEPENDFILE)
  2114. -e
  2115. $(INCLUDES_FLAGS)
  2116. $(CINC:-I=
  2117. -I)
  2118. $(INCLUDES_ROOTS:-P=
  2119. -P)
  2120. -stlb
  2121. -S$$(OBJDIR)
  2122. $(TDLFILES:.\=
  2123. .\)
  2124. <<NOKEEP
  2125. !endif # IDLFILES
  2126. #
  2127. # C++ PCH dependencies
  2128. #
  2129. !if "$(PXXFILE)" != ""
  2130. $(ECHOTIME) # ; # Precompiled C++ header ; # ; ; !ifdef PXXFILE >>$(NEWDEPENDFILE)
  2131. # if exist $(PXXSOURCE) $(INCLUDES) @<< >>$(NEWDEPENDFILE)
  2132. if exist $(PXXSOURCE) $(INCLUDES) $(INCLUDES_FLAGS) -e -S$$(PCHDIR)\$$(OBJDIR) \
  2133. -L$$(PCHDIR)\$$(OBJDIR) -spxh $(CINC:-I=-I) $(INCLUDES_ROOTS:-P=-P)\
  2134. $(PXXSOURCE) >>$(NEWDEPENDFILE)
  2135. #$(INCLUDES_FLAGS)
  2136. #-e
  2137. #-S$$(PCHDIR)\$$(OBJDIR)
  2138. #-L$$(PCHDIR)\$$(OBJDIR)
  2139. #-spxh
  2140. #$(CINC:-I=
  2141. #-I)
  2142. #$(INCLUDES_ROOTS:-P=
  2143. #-P)
  2144. #$(PXXSOURCE)
  2145. #<<NOKEEP
  2146. $(SED) "s/$(OBJPATTERN)\(.*\)/$$(OBJDIR)\1 : \
  2147. $$(PCHDIR)\\$$(OBJDIR)\\$(PXXFILE:.cxx=.pxh)/" << >>$(NEWDEPENDFILE)
  2148. $(CXX_OBJS: =^
  2149. )
  2150. <<NOKEEP
  2151. $(ECHOTIME) !endif # PXXFILE ; ;>>$(NEWDEPENDFILE)
  2152. !endif
  2153. #
  2154. # C PCH dependencies
  2155. #
  2156. !if "$(PFILE)" != ""
  2157. $(ECHOTIME) # ; # Precompiled C header ; # ; ; !ifdef PFILE >>$(NEWDEPENDFILE)
  2158. if exist $(PSOURCE) $(INCLUDES) @<< >>$(NEWDEPENDFILE)
  2159. -e
  2160. $(INCLUDES_FLAGS)
  2161. -S$$(PCHDIR)\$$(OBJDIR)
  2162. -L$$(PCHDIR)\$$(OBJDIR)
  2163. -sph
  2164. $(CINC:-I=
  2165. -I)
  2166. $(INCLUDES_ROOTS:-P=
  2167. -P)
  2168. $(PSOURCE)
  2169. <<NOKEEP
  2170. $(ECHOTIME) $(C_OBJS:.obj =.obj ; )| \
  2171. $(SED) "s/$(OBJPATTERN)/$$(OBJDIR)/" | \
  2172. $(SED) "s/\.obj/.obj : $$(PCHDIR)\\$$(OBJDIR)\\$(PFILE:.c=.ph)/" >>$(NEWDEPENDFILE)
  2173. $(ECHOTIME) !endif # PFILE ; ;>>$(NEWDEPENDFILE)
  2174. !endif
  2175. @$(CMP) -s $(NEWDEPENDFILE) $(DEPENDFILE) $(OUTNUL) || \
  2176. $(COPY) $(NEWDEPENDFILE) $(DEPENDFILE) $(OUTNUL) || \
  2177. (out -f -! $(DEPENDFILE) && $(ECHOTIME) $(DEPENDFILE) checked out... & $(COPY) $(NEWDEPENDFILE) $(DEPENDFILE) $(OUTNUL))
  2178. $(DEL) $(NEWDEPENDFILE) $(OUTNUL)
  2179. !endif # DEPENDSRC
  2180. ############################################################################
  2181. #
  2182. # Special Rules for Building NT-like parts of the tree. For instance,
  2183. # OFS. Defining RELEASE=NT causes the build to be performed 2 times for
  2184. # this part of the tree. Once with the current BUILDTYPE, once with the
  2185. # opposite one. In either case, we release under the current build in
  2186. # either a CHECK\NT\... tree (for DEBUG BUILDTYPE) or FREE\NT\... tree
  2187. # (for RETAIL BUILDTYPE).
  2188. #
  2189. !if ("$(RELEASE)" == "NT" && "$(BUILD_BOTH)" != "FALSE") || "$(BUILD_BOTH)" == "TRUE"
  2190. ! if "$(BUILDTYPE)" == "DEBUG"
  2191. SECONDBUILDTYPE = RETAIL
  2192. ! else
  2193. SECONDBUILDTYPE = DEBUG
  2194. ! endif
  2195. all tree clean:
  2196. @$(MAKE) -$(MAKEFLAGS) -L BUILDTYPE=$(SECONDBUILDTYPE) RELEASETREE=$(TGTDIR:OBJ=) BUILD_BOTH=FALSE $@
  2197. !endif # RELEASE = NT