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.

187 lines
4.9 KiB

  1. !ifdef NTMAKEENV
  2. !include $(NTMAKEENV)\makefile.def
  3. !else
  4. ##############################################################################
  5. #
  6. # Makefile : Builds COMSUPP.LIB, the runtime support routines for native COM
  7. # compiler support in Visual C++
  8. #
  9. #-----------------------------------------------------------------------------
  10. #
  11. # Usage: NMAKE CLEAN (removes all intermediate files)
  12. # or: NMAKE options (builds library)
  13. #
  14. # 'Options' are one each of:
  15. #
  16. # "DEBUG" (defaults to 0)
  17. # If this item is 1, then an unoptimized library with debugging
  18. # support is generated. If this item is 0, then an optimized
  19. # library without debugging support is generated. Debug support
  20. # does not include CodeView information (though it does change the
  21. # CodeView default).
  22. #
  23. # "CODEVIEW" (defaults to $(DEBUG))
  24. # If this item is 0, no CodeView debug info is generated. If 1,
  25. # then compile switch /Z7 is used to generate CodeView info in the
  26. # objects.
  27. #
  28. # "BROWSE" (defaults to $(DEBUG))
  29. # If this item is 1, then the browse database is built.
  30. #
  31. # "PLATFORM" (defaults depend on host)
  32. # This option chooses the appropriate tools and sources for the
  33. # different platforms supported by Visual C++. Currently INTEL,
  34. # MIPS, ALPHA, PPC, M68K, and MPPC are supported.
  35. #
  36. # "OPT" (no default value)
  37. # This allows additional compiler options to be added to the build.
  38. # If more than one switch is desired, put double-quotes around the
  39. # whole OPT argument, e.g., "OPT=/FAsc /Fm".
  40. #
  41. ##############################################################################
  42. ##############################################################################
  43. # Set up defaults
  44. # Default PLATFORM depending on host environment
  45. !ifndef PLATFORM
  46. ! ifndef PROCESSOR_ARCHITECTURE
  47. PROCESSOR_ARCHITECTURE=x86
  48. ! endif
  49. ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  50. PLATFORM = INTEL
  51. ! else if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
  52. PLATFORM = MIPS
  53. ! else if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
  54. PLATFORM = ALPHA
  55. ! else if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
  56. PLATFORM = PPC
  57. ! else
  58. ! error Unknown PROCESSOR_ARCHITECTURE: $(PROCESSOR_ARCHITECTURE)
  59. ! endif
  60. !endif
  61. # Default to DEBUG=0
  62. !ifndef DEBUG
  63. DEBUG = 0
  64. !endif
  65. # Default to CODEVIEW=$(DEBUG)
  66. !ifndef CODEVIEW
  67. CODEVIEW = $(DEBUG)
  68. !endif
  69. # Default to BROWSE=$(DEBUG)
  70. !ifndef BROWSE
  71. BROWSE = $(DEBUG)
  72. !endif
  73. ##############################################################################
  74. # Parse options
  75. # DEBUG options
  76. !if "$(DEBUG)" != "0"
  77. LIBSUFX = d
  78. DBFLAGS = /Od /MLd
  79. DBDEFS = /D_DEBUG
  80. OUTDIR = Debug
  81. !else
  82. LIBSUFX =
  83. DBFLAGS = /O1 /ML
  84. DBDEFS =
  85. OUTDIR = Release
  86. !endif
  87. # CODEVIEW options
  88. !if "$(CODEVIEW)" != "0"
  89. DBFLAGS = $(DBFLAGS) /Z7
  90. !endif
  91. # BROWSE options
  92. !if "$(BROWSE)" != "0"
  93. BRFLAGS = /FR$O\ # space after backslash
  94. !else
  95. BRFLAGS =
  96. !endif
  97. # PLATFORM options
  98. !if "$(PLATFORM)" == "INTEL"
  99. PDEFS = /D_X86_
  100. !else if "$(PLATFORM)" == "MIPS"
  101. PDEFS = /D_MIPS_
  102. !else if "$(PLATFORM)" == "ALPHA"
  103. PDEFS = /D_ALPHA_
  104. !else if "$(PLATFORM)" == "PPC"
  105. PDEFS = /D_PPC_
  106. !else if "$(PLATFORM)" == "M68K"
  107. PDEFS = /D_68K_ /D_MAC
  108. !else if "$(PLATFORM)" == "MPPC"
  109. PDEFS = /D_MPPC_ /D_MAC
  110. !else
  111. ! error PLATFORM must be one of INTEL, MIPS, ALPHA, PPC, M68K, or MPPC
  112. !endif
  113. # short macros for source/object directories
  114. H = include
  115. O = $(OUTDIR)
  116. ##############################################################################
  117. # Compile options
  118. PROJNAME = comsupp
  119. LIBNAME = $O\$(PROJNAME)$(LIBSUFX).lib
  120. CFLAGS = /nologo /W3 /WX /GXRFy /Zl /YX /Fp$O\$(PROJNAME).pch
  121. INCS = /I$H
  122. DEFS = $(PDEFS) $(DBDEFS)
  123. CFLAGS = $(CFLAGS) $(DBFLAGS) $(BRFLAGS) $(DEFS) $(INCS) $(OPT)
  124. ##############################################################################
  125. # Build rules
  126. .SUFFIXES:
  127. .SUFFIXES: .c .cpp .obj .lib
  128. .c{$O}.obj:
  129. $(CC) $(CFLAGS) /Fo$O\ /c $<
  130. .cpp{$O}.obj:
  131. $(CC) $(CFLAGS) /Fo$O\ /c $<
  132. ##############################################################################
  133. # Library components
  134. OBJS = $O\comsupp.obj $O\comraise.obj $O\comutil.obj
  135. SBRS = $(OBJS:.obj=.sbr)
  136. ##############################################################################
  137. # Targets
  138. GOALS = create.dir $(LIBNAME)
  139. all: $(GOALS)
  140. create.dir:
  141. @-if not exist $O\*.* mkdir $O
  142. clean:
  143. -if exist $O\*.obj del $O\*.obj
  144. -if exist $O\*.sbr del $O\*.sbr
  145. -if exist $O\*.lib del $O\*.lib
  146. -if exist $O\*.bsc del $O\*.bsc
  147. -if exist $O\*.pch del $O\*.pch
  148. -if exist $O\*.* rmdir $O
  149. $(LIBNAME): $(OBJS)
  150. link /lib /nologo /out:$(LIBNAME) $(OBJS)
  151. !if "$(BROWSE)" != "0"
  152. bscmake /nologo /o $O\$(PROJNAME).bsc $(SBRS)
  153. !endif
  154. ##############################################################################
  155. # Dependencies and individual build rules
  156. $O\comsupp.obj: $H\comdef.h $H\comip.h
  157. $O\comraise.obj: $H\comdef.h $H\comip.h
  158. $O\comutil.obj: $H\comdef.h $H\comutil.h $H\comip.h
  159. !endif