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.

999 lines
19 KiB

  1. ##########################################################################
  2. #
  3. # Microsoft Confidential
  4. # Copyright (C) Microsoft Corporation 1991-96
  5. # All Rights Reserved.
  6. #
  7. ##########################################################################
  8. #
  9. # Shell Applet/DLL makefile
  10. #
  11. #
  12. # Required definitions:
  13. #
  14. # ROOT
  15. # Path to common project root.
  16. #
  17. # NAME
  18. # Base name of project used for:
  19. # .def input file, if any
  20. # .rc input file
  21. # .rcv input file
  22. # .res output file
  23. #
  24. # Definitions used if defined:
  25. #
  26. # BUILDDLL
  27. # Build .exe if this is not defined.
  28. #
  29. # BUILDLIB
  30. # Build .exe if this is not defined.
  31. #
  32. # BUILD
  33. # One of:
  34. # debug debug Win32 build
  35. # retail retail Win32 build
  36. # all debug and retail
  37. # depend generate dependencies
  38. #
  39. # DEFNAME
  40. # Use NAME.def if not defined
  41. #
  42. # RESNAME
  43. # Use NAME.res if not defined
  44. #
  45. # RCNAME
  46. # Use NAME.rc if not defined
  47. #
  48. # RCVNAME
  49. # Use NAME.rcv if not defined
  50. #
  51. # ILINK
  52. # Use incremental link
  53. #
  54. # CVWRETAIL
  55. # Compile with debug flags compatible with VC++ debugger.
  56. #
  57. # LEGO
  58. # Compile with flags for LEGO support.
  59. #
  60. # BROWSE
  61. # Create .sbr files for browser database.
  62. #
  63. # DBCS
  64. # Define DBCS.
  65. #
  66. # MAKELIST
  67. # Make an assembly listing for each compiled file.
  68. #
  69. # PRIVINC
  70. # Use NAME.h/pch as precompiled header if not defined.
  71. #
  72. # APPEXT
  73. # Use .dll, .exe or .lib (based upon BUILDDLL) as extension if this
  74. # is not defined.
  75. #
  76. # DLLBASE
  77. # Specifies the base address of the component, as passed
  78. # to the linker. May also be:
  79. # PREFBASE use coffbase.txt
  80. #
  81. # DLLENTRY
  82. # Use LibMain as the DLL entry-point if not defined. Valid
  83. # only if BUILDDLL is defined.
  84. #
  85. # RES_DIR
  86. # Use .\messages\usa as the resources dir, if not defined.
  87. #
  88. # STATOBJx
  89. # Other object modules or libraries to use to build an import
  90. # library. 'x' may be 0 thru 9. Start with 0.
  91. #
  92. # FIRSTOBJS
  93. # Guaranteed to be the first object modules linked, if this
  94. # really matters to you.
  95. #
  96. # PCHOBJx
  97. # C object modules compiled with a precompiled header. 'x'
  98. # may be 0 thru 9. Start with 0.
  99. #
  100. # THKOBJx
  101. # Object modules used for thunks. 'x' may be 0 thru 9. Start
  102. # with 0.
  103. #
  104. # MISCOBJx
  105. # All other object modules. 'x' may be 0 thru 9. Start with 0.
  106. #
  107. # LIBx
  108. # List of libraries to link, in order of 'x' (which may be
  109. # 0 thru 9). If LIB0 is not defined, then "libw" and "mnocrtw"
  110. # are prepended to the link line.
  111. #
  112. # CLEANLIST
  113. # List of files to clean, outside of the default files.
  114. #
  115. # DESTINATION
  116. # Directory to copy default targets to after successful build.
  117. #
  118. # CFLAGS
  119. # C compiler switches to be used on cl command line.
  120. #
  121. # SRCDIR
  122. # The directory that contains the source. If not defined,
  123. # then it is set to the parent.
  124. #
  125. # WIN32
  126. # Build 32-bit component.
  127. #
  128. # NOPDB
  129. # Compile with /Zd debug option rather than /Zi
  130. #
  131. WANT_C1032 = TRUE
  132. !ifdef ILINK
  133. DOILINK = TRUE
  134. !endif
  135. !ifndef NAME
  136. !ERROR NAME variable not defined.
  137. !endif
  138. !ifndef ROOT
  139. !ERROR ROOT environment variable not defined.
  140. !endif
  141. #
  142. # Set destination directory.
  143. #
  144. !if "$(BUILD)" == "debug" || "$(BUILD)" == "retail" || "$(BUILD)" == "maxdebug"
  145. DEFAULTVERDIR = $(BUILD)
  146. !endif
  147. #
  148. # Set tools' paths
  149. #
  150. INCLUDES = includes.exe
  151. #
  152. # Set tool options
  153. #
  154. INCLUDES_SWITCHES = -e -i -L. -S.
  155. #
  156. # Set fundamentals
  157. #
  158. !ifndef PRIVINC
  159. PRIVINC = $(NAME)
  160. !endif
  161. !ifndef APPEXT
  162. !ifdef BUILDDLL
  163. APPEXT = dll
  164. !elseif defined(BUILDLIB)
  165. APPEXT = lib
  166. ! else
  167. APPEXT = exe
  168. !endif
  169. !endif # APPEXT
  170. # Default .def file name.
  171. !ifndef DEFNAME
  172. DEFNAME = $(NAME).def
  173. !endif
  174. # Default .res file name.
  175. !ifndef RESNAME
  176. RESNAME = $(NAME).res
  177. !endif
  178. # Default .rc file name.
  179. !ifndef RCNAME
  180. RCNAME = $(NAME).rc
  181. !endif
  182. # Default .rcv file name.
  183. !ifndef RCVNAME
  184. RCVNAME = $(NAME).rcv
  185. !endif
  186. # Default entry point and base for dlls.
  187. !ifdef WIN32
  188. !ifdef BUILDDLL
  189. !if "$(DLLBASE)" == "PREFBASE"
  190. DLLBASE = @$(ROOT)\dev\inc\coffbase.txt,$(NAME)
  191. !endif
  192. !ifndef DLLENTRY
  193. DLLENTRY = LibMain
  194. !endif
  195. !endif
  196. !endif
  197. # Default to having the retail version of a dll produce a public lib
  198. !if "$(VERDIR)" == "retail" && defined(BUILDDLL)
  199. MKPUBLIC = TRUE
  200. !endif
  201. #
  202. # Lists of object modules
  203. #
  204. STATOBJS = $(STATOBJ0) $(STATOBJ1) $(STATOBJ2) $(STATOBJ3) \
  205. $(STATOBJ4) $(STATOBJ5) $(STATOBJ6) $(STATOBJ7) \
  206. $(STATOBJ8) $(STATOBJ9)
  207. MISCOBJS = $(FIRSTOBJS) $(MISCOBJ0) $(MISCOBJ1) $(MISCOBJ2) \
  208. $(MISCOBJ3) $(MISCOBJ4) $(MISCOBJ5) $(MISCOBJ6) \
  209. $(MISCOBJ7) $(MISCOBJ8) $(MISCOBJ9)
  210. PCHOBJS = $(PCHOBJ0) $(PCHOBJ1) $(PCHOBJ2) $(PCHOBJ3) $(PCHOBJ4) \
  211. $(PCHOBJ5) $(PCHOBJ6) $(PCHOBJ7) $(PCHOBJ8) $(PCHOBJ9)
  212. THKOBJS = $(THKOBJ0) $(THKOBJ1) $(THKOBJ2) $(THKOBJ3) $(THKOBJ4) \
  213. $(THKOBJ5) $(THKOBJ6) $(THKOBJ7) $(THKOBJ8) $(THKOBJ9)
  214. !ifdef PCHOBJ0
  215. INFERPCH = TRUE
  216. MISCOBJ9 = $(MISCOBJ9) pch.obj
  217. PCH_C_SRC = pch.c
  218. !endif # PCHOBJ0
  219. !ifdef CPPPCHOBJS
  220. INFERPCHCPP = TRUE
  221. MISCOBJ9 = $(MISCOBJ9) pchcpps.obj
  222. PCH_CPP_SRC = pchcpps.cpp
  223. !endif # CPPPCHOBJS
  224. OBJS = $(MISCOBJS) $(PCHOBJS) $(THKOBJS) $(CPPOBJS) $(CPPPCHOBJS)
  225. !ifndef LIB0
  226. LIB0 = libw mnocrtw
  227. !endif
  228. LIBS = $(LIB0) $(LIB1) $(LIB2) $(LIB3) $(LIB4) $(LIB5) \
  229. $(LIB6) $(LIB7) $(LIB8) $(LIB9)
  230. #-----------------------------------------------------------------------
  231. # Branch depending on the level of makefile recursion
  232. #-----------------------------------------------------------------------
  233. !ifndef VERDIR
  234. # (repcmd doesn't seem to like leading or trailing spaces)
  235. !ifdef VERSIONLIST
  236. VERSIONLIST =debug retail $(VERSIONLIST)
  237. !else
  238. VERSIONLIST =debug retail
  239. !endif
  240. COMMONMKFILE = makefile
  241. !include $(ROOT)\shell\shell.mk
  242. $(RESNAME):
  243. cd $(BUILD)
  244. $(MAKE) BUILD=$(BUILD) VERDIR=$(BUILD) $(MISC) -f ..\makefile $(RESNAME)
  245. cd ..
  246. !else ## VERDIR
  247. !ifndef SRCDIR
  248. SRCDIR = ..
  249. !endif
  250. #
  251. # Macros for 'clean' command
  252. #
  253. CLEANLIST = $(CLEANLIST) $(NAME).$(APPEXT) *.pch $(RESNAME)
  254. !ifdef INFERPCH
  255. CLEANLIST = $(CLEANLIST) pch.c
  256. !endif # INFERPCH
  257. !ifdef INFERPCHCPP
  258. CLEANLIST = $(CLEANLIST) pchcpps.cpp
  259. !endif # INFERPCHCPP
  260. !ifdef BUILDDLL
  261. CLEANLIST = $(CLEANLIST) $(NAME).rdf $(NAME).lib
  262. !endif
  263. #
  264. # Set 32-bitness for WIN32
  265. #
  266. !ifndef WIN32
  267. IS_16 = TRUE
  268. !else
  269. IS_32 = TRUE
  270. !endif
  271. IS_PRIVATE = TRUE
  272. IS_SDK = TRUE
  273. MASM6 = TRUE
  274. #
  275. # Set compile flags
  276. #
  277. !ifndef WIN32
  278. #
  279. # Win16 flags
  280. #
  281. !if "$(VERDIR)" == "debug"
  282. CFLAGS = $(CFLAGS) -Od -Zid /f-
  283. AFLAGS = $(AFLAGS) /Zim
  284. RCFLAGS = $(RCFLAGS) -DDEBUG
  285. !else
  286. CFLAGS = $(CFLAGS) -Oxs
  287. AFLAGS = $(AFLAGS) /Zm
  288. !ifdef CVWRETAIL
  289. CFLAGS = $(CFLAGS) -Zid
  290. AFLAGS = $(AFLAGS) /Zi
  291. !endif
  292. !endif # VERDIR
  293. !else # !WIN32
  294. #
  295. # Win32 flags
  296. #
  297. # (error out on strict warnings, like the NT build does)
  298. CFLAGS = $(CFLAGS) -W3 -WX
  299. CFLAGS = $(CFLAGS) -Gz -GF -Gy # stdcall
  300. # strings are const, merged
  301. # function separation
  302. !if "$(VERDIR)" == "debug"
  303. CFLAGS = $(CFLAGS) -Od
  304. !ifdef NOPDB
  305. CFLAGS = $(CFLAGS) -Zd
  306. !else
  307. CFLAGS = $(CFLAGS) -Zi
  308. !endif
  309. L32FLAGS = $(L32FLAGS) -debug
  310. RCFLAGS = $(RCFLAGS) -DDEBUG
  311. # (make sure we can get .pdb files that work)
  312. NOMERGETEXT = TRUE
  313. !else # DEBUG
  314. # (full opt, favor size)
  315. CFLAGS = $(CFLAGS) -Oxs
  316. !endif # DEBUG
  317. #
  318. # Support incremental linking.
  319. #
  320. !ifdef DOILINK
  321. CFLAGS = $(CFLAGS) -Zi
  322. L32FLAGS = $(L32FLAGS) -incremental:yes -debug
  323. !endif # DOILINK
  324. #
  325. # Support for lego
  326. #
  327. !ifdef LEGO
  328. AFLAGS = $(AFLAGS) /Zi
  329. LEGO_LIBFLAGS = -debugtype:cv
  330. !endif # LEGO
  331. !endif # WIN32
  332. #
  333. # Create .SBR files for browser database
  334. #
  335. !ifdef BROWSE
  336. CFLAGS = $(CFLAGS) -Fr
  337. !endif
  338. FEATURE_IE40 = 1
  339. !ifdef FEATURE_IE40
  340. CFLAGS = $(CFLAGS) -DFEATURE_IE40 -DNASH
  341. !endif
  342. #
  343. # Hideous hack to ensure CL and ML are set in the environment
  344. #
  345. !if [set CL=;]
  346. !endif
  347. !if [set ML=;]
  348. !endif
  349. #
  350. # Set international things
  351. #
  352. # note INTL_SRC, and LANG are external macros set by international
  353. !ifdef LANG
  354. TARGETS = $(TARGETS) $(NAME).$(LANG)
  355. !else
  356. TARGETS = $(TARGETS) $(NAME).$(APPEXT)
  357. !if defined(BUILDDLL) && defined(MKPUBLIC)
  358. TARGETS = $(TARGETS) $(NAME).lib
  359. !endif
  360. !endif # LANG
  361. #
  362. # Include other shell makefile
  363. #
  364. !include $(ROOT)\shell\shell.mk
  365. #
  366. # More compile flags after the include
  367. #
  368. !ifdef DBCS
  369. CFLAGS = $(CFLAGS) -DDBCS
  370. AFLAGS = $(AFLAGS) -DDBCS
  371. RCFLAGS = $(RCFLAGS) -DDBCS
  372. !endif
  373. # Don't build with memphis structures
  374. CFLAGS = $(CFLAGS) -D_WIN32_WINDOWS=0x0400
  375. !ifndef WIN32
  376. !ifndef NOPASCAL
  377. CFLAGS = $(CFLAGS) -Gc
  378. !endif
  379. !ifdef NOMORECFLAGS
  380. CL = $(CFLAGS)
  381. !else
  382. !ifdef BUILDDLL
  383. !ifdef LARGEDLL
  384. CL = $(CFLAGS) -ALw -GD -W3 -DBUILDDLL
  385. !else
  386. CL = $(CFLAGS) -AMw -GD -W3 -DBUILDDLL
  387. !endif
  388. !else
  389. CL = $(CFLAGS) -AMd -GA -W3
  390. !endif # BUILDDLL
  391. !if "$(VERDIR)" == "retail"
  392. CL = $(CL) -G3
  393. !else
  394. CL = $(CL) -G2
  395. !endif
  396. !endif # NOMORECFLAGS
  397. !endif # !WIN32
  398. !ifdef MAKELIST
  399. CL = $(CL) -Fc
  400. !endif
  401. !ifdef WIN32
  402. RCFLAGS = $(RCFLAGS) -DWIN32
  403. !ifdef BUILDDLL
  404. CL = $(CFLAGS) -W3 -DBUILDDLL -DWIN32 -D_X86_
  405. !else
  406. CL = $(CFLAGS) -W3 -DWIN32 -D_X86_
  407. !endif
  408. !endif
  409. ML = $(AFLAGS)
  410. CCH = $(CC) -Yc$(PRIVINC).h
  411. CCU = $(CC) -Yu$(PRIVINC).h
  412. CCX = $(CC)
  413. LFLAGS = /ALIGN:16 /MAP /NOE /NOD
  414. !if "$(VERDIR)" == "debug" || DEFINED(CVWRETAIL)
  415. LFLAGS = /CO $(LFLAGS) # debug linker flags
  416. L32FLAGS = $(L32FLAGS) -debug
  417. !endif
  418. !ifndef RES_DIR
  419. RES_DIR = $(SRCDIR)\messages\usa
  420. !endif
  421. ##############
  422. # build rules
  423. ##############
  424. default: $(NAME).$(APPEXT)
  425. #
  426. # Individual makefiles should have more dependencies if needed
  427. # Note that the RES file doesn't really depend on the PCH file, but
  428. # it does depend on everthing the PCH file depends on.
  429. #
  430. $(RESNAME): $(RES_DIR)\$(RCNAME) $(RES_DIR)\$(RCVNAME)
  431. !ifdef WIN32
  432. @set OLDPATH=$(PATH)
  433. @set PATH=$(ROOT)\dev\tools\c1032\bin;$(PATH)
  434. !endif
  435. $(RC) -r $(RCFLAGS) -I$(SRCDIR) -I$(RES_DIR) -Fo$(RESNAME) $(RES_DIR)\$(RCNAME)
  436. !ifdef WIN32
  437. @set PATH=%OLDPATH%
  438. !endif
  439. !ifdef INFERPCH
  440. $(RESNAME): $(PRIVINC).pch
  441. !else # INFERPCH
  442. !ifdef INFERPCHCPP
  443. $(RESNAME): pchcpps.pch
  444. !endif # INFERPCHCPP
  445. !endif # INFERPCH
  446. ##################
  447. # inference rules
  448. ##################
  449. {$(SRCDIR)}.c.lst:
  450. @$(CC) -Fc$*.lst $(SRCDIR)\$*.c
  451. {$(SRCDIR)}.cpp.lst:
  452. @$(CC) -Fc$*.lst $(SRCDIR)\$*.cpp
  453. {$(SRCDIR)}.c.obj:
  454. @$(CC) $(SRCDIR)\$*.c
  455. {$(SRCDIR)}.cpp.obj:
  456. @$(CC) $(SRCDIR)\$*.cpp
  457. {$(SRCDIR)}.asm.obj:
  458. @$(ASM) $(SRCDIR)\$*.asm
  459. !ifdef INFERPCH
  460. $(PCH_C_SRC):
  461. echo #include "$(PRIVINC).h" > $(PCH_C_SRC)
  462. !endif # INFERPCH
  463. !ifdef INFERPCHCPP
  464. $(PCH_CPP_SRC):
  465. echo #include "$(PRIVINC).h" > $(PCH_CPP_SRC)
  466. !endif # INFERPCHCPP
  467. #
  468. # Rules for compiling modules
  469. #
  470. # (Individual makefiles should have more dependencies if needed)
  471. #
  472. $(PRIVINC).pch pch.obj: $(PCH_C_SRC) $(SRCDIR)\$(PRIVINC).h
  473. !ifndef WIN32
  474. @$(CCH) -I$(SRCDIR) -NT _TEXT $(PCH_C_SRC)
  475. !else
  476. @$(CCH) -I$(SRCDIR) $(FORCE_CPP) $(PCH_C_SRC)
  477. !endif
  478. pchcpps.pch pchcpps.obj: $(PCH_CPP_SRC) $(SRCDIR)\$(PRIVINC).h
  479. @$(CCH) -I$(SRCDIR) -Fppchcpps.pch $(PCH_CPP_SRC)
  480. !ifndef WIN32
  481. !ifdef PCHOBJ0
  482. $(PCHOBJ0): $(PRIVINC).pch
  483. !ifdef CODESEG0
  484. @$(CCU) -NT $(CODESEG0) $(SRCDIR)\$*.c
  485. !else
  486. @$(CCU) $(SRCDIR)\$*.c
  487. !endif
  488. !endif
  489. !ifdef PCHOBJ1
  490. $(PCHOBJ1): $(PRIVINC).pch
  491. !ifdef CODESEG1
  492. @$(CCU) -NT $(CODESEG1) $(SRCDIR)\$*.c
  493. !else
  494. @$(CCU) $(SRCDIR)\$*.c
  495. !endif
  496. !endif
  497. !ifdef PCHOBJ2
  498. $(PCHOBJ2): $(PRIVINC).pch
  499. !ifdef CODESEG2
  500. @$(CCU) -NT $(CODESEG2) $(SRCDIR)\$*.c
  501. !else
  502. @$(CCU) $(SRCDIR)\$*.c
  503. !endif
  504. !endif
  505. !ifdef PCHOBJ3
  506. $(PCHOBJ3): $(PRIVINC).pch
  507. !ifdef CODESEG3
  508. @$(CCU) -NT $(CODESEG3) $(SRCDIR)\$*.c
  509. !else
  510. @$(CCU) $(SRCDIR)\$*.c
  511. !endif
  512. !endif
  513. !ifdef PCHOBJ4
  514. $(PCHOBJ4): $(PRIVINC).pch
  515. !ifdef CODESEG4
  516. @$(CCU) -NT $(CODESEG4) $(SRCDIR)\$*.c
  517. !else
  518. @$(CCU) $(SRCDIR)\$*.c
  519. !endif
  520. !endif
  521. !ifdef PCHOBJ5
  522. $(PCHOBJ5): $(PRIVINC).pch
  523. !ifdef CODESEG5
  524. @$(CCU) -NT $(CODESEG5) $(SRCDIR)\$*.c
  525. !else
  526. @$(CCU) $(SRCDIR)\$*.c
  527. !endif
  528. !endif
  529. !ifdef PCHOBJ6
  530. $(PCHOBJ6): $(PRIVINC).pch
  531. !ifdef CODESEG6
  532. @$(CCU) -NT $(CODESEG6) $(SRCDIR)\$*.c
  533. !else
  534. @$(CCU) $(SRCDIR)\$*.c
  535. !endif
  536. !endif
  537. !ifdef PCHOBJ7
  538. $(PCHOBJ7): $(PRIVINC).pch
  539. !ifdef CODESEG7
  540. @$(CCU) -NT $(CODESEG7) $(SRCDIR)\$*.c
  541. !else
  542. @$(CCU) $(SRCDIR)\$*.c
  543. !endif
  544. !endif
  545. !ifdef PCHOBJ8
  546. $(PCHOBJ8): $(PRIVINC).pch
  547. !ifdef CODESEG8
  548. @$(CCU) -NT $(CODESEG8) $(SRCDIR)\$*.c
  549. !else
  550. @$(CCU) $(SRCDIR)\$*.c
  551. !endif
  552. !endif
  553. !ifdef PCHOBJ9
  554. $(PCHOBJ9): $(PRIVINC).pch
  555. !ifdef CODESEG9
  556. @$(CCU) -NT $(CODESEG9) $(SRCDIR)\$*.c
  557. !else
  558. @$(CCU) $(SRCDIR)\$*.c
  559. !endif
  560. !endif
  561. !endif
  562. !ifdef WIN32
  563. !ifdef CPPOBJS
  564. $(CPPOBJS):
  565. @$(CCX) $(SRCDIR)\$*.cpp
  566. !endif # CPPOBJS
  567. !ifdef CPPPCHOBJS
  568. $(CPPPCHOBJS): pchcpps.pch
  569. @$(CCU) -Fppchcpps.pch $(SRCDIR)\$*.cpp
  570. !endif # CPPPCHOBJS
  571. !ifdef PCHOBJ0
  572. $(PCHOBJS): $(PRIVINC).pch
  573. @$(CCU) $(FORCE_CPP) $(SRCDIR)\$*.c
  574. !endif # PCHOBJ0
  575. !endif # WIN32
  576. #
  577. # Compose the list of dependencies for the project
  578. #
  579. DEPENDS = $(DEPENDS) $(OBJS)
  580. !ifndef BUILDLIB
  581. DEPENDS = $(DEPENDS) $(SRCDIR)\$(DEFNAME)
  582. !endif
  583. !if defined(WIN32) && !defined(BUILDLIB)
  584. DEPENDS = $(DEPENDS) $(RESNAME)
  585. !endif
  586. #
  587. # Rule for building app or DLL (16-bit)
  588. #
  589. !ifndef WIN32
  590. $(NAME).$(APPEXT):: $(DEPENDS)
  591. $(LINK16) @<<
  592. $(LFLAGS) +
  593. !ifdef FIRSTOBJS
  594. $(FIRSTOBJS) +
  595. !endif
  596. !ifdef THKOBJS
  597. $(THKOBJS) +
  598. !endif
  599. !ifdef MISCOBJ0
  600. $(MISCOBJ0) +
  601. !endif
  602. !ifdef MISCOBJ1
  603. $(MISCOBJ1) +
  604. !endif
  605. !ifdef MISCOBJ2
  606. $(MISCOBJ2) +
  607. !endif
  608. !ifdef MISCOBJ3
  609. $(MISCOBJ3) +
  610. !endif
  611. !ifdef MISCOBJ4
  612. $(MISCOBJ4) +
  613. !endif
  614. !ifdef MISCOBJ5
  615. $(MISCOBJ5) +
  616. !endif
  617. !ifdef MISCOBJ6
  618. $(MISCOBJ6) +
  619. !endif
  620. !ifdef MISCOBJ7
  621. $(MISCOBJ7) +
  622. !endif
  623. !ifdef MISCOBJ8
  624. $(MISCOBJ8) +
  625. !endif
  626. !ifdef MISCOBJ9
  627. $(MISCOBJ9) +
  628. !endif
  629. !ifdef PCHOBJ0
  630. $(PCHOBJ0) +
  631. !endif
  632. !ifdef PCHOBJ1
  633. $(PCHOBJ1) +
  634. !endif
  635. !ifdef PCHOBJ2
  636. $(PCHOBJ2) +
  637. !endif
  638. !ifdef PCHOBJ3
  639. $(PCHOBJ3) +
  640. !endif
  641. !ifdef PCHOBJ4
  642. $(PCHOBJ4) +
  643. !endif
  644. !ifdef PCHOBJ5
  645. $(PCHOBJ5) +
  646. !endif
  647. !ifdef PCHOBJ6
  648. $(PCHOBJ6) +
  649. !endif
  650. !ifdef PCHOBJ7
  651. $(PCHOBJ7) +
  652. !endif
  653. !ifdef PCHOBJ8
  654. $(PCHOBJ8) +
  655. !endif
  656. !ifdef PCHOBJ9
  657. $(PCHOBJ9) +
  658. !endif
  659. $(NAME).$(APPEXT)
  660. $(NAME).map
  661. !ifdef LIB0
  662. $(LIB0) +
  663. !endif
  664. !ifdef LIB1
  665. $(LIB1) +
  666. !endif
  667. !ifdef LIB2
  668. $(LIB2) +
  669. !endif
  670. !ifdef LIB3
  671. $(LIB3) +
  672. !endif
  673. !ifdef LIB4
  674. $(LIB4) +
  675. !endif
  676. !ifdef LIB5
  677. $(LIB5) +
  678. !endif
  679. !ifdef LIB6
  680. $(LIB6) +
  681. !endif
  682. !ifdef LIB7
  683. $(LIB7) +
  684. !endif
  685. !ifdef LIB8
  686. $(LIB8) +
  687. !endif
  688. !ifdef LIB9
  689. $(LIB9) +
  690. !endif
  691. $(SRCDIR)\$(DEFNAME)
  692. <<
  693. $(MAPSYM) $(NAME).map
  694. !ifdef BUILDDLL #[
  695. !ifdef MKPUBLIC #[
  696. # Use the stripped def file to produce the lib.
  697. mkpublic $(SRCDIR)\$(DEFNAME) $(NAME).rdf
  698. $(IMPLIB) $(NAME).lib $(NAME).rdf
  699. !else #][
  700. # Use the normal def file to produce the lib.
  701. $(IMPLIB) $(NAME).lib $(SRCDIR)\$(DEFNAME)
  702. !endif #]
  703. !endif #]
  704. !endif
  705. !ifdef WIN32
  706. #
  707. # Tell the world we're building Nashville bits
  708. #
  709. !if defined(FEATURE_IE40)
  710. !message
  711. !message FEATURE_IE40 is turned on
  712. !message
  713. !endif
  714. #
  715. # Rule for building static library
  716. #
  717. !if defined(BUILDLIB)
  718. $(NAME).$(APPEXT): $(DEPENDS)
  719. $(LINK32) -lib $(LEGOLIBS) @<<
  720. -out:$(NAME).$(APPEXT)
  721. $(MISCOBJS) $(PCHOBJS) $(CPPOBJS) $(CPPPCHOBJS)
  722. <<
  723. !endif # BUILDLIB
  724. #
  725. # Rule for building lib, derived from DLL
  726. #
  727. !if defined(BUILDDLL)
  728. $(NAME).lib $(NAME).rxp: $(SRCDIR)\$(DEFNAME) $(STATOBJS)
  729. $(LINK32) -lib $(LEGO_LIBFLAGS) $(LEGOLIBS) @<<
  730. -out:$(NAME).lib
  731. -def:$(SRCDIR)\$(DEFNAME)
  732. $(MISCOBJS) $(PCHOBJS) $(CPPOBJS) $(CPPPCHOBJS)
  733. <<
  734. !ifdef STATOBJ0
  735. $(LINK32) -lib $(LEGOLIBS) $(NAME).lib $(STATOBJS)
  736. !endif # STATOBJ0
  737. if exist $(NAME).rxp del $(NAME).rxp
  738. ren $(NAME).exp $(NAME).rxp
  739. !endif # BUILDDLL
  740. #
  741. # Rule for building DLL or EXE
  742. #
  743. !if !defined(BUILDLIB)
  744. !ifdef BUILDDLL
  745. $(NAME).$(APPEXT):: $(DEPENDS) $(NAME).rxp $(NAME).lib
  746. !else # BUILDDLL
  747. $(NAME).$(APPEXT):: $(DEPENDS)
  748. !endif # BUILDDLL
  749. $(LINK32) -link @<<
  750. $(L32FLAGS)
  751. -out:$(NAME).$(APPEXT)
  752. !ifndef DOILINK
  753. -map:$(NAME).map
  754. !endif # DOILINK
  755. !ifdef BUILDDLL
  756. -dll
  757. !ifdef DLLBASE
  758. -base:$(DLLBASE)
  759. !else # DLLBASE
  760. -base:0x410000
  761. !endif # DLLBASE
  762. $(NAME).rxp
  763. !else # BUILDDLL
  764. -base:0x400000
  765. !endif # BUILDDLL
  766. $(MISCOBJS) $(PCHOBJS) $(CPPOBJS) $(CPPPCHOBJS)
  767. $(LIBS)
  768. $(RESNAME)
  769. <<
  770. !ifdef DOILINK
  771. pdbmap $(NAME).$(APPEXT)
  772. !endif # DOILINK
  773. $(MAPSYM) -s $(NAME).map
  774. !ifdef MKPUBLIC
  775. $(NAME).$(APPEXT)::$(NAME).rlb
  776. $(NAME).rlb : $(DEPENDS) $(SRCDIR)\$(DEFNAME) $(STATOBJS)
  777. mkpublic $(SRCDIR)\$(DEFNAME) $(NAME).rdf
  778. $(LINK32) -lib $(LEGOLIBS) @<<
  779. -out:$(NAME).rlb
  780. -def:$(NAME).rdf
  781. $(MISCOBJS) $(PCHOBJS) $(CPPOBJS) $(CPPPCHOBJS)
  782. <<
  783. !ifdef STATOBJ0
  784. $(LINK32) -lib $(LEGOLIBS) @<<
  785. -out:$(NAME).rlb
  786. $(NAME).rlb $(STATOBJS)
  787. <<
  788. !endif # STATOBJ0
  789. !endif # MKPUBLIC
  790. !endif # BUILDLIB
  791. !endif # WIN32
  792. #
  793. # Rule for building thunks
  794. #
  795. !ifndef WIN32 #[
  796. # // If there are any THKOBJS then build them here.
  797. # // REVIEW - HACK You'd be better off not working out what the next line does :-)
  798. !if "$(THKOBJS)" != " " #[
  799. # // Include files inserted by the thunk compiler for the 16-bit half.
  800. THUNKDIR=$(ROOT)\shell\thunk
  801. THUNKINCS16=$(THUNKDIR)\thk.inc \
  802. $(THUNKDIR)\winerror.inc \
  803. $(THUNKDIR)\win31err.inc
  804. $(THKOBJS): $(THUNKDIR)\$(VERDIR)\$(@B).asm $(THUNKDIR)\$(@B).inc \
  805. $(THUNKDIR)\fltthk.inc
  806. @set OLDML=%ML%
  807. @set OLDINCLUDE=%INCLUDE%
  808. @set ML=-DIS_16 -nologo -W2 -Zd -c -Cx -DMASM6 -DDEBLEVEL=1 $(DDEBUG) -Zd -Gc
  809. @set INCLUDE=$(THUNKDIR);$(INCLUDE)
  810. @mlx -Fo$@ $(THUNKDIR)\$(VERDIR)\$(@B).asm
  811. @set ML=%OLDML%
  812. @set INCLUDE=%OLDINCLUDE%
  813. !endif #]
  814. !endif #]
  815. #
  816. # Rule for binding resources to Win16 app or DLL
  817. #
  818. !ifndef WIN32
  819. $(NAME).$(APPEXT):: $(DEPENDS) $(RESNAME)
  820. $(RC) $(RCFLAGS) $(RCFFLAGS) -fe $(NAME).$(APPEXT) $(RESNAME)
  821. !endif
  822. #
  823. # Include source file dependencies.
  824. #
  825. !if exist($(SRCDIR)\depend.mk)
  826. !include $(SRCDIR)\depend.mk
  827. !elseif "$(BUILD)" != "depend"
  828. !message Warning: DEPEND.MK not found.
  829. !endif
  830. #
  831. # Build source file dependencies.
  832. #
  833. # If nmake complains it doesn't know how to make depend.mk, you
  834. # need to add a rule in your makefile that explains how to make
  835. # it.
  836. #
  837. !if "$(BUILD)" != "depend"
  838. depend:
  839. $(MAKE) BUILD=depend
  840. !else
  841. depend: $(SRCDIR)\depend.mk
  842. !endif
  843. !endif ## VERDIR