Leaked source code of windows server 2003
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.

233 lines
6.4 KiB

  1. # Microsoft Media Phone
  2. # Common Targets Makefile
  3. # common\cmntgt.mak
  4. # Copyright 1995 Microsoft Corp.
  5. # If INCLUDEd the following macros must be set for this file to work
  6. # effictively
  7. #
  8. # Macro Description
  9. #
  10. # TARGETS A list of items that are to be deleted during a
  11. # make clean_targets.
  12. #
  13. # SRCfiles A list of source files .c or .asm that will be used for
  14. # generation of depends and tags files.
  15. #
  16. # Hfiles List of .h files for use in generation of depends
  17. #
  18. # INCfiles List of .inc files for use in generation of depends
  19. #
  20. # OBJfiles A list of object files that is are deleted during a make
  21. # clean.
  22. #
  23. # DEFfile Def file to be used for linking.
  24. #
  25. # LIBname The name of the library to build, if used as a library
  26. # make file
  27. # Saved for later addition to StdHelp.
  28. # cleanret -- deletes RETAIL objs, dlls, exes and implibs for $(TargetPlatform).
  29. # cleandbg -- deletes DEBUG objs, dlls, exes and implibs for $(TargetPlatform).
  30. # cleantst -- deletes TEST objs, dlls, exes and implibs for $(TargetPlatform).
  31. # cleanbbt -- deletes BBT objs, dlls, exes and implibs for $(TargetPlatform).
  32. # cleanall -- does all targets.
  33. help:
  34. -@type <<
  35. Standard targets:
  36. help -- Get this message (default target).
  37. tgthelp -- Displays help for all bits of target information.
  38. depends -- Makes depend files for all source code.
  39. ret -- Does a retail build of the $(TargetPlatform) target.
  40. tst -- NYI. Does a test build of $(TargetPlatform) target.
  41. dbg -- Does a debug build of $(TargetPlatform) target.
  42. bld_info -- Displays the current nmake variables.
  43. nash_? -- Builds a retail (?=r) or debug (?=d) Nasville
  44. clean_nash_? -- Cleans a retail (?=r) or debug (?=d) Nasville build
  45. <<NOKEEP
  46. tgthelp:
  47. -@type <<
  48. Target control variables:
  49. os_t -- Target operating system, can be any of the following:
  50. WIN95 Win95
  51. nash Nashville
  52. cpu_t -- Target CPU to compile for. Can be any of the following:
  53. X86 Intel
  54. ALPHA N/A. DEC Alpha RISC chip
  55. MIPS N/A. MIPS R4000 RISC family
  56. PPC N/A. IBM PowerPC RISC family
  57. <<NOKEEP
  58. bld_info:
  59. -@type <<
  60. NMAKE build control variables:
  61. TargetPlatform: [$(TargetPlatform)]
  62. os_t: [$(os_t)]
  63. cpu_t: [$(cpu_t)]
  64. os_h: [$(os_h)]
  65. cpu_h: [$(cpu_h)]
  66. NEWTOOLS_PATH: [$(NEWTOOLS_PATH)]
  67. OBJDIR: [$(OBJDIR)]
  68. ProjectRootPath:[$(ProjectRootPath)]
  69. usingMFC: [$(usingMFC)]
  70. usingMAPI: [$(usingMAPI)]
  71. CC: [$(CC)]
  72. CFLAGS: [$(CFLAGS)]
  73. LocalCFLAGS: [$(LocalCFLAGS)]
  74. CC_Defines: [$(CC_Defines)]
  75. LINK: [$(LINK)]
  76. LFLAGS: [$(LFLAGS)]
  77. ASM: [$(ASM)]
  78. AFLAGS: [$(AFLAGS)]
  79. INCLUDE: [$(CIncludePaths)]
  80. LIBRULES: [$(LIBRULES)]
  81. <<NOKEEP
  82. not_done:
  83. -@type <<
  84. Sorry, this feature is not completed at this time.
  85. <<NOKEEP
  86. restart: cleanall all
  87. cleanall: cleanint cleantgt
  88. cleanint:
  89. -$(RM) $(OBJDIR)\*.obj $(OBJDIR)\*.lnk $(RESfile) > NUL
  90. -$(RM) *.pch $(OBJDIR)\*.pch $(OBJDIR)\*.cod $(OBJDIR)\*.sbr $(OBJDIR)\*.bsc $(OBJDIR)\*.pdb $(OBJDIR)\*.ACM > NUL
  91. -$(EXP) $(OBJDIR) > NUL
  92. cleantgt:
  93. -$(RM) $(TARGETS) $(OBJDIR)\*.map $(OBJDIR)\*.exp > NUL
  94. -$(EXP) $(OBJDIR) > NUL
  95. depends: dpndcore
  96. ## mkdep needs include directories $(CCmdIncPaths) in -Ifoo -Ibar form.
  97. dpndcore: $(SRCfiles)
  98. $(RM) -f depends.mak
  99. -!$(INCLUDES) $(MKDEP_options) $** >> depends.mak
  100. $(SED) -f $(ProjectRootPath)\common\depends.sed depends.mak > depends.new
  101. $(MV) depends.new depends.mak
  102. ###
  103. # A simple directory recursion tool...
  104. ###
  105. relay:
  106. cd $(DIR)
  107. @set PATH=$(PATH)
  108. $(MAKE) $(TARGET)
  109. cd $(MAKEDIR)
  110. ################
  111. ##
  112. ## Main target (exe, dll) generation
  113. ##
  114. ################
  115. ###
  116. # Generic library make file maintenance targets
  117. ###
  118. # SRCfiles the source files that make up the library
  119. # LIBOBJfiles the object files that make up the library
  120. # LIBname the name of the library
  121. ##
  122. #
  123. !IFDEF LIBname
  124. # Build a Library from the objects
  125. # Well, this is a pain. The lib utill has a particular format which uses
  126. # prefixed command of + - and combination if the like to control addition and
  127. # replacement of objects in a library. There is not much we can do with
  128. # prefixes for symbolic replacement, and without the command prefix of -+
  129. # when the object is already a part of the library lib simply ignores the
  130. # replacement object. So, rather then risk out of date library delete the
  131. # library and rebuld from scratch. That way we don't need no stinking command
  132. # prefixes.
  133. COPYLIB=$(CP) $(LIBname) $(PROJlibpath)
  134. $(LIBname): $(LIBOBJfiles)
  135. -$(RM) $@ > NUL
  136. $(LIBUTIL) @<<
  137. /out:$@
  138. $(**: = ^
  139. )
  140. <<NOKEEP
  141. !endif
  142. ###
  143. # Generic library make file maintenance targets
  144. ###
  145. # Build a exe from list of objs. Depends on following variables
  146. # OBJDIR = build directory
  147. # OBJfiles = All objs to be linked
  148. # LIBRARIES = standard libraries
  149. # LocalLibraries = Local libraries
  150. # LocalPreLibs = local libraries to be serached *before* standard libs
  151. # LFLAGS = standard link options
  152. # LocalLFLAGS = extra link options
  153. # DEFFile = definition file
  154. !IFDEF EXEname
  155. !IF !DEFINED(BaseOpt) && "$(LibType)"=="dll"
  156. BaseOpt=/BASE:@$(ProjectRootPath)\common\baseaddr.txt,$(@F)
  157. !ENDIF
  158. !ifdef DEFfile
  159. LinkDef=/DEF:$(DEFfile)
  160. !else
  161. LinkDef=/DEF:$(@B).def
  162. !endif
  163. !if "$(LibType)"=="dll"
  164. COPYLIB=$(CP) $*.lib $(PROJlibpath)
  165. !endif
  166. $(EXEname): $(OBJfiles) $(DEFfile) $(RESfile)
  167. @if not exist $(PROJlibpath) mkdir $(PROJlibpath)
  168. set PATH=$(STDCTOOLS_PATH)\bin;$(PATH)
  169. set LIB=$(LIBRULES)
  170. -@type <<$(OBJDIR)\response.lnk > NUL
  171. $(LFLAGS) $(BaseOpt) $(LocalLFLAGS)
  172. /OUT:$@
  173. /MAP:$*.map
  174. $(LinkDef)
  175. $(STARTUPOBJ) $(DEBUGUTILOBJ)
  176. $(OBJfiles:.obj=.obj^
  177. )
  178. $(RESfile)
  179. $(LocalPreLibs) $(LIBRARIES) $(LocalLibraries)
  180. <<KEEP
  181. $(LINK) @$(OBJDIR)\response.lnk
  182. -$(COPYLIB)
  183. $(RM) $*.lib
  184. # $(EXP)
  185. !IF "$(SYMFILES)"=="ON"
  186. -$(MAPSYM) -o $(OBJDIR)\$(@B).sym $(OBJDIR)\$(@B).map
  187. !ENDIF
  188. !ifdef BSCfile
  189. $(BSCfile): $(OBJDIR)\*.sbr
  190. $(BSCMAKE) /o $@ $(OBJDIR)\*.sbr
  191. !ENDIF
  192. !ENDIF # ifdef EXEname