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

VxWorks

开发平台:

C/C++

  1. # defs.gnu - definitions for GNU toolchain builds
  2. #
  3. # modification history
  4. # --------------------
  5. # 02f,06may02,sn   SPR 76627 - Use CC to link by default
  6. # 02e,03may02,tpw  LD_SCRIPT_DOWNLOAD cannot be derived from LD_SCRIPT_RAM.
  7. #                  It meshes poorly with scripts not named link.RAM (PPC4xx).
  8. # 02d,01may02,sn   Restore TOOL_VENDOR (some people use it)
  9. # 02c,24apr02,sn   SPR 75835 - collapse sections into text/data/bss before download
  10. # 02b,24apr02,sn   SPR 75123 - always munch -c (avoiding idiosyncratic asm behaviour)
  11. # 02a,25apr02,pai  introduced HLL_PREFIX so that prepended underscores could
  12. #                  be redefined in architecture/toolchain fragments (SPR 73382)
  13. # 01z,21mar02,rbl  adding macro so that project facility can add -fvolatile to
  14. #                  bsp files
  15. # 01y,19mar02,dat  Adding PIC flags for bootInit.o (72825)
  16. # 01x,13mar02,sn   SPR 74080 - added large project support for Diab
  17. # 01w,12feb02,sn   removed obsolete refs to GCC_EXEC_PREFIX
  18. # 01v,06feb02,t_m  change ranlib to ranlib$(TOOLENV)
  19. # 01u,21jan02,sn   removed obsolete WFC flags
  20. # 01t,13dec01,jab  added make variable BOOTCONFIG_FLAGS
  21. # 01s,05dec01,tpw  Use TGT_DIR to find linker scripts.
  22. # 01r,13nov01,tam  changed definition of CC_LIB (repackaging)
  23. # 01q,05nov01,rbl  let project facility know about optimization flags
  24. # 01p,09nov01,tam  fixed use of OPTION_PASS_TO_LD; renamed TOOL_CONFIG
  25. # 01o,02nov01,dat  adding -w to dependency generation options
  26. # 01n,30oct01,tpw  Take generic defaults from new fragment defs.common
  27. # 01m,29oct01,jab  added new ld script variables
  28. # 01l,26oct01,tam  fixed Wl usage after merge
  29. # 01k,19oct01,j_s  define cyclic link support macros
  30. #    add TOOL_CONFIG
  31. # 01j,24oct01,dat  Relocating tool specific macros
  32. # 01i,24oct01,jab  added new dependency generation variables
  33. # 01h,23oct01,jab  added variables from defs.default cleanup
  34. # 01g,19oct01,jab  added make variables for dependency generation option
  35. # 01f,18oct01,dat  Moving tool specific defines out of target/h/make
  36. # 01e,12sep01,sn   added LARGE_PROJECT, MUNCH_FLAGS and LD_PARTIAL
  37. # 01d,05jun01,mem  Added EXTRACT_HEX_FLAG, EXTRACT_BIN_FLAG, VMA_START & VMA_FLAGS
  38. # 01c,13mar01,sn   added defn of OPTION_LANG_ASM
  39. # 01b,10jan01,sn   added defn of OPTION_LANG_C
  40. # 01a,16oct00,sn   wrote
  41. #
  42. # DESCRIPTION
  43. # This file contains default definitions and flags for builds that use the 
  44. # GNU toolchain.
  45. ## generic defaults from defs.common come first, so they can be overridden
  46. include $(TGT_DIR)/h/tool/common/defs.common
  47. # get TOOL_COMMON_DIR, TOOL_DIAB and TOOL_GNU from TOOL
  48. TOOL_FAMILY = gnu
  49. TOOL_COMMON_DIR = $(subst gnu,common,$(TOOL))
  50. TOOL_DIAB = $(subst gnu,diab,$(TOOL))
  51. TOOL_GNU = $(TOOL)
  52. # Deprecated, use TOOL_FAMILY instead
  53. TOOL_VENDOR     = gnu
  54. # Preprocessor option forcing every input file to be treated as a "C" file
  55. OPTION_LANG_C=-xc
  56. # Preprocessor option forcing every input file to be treated as a assembly
  57. # file requiring C preprocessing
  58. OPTION_LANG_ASM=-xassembler-with-cpp
  59. # Library containing compiler support routines
  60. CC_LIB=
  61. OPTION_PP = -E
  62. OPTION_PP_AS = -P
  63. OPTION_PP_NOLINENO = -P
  64. OPTION_PP_COMMENT = -C
  65. OPTION_DOLLAR_SYMBOLS = -fdollars-in-identifiers
  66. OPTION_DEPEND = -M -w
  67. OPTION_DEPEND_GEN = -M -MG -w
  68. OPTION_DEPEND_C = $(OPTION_DEPEND_GEN)
  69. OPTION_DEPEND_AS = $(OPTION_DEPEND)
  70. OPTION_NO_WARNINGS = -w
  71. OPTION_ANSI = -ansi
  72. OPTION_OBJECT_ONLY = -c
  73. OPTION_INCLUDE_DIR = -I
  74. # this line has a space at the end ("-o ")
  75. OPTION_OBJECT_NAME = -o 
  76. OPTION_EXE_NAME = $(OPTION_OBJECT_NAME)
  77. OPTION_DEFINE_MACRO = -D
  78. OPTION_PIC = -fpic
  79. CC_OPTIM_DRIVER = -fvolatile
  80. CC_OPTIM_NORMAL = -O -fstrength-reduce -fcombine-regs
  81. CC_OPTIM_TARGET = -O -fvolatile
  82. CC_WARNINGS_ALL = -Wall
  83. CC_WARNINGS_NONE =
  84. CC_COMPILER = -ansi 
  85. C++_COMPILER = -ansi
  86. # used by project facility
  87. CC_PROJECT_OPTIMIZE_FLAGS = -O -O1 -O2 -O3 -O4
  88. PROJECT_BSP_FLAGS_EXTRA = $(filter -fvolatile,$(CC_OPTIM_TARGET))
  89. # For generating PIC code
  90. # For T2.2, CC_PIC is only defined for MIPS architecture see defs.mips.
  91. # CC_PIC = $(OPTION_PIC)
  92. ## toolchain binaries
  93. AS               = as$(TOOLENV)
  94. CC               = cc$(TOOLENV)
  95. CF = CC
  96. CXX = $(CC)
  97. LD               = ld$(TOOLENV)
  98. RANLIB           = ranlib$(TOOLENV)
  99. CPP = $(CC) -E -P
  100. CPP_PRINT_MACROS        = $(CPP) -dM -E -pipe $(CC_INCLUDE) $(CC_DEFINES)
  101. TCL = wtxtcl
  102. OBJCPY           = objcopy
  103. SIZE             = size$(TOOLENV)
  104. NM               = nm$(TOOLENV)
  105. AR               = ar$(TOOLENV)
  106. MUNCH            = wtxtcl $(WIND_BASE)/host/src/hutils/munch.tcl $(MUNCH_FLAGS)
  107. LARGE_PROJECT    = true
  108. OPTION_INDIRECT_FILE    = @
  109. OPTION_NM_INDIRECT_FILE = @
  110. MUNCH_FLAGS      = -c $(TOOLENV)
  111. NM_GLOB_FLAGS = -g
  112. HLL_PREFIX              = _
  113. ROM_ENTRY               = $(HLL_PREFIX)romInit
  114. SYS_ENTRY               = $(HLL_PREFIX)sysInit
  115. USR_ENTRY               = $(HLL_PREFIX)usrInit
  116. BOOTCONFIG_FLAGS =
  117. LDFLAGS          = -X -N
  118. LD_ENTRY_OPT = -e
  119. LD_PARTIAL_FLAGS = -X -r
  120. # Wherever possible we use the compiler driver as a frontend to
  121. # the linker. In particular this facilitates the GNU -frepo
  122. # template repository system. Configurations using GNU Tools
  123. # but non-GNU linkers (such as SIMHPPA)  should define
  124. # GNU_USE_LD_TO_LINK = yes
  125. ifeq ($(GNU_USE_LD_TO_LINK),)
  126. BASE_LD_PARTIAL_FLAGS   = $(filter-out -r -nostdlib,$(LD_PARTIAL_FLAGS))
  127. LD_PARTIAL              = $(CC) -r -nostdlib $(subst -,$(OPTION_PASS_TO_LD)-,$(BASE_LD_PARTIAL_FLAGS))
  128. OPTION_PASS_TO_LD       = -Wl,
  129. else
  130. LD_PARTIAL            = $(LD) $(LD_PARTIAL_FLAGS)
  131. OPTION_PASS_TO_LD     =
  132. endif
  133. # These are flags to pass to the linker the last time we do a
  134. # relocatable link. They never get used by a bootable project
  135. # and they only get used once by a downloadable project.
  136. LD_SCRIPT_DOWNLOAD      = -T $(TGT_DIR)/h/tool/gnu/ldscripts/link.OUT
  137. LD_COLLAPSE_SECTIONS    = $(LD_SCRIPT_DOWNLOAD)
  138. LD_PARTIAL_LAST_FLAGS   = $(LD_COLLAPSE_SECTIONS)
  139. LD_SCRIPT_RAM = -T $(TGT_DIR)/h/tool/gnu/ldscripts/link.RAM
  140. LD_SCRIPT_ROM = -T $(TGT_DIR)/h/tool/gnu/ldscripts/link.ROM
  141. # for cyclic link support
  142. LD_START_GROUP   = --start-group
  143. LD_END_GROUP = --end-group
  144. LD_PARTIAL_START_GROUP = $(OPTION_PASS_TO_LD)$(LD_START_GROUP)
  145. LD_PARTIAL_END_GROUP = $(OPTION_PASS_TO_LD)$(LD_END_GROUP)
  146. LD_LOW_FLAGS     = -Ttext $(RAM_LOW_ADRS)
  147. LD_HIGH_FLAGS    = -Ttext $(RAM_HIGH_ADRS)
  148. RES_LOW_FLAGS    = -Ttext $(ROM_LINK_ADRS) -Tdata $(RAM_LOW_ADRS)
  149. RES_HIGH_FLAGS   = -Ttext $(ROM_LINK_ADRS) -Tdata $(RAM_HIGH_ADRS)
  150. # For 960 IMI
  151. LD_IMI_ADRS = -Ttext $(IMI_TEXT_ADRS) -Tdata $(IMI_DATA_ADRS)