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.

207 lines
11 KiB

  1. # Here is where we check for all the nonsense that people put in sources files that
  2. # shouldn't be done that way.
  3. #
  4. # Errors we check for and what they mean.
  5. #
  6. # BLD1000 - LINKLIB abuse
  7. # BLD1001 - vccomsup.lib listed explicitly - should be USE_VCCOM=1
  8. # BLD1002 - IOSTREAM lib listed explicitly - should be USE_IOSTREAM=1
  9. # BLD1003 - STL lib listed explicitly - should be USE_STL=1
  10. # BLD1004 - MSVCRT lib listed explicitly - should be USE_MSVCRT=1
  11. # BLD1005 - LIBCMT lib listed explicitly - should be USE_LIBCMT=1
  12. # BLD1006 - LIBC lib listed explicitly
  13. # BLD1007 - BROWSER_INFO defined in sources file (this is a user environment setting)
  14. # BLD1008 - SXS_ASSEMBLY_VERSION contains invalid characters
  15. # BLD1009 - SXS_ASSEMBLY_NAME contains invalid characters
  16. # BLD1010 - ASSERT(SXS_ASSEMBLY_LANGUAGE xor SXS_ASSEMBLY_LANGUAGE_INDEPENDENT)
  17. # BLD1011 - SXS..
  18. # BLD1012 - SXS..
  19. # BLD1013 - SXS..
  20. # BLD1014 - SXS..
  21. # BLD1015 - SXS..
  22. #
  23. !if !defined(IGNORE_LINKLIB_ABUSE) && ("$(TARGETTYPE)" == "DYNLINK")
  24. ! if "$(LINKLIBS)" != "$(LINKLIBS:kernel32=)"
  25. !message BUILDMSG: warning BLD1000 : LINKLIB abuse (kernel32 used by mistake) ($(MAKEDIR))
  26. ! endif
  27. ! if "$(LINKLIBS)" != "$(LINKLIBS:advapi32=)"
  28. !message BUILDMSG: warning BLD1000 : LINKLIB abuse (advapi32 used by mistake) ($(MAKEDIR))
  29. ! endif
  30. ! if "$(LINKLIBS)" != "$(LINKLIBS:ole32=)"
  31. !message BUILDMSG: warning BLD1000 : LINKLIB abuse (ole32 used by mistake) ($(MAKEDIR))
  32. ! endif
  33. !endif
  34. !if "$(TARGETLIBS)" != "$(TARGETLIBS:vccomsup=)"
  35. !message BUILDMSG: warning BLD1001 : vccomsup.lib listed explicitly - use USE_VCCOM=1 ($(MAKEDIR))
  36. !endif
  37. !if "$(TARGETLIBS)" != "$(TARGETLIBS:msvcirt=)" || \
  38. "$(TARGETLIBS)" != "$(TARGETLIBS:libcimt=)" || \
  39. "$(TARGETLIBS)" != "$(TARGETLIBS:libci=)"
  40. !message BUILDMSG: warning BLD1002 : IOSTREAM lib listed explicitly - use USE_IOSTREAM=1 ($(MAKEDIR))
  41. !endif
  42. !if "$(TARGETLIBS)" != "$(TARGETLIBS:msvcprt=)" || \
  43. "$(TARGETLIBS)" != "$(TARGETLIBS:libcpmt=)" || \
  44. "$(TARGETLIBS)" != "$(TARGETLIBS:libcp=)"
  45. !message BUILDMSG: warning BLD1003 : STL lib listed explicitly - use USE_STL=1 ($(MAKEDIR))
  46. !endif
  47. !if "$(TARGETLIBS)" != "$(TARGETLIBS:msvcrt=)"
  48. !message BUILDMSG: warning BLD1004 : MSVCRT lib listed explicitly - use USE_MSVCRT=1 ($(MAKEDIR))
  49. !endif
  50. !if "$(TARGETLIBS)" != "$(TARGETLIBS:libcmt=)"
  51. !message BUILDMSG: warning BLD1005 : LIBCMT lib listed explicitly - use USE_LIBCMT=1 ($(MAKEDIR))
  52. !endif
  53. !if "$(TARGETLIBS)" != "$(TARGETLIBS:libc.lib=)"
  54. !message BUILDMSG: warning BLD1006 : LIBC lib listed explicitly ($(MAKEDIR))
  55. !endif
  56. !if defined(BROWSER_INFO) && !defined(USER_ENV_BROWSER_INFO)
  57. !message BUILDMSG: warning BLD1007 : BROWSER_INFO defined in sources file - this is a user environment setting ($(MAKEDIR))
  58. !endif
  59. !if "$(SXS_ASSEMBLY_NAME)" != ""
  60. !if defined(SXS_ASSEMBLY_VERSION)
  61. #
  62. # SXS_ASSEMBLY_VERSION may only [0-9.].
  63. # Removing them should leave nothing.
  64. #
  65. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_ASSEMBLY_VERSION)
  66. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:.=)
  67. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:0=)
  68. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:1=)
  69. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:2=)
  70. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:3=)
  71. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:4=)
  72. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:5=)
  73. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:6=)
  74. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:7=)
  75. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:8=)
  76. SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS=$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS:9=)
  77. !if "$(SXS_CHECK_ASSEMBLY_VERSION_CHARACTERS)" != ""
  78. !message BUILDMSG: warning BLD1008 : SXS_ASSEMBLY_VERSION ($(SXS_ASSEMBLY_VERSION)) may only contain [0-9.].
  79. !endif
  80. !endif
  81. !if defined(SXS_ASSEMBLY_NAME)
  82. #
  83. # SXS_ASSEMBLY_NAME may only contain [A-Za-z0-9.-].
  84. # Removing them should leave nothing.
  85. #
  86. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_ASSEMBLY_NAME)
  87. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:.=)
  88. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:-=)
  89. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:0=)
  90. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:1=)
  91. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:2=)
  92. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:3=)
  93. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:4=)
  94. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:5=)
  95. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:6=)
  96. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:7=)
  97. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:8=)
  98. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:9=)
  99. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:a=)
  100. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:b=)
  101. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:c=)
  102. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:d=)
  103. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:e=)
  104. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:f=)
  105. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:g=)
  106. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:h=)
  107. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:i=)
  108. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:j=)
  109. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:k=)
  110. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:l=)
  111. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:m=)
  112. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:n=)
  113. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:o=)
  114. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:p=)
  115. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:q=)
  116. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:r=)
  117. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:s=)
  118. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:t=)
  119. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:u=)
  120. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:v=)
  121. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:w=)
  122. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:x=)
  123. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:y=)
  124. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:z=)
  125. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:A=)
  126. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:B=)
  127. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:C=)
  128. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:D=)
  129. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:E=)
  130. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:F=)
  131. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:G=)
  132. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:H=)
  133. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:I=)
  134. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:J=)
  135. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:K=)
  136. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:L=)
  137. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:M=)
  138. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:N=)
  139. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:O=)
  140. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:P=)
  141. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:Q=)
  142. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:R=)
  143. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:S=)
  144. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:T=)
  145. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:U=)
  146. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:V=)
  147. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:W=)
  148. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:X=)
  149. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:Y=)
  150. SXS_CHECK_ASSEMBLY_NAME_CHARACTERS=$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS:Z=)
  151. !if "$(SXS_CHECK_ASSEMBLY_NAME_CHARACTERS)" != ""
  152. !message BUILDMSG: warning BLD1009 : SXS_ASSEMBLY_NAME ($(SXS_ASSEMBLY_NAME)) may only contain [A-Za-z0-9.-].
  153. !endif
  154. !endif
  155. # SXS_SHORT_ASSEMBLY_NAME may only contains A-Za-z0-9
  156. # SXS_SHORT_ASSEMBLY_NAME may only contain 8 character elements
  157. #
  158. # ASSERT(SXS_ASSEMBLY_LANGUAGE xor SXS_ASSEMBLY_LANGUAGE_INDEPENDENT)
  159. #
  160. !if (!defined(SXS_ASSEMBLY_LANGUAGE) && !defined(SXS_ASSEMBLY_LANGUAGE_INDEPENDENT)) \
  161. || ( defined(SXS_ASSEMBLY_LANGUAGE) && defined(SXS_ASSEMBLY_LANGUAGE_INDEPENDENT))
  162. !message BUILDMSG: warning BLD1010 : Must specify SXS_ASSEMBLY_LANGUAGE or SXS_ASSEMBLY_LANGUAGE_INDEPENDENT, not both.
  163. !endif
  164. !if defined(SXS_MANIFEST_IN_RESOURCES) && !defined(SXS_MANIFEST)
  165. !message BUILDMSG: warning BLD1011 : You must specify SXS_MANIFEST if you specify SXS_MANIFEST_IN_RESOURCES.
  166. !endif
  167. !if defined(SXS_ASSEMBLY_VERSION) && !defined(SXS_ASSEMBLY_NAME)
  168. !message BUILDMSG: warning BLD1012 : You may not specify SXS_ASSEMBLY_VERSION without SXS_ASSEMBLY_NAME or SXS_SHORT_ASSEMBLY_NAME.
  169. !endif
  170. !if (defined(SXS_ASSEMBLY_LANGUAGE) || defined(SXS_ASSEMBLY_LANGUAGE_INDEPENDENT)) && !defined(SXS_ASSEMBLY_NAME)
  171. !message BUILDMSG: warning BLD1013 : You may not specify SXS_ASSEMBLY_LANGUAGE or SXS_ASSEMBLY_LANGUAGE_INDEPENDENT without SXS_ASSEMBLY_NAME or SXS_SHORT_ASSEMBLY_NAME.
  172. !endif
  173. !if defined(SXS_BINPLACE_ALSO_ROOT) && !defined(SXS_ASSEMBLY_NAME)
  174. !message BUILDMSG: warning BLD1014 : You may not specify SXS_BINPLACE_ALSO_ROOT without SXS_ASSEMBLY_NAME or SXS_SHORT_ASSEMBLY_NAME.
  175. !endif
  176. !if defined(SXS_MANIFEST)
  177. #
  178. # If removing .manifest or .Manifest from SXS_MANIFEST leaves it unchanged,
  179. # it doesn't contain either one and is invalid.
  180. #
  181. !if "$(SXS_MANIFEST:.Manifest=)" == "$(SXS_MANIFEST)" \
  182. && "$(SXS_MANIFEST:.manifest=)" == "$(SXS_MANIFEST)"
  183. !message BUILDMSG: warning BLD1015 : SXS_MANIFEST ($(SXS_MANIFEST)) must contain ".Manifest", it must end in ".Manifest or ".Manifest-src"
  184. !endif
  185. !endif
  186. !endif