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.

213 lines
4.6 KiB

  1. #########################################################################
  2. #
  3. # M A C R O N O T E S
  4. #
  5. # -----------------------------------------------------------------------------
  6. #
  7. # ENV_CFLAGS The additional CFLAGS.
  8. #
  9. # MESSAGE_FILE Specifies the name of the text file which stores NMAKE's
  10. # error messages.
  11. #
  12. ###############################################################################
  13. ####################
  14. # #
  15. # Error checks ... #
  16. # #
  17. ####################
  18. !ifndef INCLUDE
  19. ! error INCLUDE environment variable not defined
  20. !endif
  21. !ifndef LIB
  22. ! error LIB environment variable not defined
  23. !endif
  24. #
  25. # LANGAPI directory
  26. #
  27. !ifndef LANGAPI
  28. LANGAPI = \langapi
  29. !endif
  30. #
  31. # Set default VER
  32. #
  33. !ifdef RELEASE
  34. VER=release
  35. RCFLAGS=-D_SHIP
  36. !endif
  37. !ifndef VER
  38. VER=debug
  39. !endif
  40. #
  41. # Validate VER
  42. #
  43. !if "$(VER)" != "debug"
  44. !if "$(VER)" != "release"
  45. !error VER env var has bad value '$(VER)', use lower case 'debug/release'
  46. !endif
  47. !endif
  48. ####################
  49. # #
  50. # Macro Constants #
  51. # #
  52. ####################
  53. !if "$(NOPCH)" != "1"
  54. PCH = -YX -Fp$(OBJDIR)\nmake.pch
  55. !endif
  56. ###########################################
  57. # #
  58. # Version and TARGET dependent macros ... #
  59. # #
  60. ###########################################
  61. # message file
  62. MESSAGE_FILE = nmmsg.us
  63. !ifdef KANJI
  64. CLM = /DKANJI
  65. !endif
  66. !ifdef NT
  67. ECHO =
  68. !endif
  69. !if "$(VER)" == "debug"
  70. KEEP = keep
  71. !endif
  72. LINKER = link
  73. ##############################
  74. # #
  75. # Macro Dependent macros ... #
  76. # #
  77. ##############################
  78. CFLAGS = $(CFLAGS) $(CLM) /DNO_OPTION_Z /Fd$(OBJDIR)\nmake.pdb
  79. CFLAGS = $(CFLAGS) /GF /Gy /I$(LANGAPI)\include /nologo /W3
  80. !if "$(NOPCH)" != "1"
  81. CFLAGS = $(CFLAGS) /Fp$(OBJDIR)\nmake.pch /YXgrammar.h
  82. !endif
  83. !if "$(DBC)" != "0"
  84. CFLAGS = $(CFLAGS) /D_MBCS
  85. !message --- building _MBCS version
  86. !endif
  87. !if "$(VER)" == "debug"
  88. CFLAGS = $(CFLAGS) /Gz /MDd /Od /Zi
  89. !else # Release version
  90. CFLAGS = $(CFLAGS) /Gz /DNDEBUG /MD /O2 /Zi
  91. !endif
  92. !ifdef BROWSE
  93. CFLAGS = $(CFLAGS) /FR$(OBJDIR)^\
  94. !endif
  95. !if "$(PROCESSOR_ARCHITECTURE)" == "x86"
  96. CFLAGS = $(CFLAGS) -DWIN95
  97. !endif
  98. #############################
  99. # #
  100. # Creating Object directory #
  101. # #
  102. #############################
  103. OBJDIR = $(VER)$(_OD_EXT)
  104. !if [cd $(VER)$(_OD_EXT)]
  105. ! if [md $(VER)$(_OD_EXT)]
  106. ! error Failed creating $(VER)$(_OD_EXT) directory!
  107. ! else if [cd $(VER)$(_OD_EXT)]
  108. ! error Failed cd to $(VER)$(_OD_EXT) directory!
  109. ! endif
  110. !endif
  111. !if [cd $(MAKEDIR)]
  112. ! error Failed cd to $(MAKEDIR) directory!
  113. !endif
  114. ##############################
  115. # #
  116. # Setting up inference rules #
  117. # #
  118. ##############################
  119. # Clear the Suffix list
  120. .SUFFIXES:
  121. # Set the list
  122. .SUFFIXES: .cpp .rc
  123. # The inference rules used are
  124. .cpp{$(OBJDIR)}.obj::
  125. $(CC) $(CFLAGS) /c /Fo$(OBJDIR)/ $<
  126. .rc{$(OBJDIR)}.res:
  127. rc $(RCFLAGS) -I$(LANGAPI)\include -I$(OBJDIR) -Fo$@ $<
  128. ###############################
  129. # #
  130. # Echoing useful information #
  131. # #
  132. ###############################
  133. !ifdef INFO
  134. !message VER = "$(VER)"
  135. !message CC = "$(CC)"
  136. !message LINKER = "$(LINKER)"
  137. !message OBJDIR = "$(OBJDIR)"
  138. !message CFLAGS = "$(CFLAGS)"
  139. !message
  140. !message PATH = "$(PATH)"
  141. !message INCLUDE = "$(INCLUDE)"
  142. !message LIB = "$(LIB)"
  143. !message
  144. !endif
  145. #################################
  146. # #
  147. # Providing help about building #
  148. # #
  149. #################################
  150. !if "$(HELP)" == "build"
  151. help:
  152. @type <<
  153. Define the VER environment variable to tell NMAKE what version to build.
  154. The possible values for VER are 'debug' and 'release'.
  155. The object files are always built with /Zi
  156. option. This is done to make it just a matter of linking when debugging. The
  157. 'retail' and 'cvinfo' versions differ in only that codeview information has
  158. been added. For the 'retail' version the asserts are removed.
  159. To see information about what is being built define INFO.
  160. You can define LOGO to see the compiler logo and
  161. define ECHO to see the command actually passed to the compiler. The switches
  162. passed to the compiler can be changed from the command line by defining the
  163. corresponding switches used in def.mak.
  164. <<
  165. !endif