defs.diab
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:8k
源码类别:

VxWorks

开发平台:

C/C++

  1. # defs.diab  -  arch independent definitions specific to the Diab toolchain
  2. #
  3. # modification history
  4. # --------------------
  5. # 02l,08may02,jab  removed -Xexception as it is default
  6. # 02k,01may02,sn   Define TOOL_FAMILY, deprecate TOOL_VENDOR
  7. # 02j,18apr02,jab  workaround CPP_PRINT_MACROS problem of writing .o (SPR75718
  8. #                  + SPR75486)
  9. # 02i,03apr02,jab  made -Xmismatch-warning only visible to C
  10. # 02h,21mar02,rbl  adding macro so that project facility can add 
  11. #    -Xmemory-is-volatile to bsp files
  12. # 02g,22mar02,dat  Adding PIC flags for bootInit.o (72825)
  13. # 02f,13mar02,sn   SPR 74080 - added large project support for Diab
  14. # 02e,07mar02,jab  added -Xlocal-data-area-static-only option
  15. # 02d,14feb02,jab  added -r4 to LD_PARTIAL_LAST_FLAGS
  16. # 02c,06feb02,t_m  change ranlib to ranlib$(TOOLENV)
  17. # 02b,21jan02,sn   removed obsolete WFC flags; removed unused C++_TEMPLATE_INST
  18. # 02a,02jan02,jab  use -Xclib-optim-off instead of -Xintrinsic-mask
  19. # 01z,20dec01,jab  use -r instead of -r4
  20. # 01y,13dec01,jab  added make variable BOOTCONFIG_FLAGS
  21. # 01x,07dec01,dat  Adding -w to all dependency generation macros
  22. # 01x,05dec01,tpw  Rename Diab linker scripts to facilitate regeneration from
  23. #                  a common template.
  24. # 01w,28nov01,jab  modified ldscript path
  25. # 01v,13nov01,tam  changed definition of CC_LIB (repackaging)
  26. # 01u,13nov01,dat  adding project link flags
  27. # 01t,05nov01,rbl  let project facility know about optimization flags
  28. # 01s,12nov01,tam  remove -Xrescan-restart; changed TOOL_CONFIG to 
  29. #    TOOL_COMMON_DIR
  30. # 01r,12nov01,jab  really fixed CPP_PRINT_MACROS
  31. # 01q,12nov01,jab  fixed CPP_PRINT_MACROS
  32. # 01p,07nov01,jab  added -Xgenerate-paddr to LD_FLAGS
  33. # 01o,06nov01,sn   pass the architecture name to munch
  34. # 01n,06nov01,jab  various flag changes and documentation
  35. # 01m,03nov01,tam  updated for repackaging
  36. # 01l,01nov01,jab  flag changes
  37. # 01k,30oct01,tpw  Take generic defaults from new fragment defs.common
  38. # 01j,30oct01,sn   Use GNU nm and objcopy
  39. # 01i,30oct01,jab  sync diab CPP definition with gnu
  40. # 01h,29oct01,jab  added new ld script variables
  41. # 01g,24oct01,dat  Relocating tool specific macros
  42. # 01f,24oct01,jab  added new dependency generation variables
  43. # 01e,22oct01,jab  cleaned up
  44. # 01d,23oct01,dee  remove nm$(TOOLENV)
  45. # 01c,19oct01,jab  added make variables for dependency generation option
  46. #                  added missing OPTION_* make variables
  47. # 01b,18oct01,dat  Moving tool specifics out of h/make
  48. # 01a,17feb00,jab  created.
  49. #
  50. # DESCRIPTION
  51. # This file contains architecture independent  definitions and flags for the
  52. # Diab tools (compiler, assembler, linker etc.)
  53. #
  54. #
  55. # The following switches are used to compile C/C++ source. Most of these
  56. # are being used to make the compiler lax regarding coding conventions
  57. # used in many source files; however, some are being used to work around
  58. # problems in specific source files.
  59. #
  60. #
  61. # -Xmismatch-warning=2     do not generate an error if identifiers are
  62. #                          redeclared
  63. # -ew1554                  do not generate an error if the operators of
  64. #                          an expression have incompatible types
  65. # -ew1551                  do not generate an error if function arguments
  66. #                          don't match their prototype
  67. # -ew1552                  do not generate an error if the type of an
  68. #                          initializer does not match the type of the
  69. #                          variable
  70. # -ew1547                  do not generate an error if an attempt is made
  71. #                          to take the address of an object that is not
  72. #                          in memory
  73. # -ew1086                  do not generate an error if identifiers are
  74. #                          redeclared (same as -Xmismatch-warnings=2?) 
  75. # -ew1047                  do not generate an error if a ptr-to-const
  76. #                          is assigned to ptr
  77. # -ei1516                  turn off 'paramater X is never used' warning
  78. # -ei1643                  turn off 'narrowing signed-to-unsigned type
  79. #                          conversion found: ...' warning
  80. # -ei1604                  turn off 'usless assignment to variable X'
  81. #                          warning
  82. # -Xintrinsic-mask=0x0     turn off generation of abs/fabs intrinsic; is
  83. #                          this still needed?
  84. # -Xstrings-in-text=0      do not put string constants in text; Is this
  85. #                          still needed?
  86. # -Wa,-Xsemi-is-newline    treat semi-colons as newline; this is required
  87. #                          to handle inline assembly correctly
  88. #
  89. ## generic defaults from defs.common come first, so they can be overridden
  90. include $(TGT_DIR)/h/tool/common/defs.common
  91. ## get TOOL_COMMON_DIR, TOOL_DIAB and TOOL_GNU from TOOL
  92. TOOL_FAMILY     = diab
  93. TOOL_COMMON_DIR = $(subst diab,common,$(TOOL))
  94. TOOL_DIAB = $(TOOL)
  95. TOOL_GNU = $(subst diab,gnu,$(TOOL))
  96. # Deprecated, use TOOL_FAMILY instead
  97. TOOL_VENDOR = diab
  98. ## diab toolchain binaries
  99. AR = dar
  100. AS = $(CC)
  101. CC = dcc
  102. CXX = $(CC)
  103. CPP = $(CC) -E -Xpreprocessor-lineno-off
  104. LD = dld
  105. NM = nm$(TOOLENV)
  106. ## utility binaries
  107. RANLIB = ranlib$(TOOLENV)
  108. TCL = wtxtcl
  109. OBJCPY = objcopy
  110. SIZE = size$(TOOLENV)
  111. MUNCH            = wtxtcl $(WIND_BASE)/host/src/hutils/munch.tcl $(MUNCH_FLAGS)
  112. CF =
  113. CPP_PRINT_MACROS        = $(CC) $(TGT_FLAG) $(COMMON_COMPILER) -w -P 
  114.   -Xcpp-dump-symbols $(CC_INCLUDE) $(CC_DEFINES) 
  115.   -o $(NULL_DEVICE)
  116. ## project facility variables
  117. LARGE_PROJECT    = true
  118. OPTION_INDIRECT_FILE    = -@
  119. OPTION_NM_INDIRECT_FILE = @
  120. CC_PROJECT_OPTIMIZE_FLAGS = -O -XO
  121. PROJECT_BSP_FLAGS_EXTRA = $(filter -Xmemory-is-volatile,$(CC_OPTIM_TARGET))
  122. ## C flags
  123. COMMON_COMPILER = -W:c:,-Xmismatch-warning=2 -ew1554,1551,1552,1086,1047,1547 
  124.   -Xclib-optim-off -Xansi -Xstrings-in-text=0 
  125.   -Wa,-Xsemi-is-newline -ei1516,1643,1604 
  126.   -Xlocal-data-area-static-only
  127. CC_ARCH_SPEC = $(TGT_FLAG)
  128. CC_COMPILER     = $(COMMON_COMPILER)
  129. CC_OPTIM_NORMAL = -XO -Xsize-opt
  130. CC_OPTIM_TARGET = -XO -Xsize-opt -Xmemory-is-volatile
  131. CC_OPTIM_DRIVER = -Xmemory-is-volatile
  132. CC_WARNINGS_ALL = -Xlint
  133. CC_WARNINGS_NONE= -w
  134. # For T2.2, we only use this flag for GNU/MIPS combination.
  135. # We will activate this for all arch's after T2.2 release (SPR 72825)
  136. # CC_PIC = -Xcode-relative-far
  137. ## C++ flags
  138. C++_COMPILER = $(COMMON_COMPILER)
  139. ## assembler flags
  140. CFLAGS_AS = $(CC_ARCH_SPEC) $(CC_COMPILER) $(CC_OPTIM) $(CC_INCLUDE) 
  141.   $(CC_DEFINES) $(OPTION_PP_AS) $(OPTION_LANG_ASM) -c 
  142.   $(ADDED_CFLAGS)
  143. ## linker flags
  144. LDFLAGS = $(TGT_FLAG) -X -N -Xgenerate-paddr
  145. LD_PARTIAL_FLAGS = $(TGT_FLAG) -X -r
  146. LD_PARTIAL              = $(LD) $(LD_PARTIAL_FLAGS)
  147. LD_ENTRY_OPT = -e
  148. # These are flags to pass to the linker the last time we do a
  149. # relocatable link. They never get used by a bootable project
  150. # and they only get used once by a downloadable project.
  151. LD_PARTIAL_LAST_FLAGS   = -r4
  152. LD_SCRIPT_RAM = $(TGT_DIR)/h/tool/diab/ldscripts/link.RAM
  153. LD_SCRIPT_ROM = $(TGT_DIR)/h/tool/diab/ldscripts/link.ROM
  154. # for cyclic link support
  155. LD_START_GROUP =
  156. LD_END_GROUP =
  157. LD_PARTIAL_START_GROUP =
  158. LD_PARTIAL_END_GROUP =
  159. LD_LOW_FLAGS = -D_VX_START_TEXT=0x$(RAM_LOW_ADRS)
  160. LD_HIGH_FLAGS = -D_VX_START_TEXT=0x$(RAM_HIGH_ADRS)
  161. RES_LOW_FLAGS = -D_VX_START_TEXT=0x$(ROM_LINK_ADRS) -D_VX_START_DATA=0x$(RAM_LOW_ADRS)
  162. RES_HIGH_FLAGS = -D_VX_START_TEXT=0x$(ROM_LINK_ADRS) -D_VX_START_DATA=0x$(RAM_HIGH_ADRS)
  163. # Flags for VxWorks Project builds
  164. LD_RAM_FLAGS     = $(LD_LOW_FLAGS)
  165. LD_ROM_CPY_FLAGS = $(RES_HIGH_FLAGS)
  166. LD_ROM_CMP_FLAGS = $(RES_HIGH_FLAGS)
  167. LD_ROM_RES_FLAGS = $(RES_LOW_FLAGS)
  168. # For 960 IMI
  169. LD_IMI_ADRS = -D_VX_TEXT_START=0x$(IMI_TEXT_ADRS) -D_VX_DATA_START=0x$(IMI_DATA_ADRS)
  170. ## utility flags
  171. MUNCH_FLAGS     = -c $(TOOLENV)
  172. NM_GLOB_FLAGS = -g
  173. ## bsp flags
  174. ROM_ENTRY       = _romInit
  175. SYS_ENTRY       = _sysInit
  176. USR_ENTRY       = _usrInit
  177. # compressedEntry() must be first routine in .text section
  178. BOOTCONFIG_FLAGS=-Xkill-opt=0x400000
  179. ## options
  180. OPTION_PP = -E
  181. OPTION_PP_AS = -Xpreprocess-assembly
  182. OPTION_PP_NOLINENO = -Xpreprocessor-lineno-off
  183. OPTION_PP_COMMENT = -C
  184. OPTION_DEPEND = -Xmake-dependency -w
  185. OPTION_DEPEND_GEN = -Xmake-dependency -Xincfile-missing-ignore -w
  186. OPTION_DEPEND_C = $(OPTION_DEPEND_GEN)
  187. OPTION_DEPEND_AS = $(OPTION_DEPEND)
  188. OPTION_DOLLAR_SYMBOLS = -Xdollar-in-ident
  189. OPTION_ANSI = -Xansi
  190. OPTION_PASS_TO_LD       =
  191. OPTION_NO_WARNINGS =
  192. OPTION_OBJECT_ONLY = -c
  193. OPTION_INCLUDE_DIR = -I
  194. OPTION_DEFINE_MACRO = -D
  195. # this line has a space at the end ("-o ")
  196. OPTION_OBJECT_NAME = -o 
  197. OPTION_EXE_NAME = $(OPTION_OBJECT_NAME)
  198. # Library containing compiler support routines
  199. CC_LIB                  =