home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / makefile.sub < prev    next >
Makefile  |  1998-06-17  |  7KB  |  284 lines

  1. ####
  2. # makefile.sub - Subdirectory-specific makefile for new VCRT build process
  3. #
  4. #   Copyright (c) 1993-1997, Microsoft Corporation. All rights reserved.
  5. #
  6. # Purpose:
  7. #   This makefile builds the C++ runtimes for Multi-thread, Single-Thread
  8. #   and DLL.
  9. #
  10. #   This is a general-purpose makefile.  It is !INCLUDEd by the makefile
  11. #   in each subdirectory (hence the .SUB extension).  All subdirectory-
  12. #   specific make information should be embedded in the SOURCES file in
  13. #   that subdirectory, not in this file.
  14. #
  15. #   Change to the appropriate subdirectory and type NMAKE DEPEND to
  16. #   rebuild the dependencies.  These are stored in DEPEND.DEF in each
  17. #   subdirectory.
  18. #
  19. ###############################################################################
  20.  
  21. # Change this to BLD_ASM=1 if you have MASM 6.11a or later and wish
  22. # to re-build the assembler sources provided in this release.
  23.  
  24. BLD_ASM=0
  25.  
  26. #
  27. # Macro definitions:
  28. #
  29. ###############################################################################
  30.  
  31. #
  32. # Add .S suffix for assembler files on platforms other than x86
  33. #
  34.  
  35. .SUFFIXES: .s
  36.  
  37. #
  38. !if "$(BLD_DBG)" == "1"
  39. !if "$(PRE_BLD)" == "1"
  40. CFLAGS=-D_DEBUG -Od
  41. !else
  42. CFLAGS=-Zi -D_DEBUG -Od
  43. !endif
  44. !if "$(TARGET_CPU)"!="PPC"
  45. !if "$(PRE_BLD)" == "1"
  46. AFLAGS=-D_DEBUG
  47. !else
  48. AFLAGS=-Zi -D_DEBUG
  49. !endif
  50. !endif
  51. !else
  52. CFLAGS=-O1
  53. AFLAGS=
  54. !endif
  55.  
  56. # Tool definitions:
  57.  
  58. CC=cl
  59. LIB=link -lib -nologo
  60. !if "$(TARGET_CPU)"=="i386" || "$(TARGET_CPU)"=="PMAC"
  61. AS=ml
  62. !elseif "$(TARGET_CPU)"=="ALPHA"
  63. AS=asaxp -Ialpha
  64. !elseif "$(TARGET_CPU)"=="PPC"
  65. AS=pas
  66. !else
  67. AS=cl
  68. !endif
  69.  
  70. #
  71. # Source file definitions:
  72. #
  73. ###############################################################################
  74.  
  75. A_INCLUDES=-I.
  76. C_INCLUDES=-I.
  77. !if    "$(TARGET_CPU)"=="PMAC"
  78. !if "$(POST_BLD)"=="1"
  79. C_INCLUDES=-I./mppc $(C_INCLUDES)
  80. !else
  81. C_INCLUDES=-I./mac $(C_INCLUDES)
  82. !endif
  83. !endif
  84.  
  85. #
  86. # Inference rules:
  87. #
  88. # (Due to the kind of dependencies used below, we must explicitly define
  89. # inference rules to effect construction of the object files.)
  90. #
  91. ###############################################################################
  92.  
  93. !if    "$(TARGET_CPU)"=="PMAC"
  94. CFLAGS=$(CFLAGS) -Zp2 -DB_END
  95. !endif
  96. CXXFLAGS=$(CFLAGS) -GR -GX -d1Binl
  97. !if "$(UNWINDTAB)"=="1"
  98. !if    "$(TARGET_CPU)"=="PMAC" && "$(DIR)"=="eh"
  99. CXXFLAGS=$(CXXFLAGS) -d2unwindtab
  100. !endif
  101. !endif
  102.  
  103. !if "$(POST_BLD)"!="1"
  104. CXXFLAGS=$(CXXFLAGS) -Istdhpp
  105. !endif
  106.  
  107.  
  108. #
  109. # Rules for end-user source build
  110. #
  111. #
  112. # LSOURCES will override A_INCLUDES and C_INCLUDES for conv/ and tran/ subdirs.
  113. #
  114. ###############################################################################
  115.  
  116. !if "$(POST_BLD)"=="1"
  117. !INCLUDE makefile.inc
  118. !else
  119. !INCLUDE lsources.
  120. !endif
  121.  
  122. !if "$(TARGET_CPU)"!="PMAC"
  123.  
  124. .c{$(OBJDIR)}.obj:
  125.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  126.  
  127. !if "$(TARGET_CPU)"=="ALPHA"
  128.  
  129. {alpha}.c{$(OBJDIR)}.obj:
  130.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  131.  
  132. !elseif "$(TARGET_CPU)"=="i386"
  133.  
  134. {intel}.c{$(OBJDIR)}.obj:
  135.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  136.  
  137. !elseif "$(TARGET_CPU)"=="mips"
  138.  
  139. {mips}.c{$(OBJDIR)}.obj:
  140.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  141.  
  142. !elseif "$(TARGET_CPU)"=="PPC"
  143.  
  144. {ppc}.c{$(OBJDIR)}.obj:
  145.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  146.  
  147. !endif
  148.  
  149. .cpp{$(OBJDIR)}.obj:
  150.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  151.  
  152. !if "$(TARGET_CPU)"=="ALPHA"
  153.  
  154. {alpha}.cpp{$(OBJDIR)}.obj:
  155.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  156.  
  157. {alpha}.s{$(OBJDIR)}.obj:
  158.     $(AS) $(AFLAGS) $(A_INCLUDES) -Fo $@ $<
  159.  
  160. !elseif "$(TARGET_CPU)"=="i386"
  161.  
  162. {intel}.cpp{$(OBJDIR)}.obj:
  163.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  164.  
  165. !IF $(BLD_ASM)==1
  166.  
  167. {intel}.asm{$(OBJDIR)}.obj:
  168.     $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $<
  169.  
  170. !ENDIF
  171.  
  172. !elseif "$(TARGET_CPU)"=="mips"
  173.  
  174. {mips}.cpp{$(OBJDIR)}.obj:
  175.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  176.  
  177. {mips}.s{$(OBJDIR)}.obj:
  178.     $(CC) $(CFLAGS) /QMmips3 $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  179.  
  180. !elseif "$(TARGET_CPU)"=="PPC"
  181.  
  182. {ppc}.cpp{$(OBJDIR)}.obj:
  183.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  184.  
  185. {ppc}.s{$(OBJDIR)}.obj:
  186.     $(CC) -E $(CFLAGS) $(A_INCLUDES) $< > $(OBJDIR)\$(<F)
  187.     $(AS) $(AFLAGS) -o $@ $(OBJDIR)\$(<F)
  188.     del $(OBJDIR)\$(<F)
  189.  
  190. !endif
  191.  
  192. !else
  193. !if "$(POST_BLD)"=="1"
  194.  
  195. .c{$(OBJDIR)}.obj:
  196.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  197.  
  198. {mppc}.c{$(OBJDIR)}.obj:
  199.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  200.  
  201. .cpp{$(OBJDIR)}.obj:
  202.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  203.  
  204. {mppc}.cpp{$(OBJDIR)}.obj:
  205.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $<
  206.  
  207. {mppc}.asm{$(OBJDIR)}.obj:
  208.     $(AS) $(AFLAGS) $(A_INCLUDES) -Fo$(OBJDIR)\ $<
  209.  
  210. !else
  211. SRCDIR =.
  212. CFILES = $<
  213. CXXFILES = $<
  214. AFILES = $<
  215.  
  216. SRCPATH = {$(SRCDIR)\$(SRCOS)\$(TARGET_CPU);$(SRCDIR)\$(SRCOS);$(SRCDIR)}
  217.  
  218. # source dir
  219.  
  220. {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
  221.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $(CXXFILES)
  222.  
  223. {$(SRCDIR)}.c{$(OBJDIR)}.obj:
  224.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $(CFILES)
  225.  
  226. # os
  227.  
  228. {$(SRCDIR)\$(OS)}.cpp{$(OBJDIR)}.obj:
  229.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $(CXXFILES)
  230.  
  231. {$(SRCDIR)\$(OS)}.c{$(OBJDIR)}.obj:
  232.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $(CFILES)
  233.  
  234. # os\cpu
  235.  
  236. {$(SRCDIR)\$(OS)\$(TARGET_CPU)}.cpp{$(OBJDIR)}.obj:
  237.     $(CC) $(CXXFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $(CXXFILES)
  238.  
  239. {$(SRCDIR)\$(OS)\$(TARGET_CPU)}.c{$(OBJDIR)}.obj:
  240.     $(CC) $(CFLAGS) $(C_INCLUDES) -Fo$(OBJDIR)\ $(CFILES)
  241.  
  242. {$(SRCDIR)\$(OS)\$(TARGET_CPU)}.asm{$(OBJDIR)}.obj:
  243.     $(AS) $(AFLAGS) -Fo$(OBJDIR)\ $(AFILES)
  244.  
  245. {$(SRCDIR)\$(OS)\$(TARGET_CPU)}.a{$(OBJDIR)}.obj:
  246.     $(CPP) $(CPPFLAGS) $(CPPFILES)
  247.     $(AAS) $(AAFLAGS) -Fo$(OBJDIR)\ $(AAFILES)
  248.     -del $(AAFILES) 2>nul
  249. !endif
  250. !endif
  251.  
  252. #
  253. # Dependencies:
  254. #
  255. # NOTE: The inference rules cause the targets to actually be built; no
  256. # commands are necessary below.
  257. #
  258. ###############################################################################
  259.  
  260. $(OBJDIR)\$(CURDIR).lib: $(OBJS) $(OBJS_NOT_IN_LIB) $(OBJDIR)\$(CURDIR).rsp
  261. !if "$(BLD_MODEL)"=="zdll" && "$(TARGET_CPU)"=="i386"
  262.     sed -f %CRT_BUILDDIR%\crt\prebuild\tools\win32\newline.sed $(OBJDIR)\$(CURDIR).rsp | sed -f %CRT_BUILDDIR%\crt\prebuild\tools\win32\delblank.sed >> temp.lst
  263.     for /F %i in (temp.lst) do %CRT_BUILDDIR%\crt\prebuild\libw32\tools\intel\whackline %i
  264.     del temp.lst
  265. !endif
  266.     $(LIB) -out:$@ @$(OBJDIR)\$(CURDIR).rsp
  267.  
  268.  
  269. $(OBJDIR)\$(CURDIR).rsp: lsources
  270.     @echo Creating response file: <<$(OBJDIR)\$(CURDIR).rsp
  271. $(OBJS)
  272. <<keep
  273.  
  274.  
  275. !IF EXIST(special.mak)
  276. !    INCLUDE special.mak    # Include special makefile additions, if any
  277. !ENDIF
  278.  
  279. !IF EXIST(depend.def)
  280. !    INCLUDE depend.def     # Include dependencies on .h files
  281. !ENDIF
  282.  
  283. #<eof>
  284.